[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Postgresql-it] Nuova struttura tabella e vecchi record



Ciao,

ALTER TABLE tabella RENAME TO tmp_tabella;

CREATE TABLE tabella (
  nome_cognome varchar(255) NOT NULL...,
  telefono varchar(64),
  PRIMARY KEY (nome_cognome)

  -- poi vedi tu la struttura...
);

INSERT INTO tabella (nome_cognome, telefono) SELECT nome || ' ' || cognome,
telefono FROM tabella_tmp;


Ciao ciao
-- 
Matteo Beccati
http://www.phpadsnew.com/
http://www.phppgads.com/