Re: [Postgresql-it] Cambio primary key
- From: Roberto Rambaldi <Roberto.Rambaldi@xxxxxxxxx>
- To: postgresql-it@xxxxxxxxxxxxxxxxx
- Date: Thu, 3 Feb 2005 18:05:19 +0100
On Thursday 03 February 2005 17:54, Enrico wrote:
A una tabella gia esistente con 2 campi in chiave primaria dovrei
aggiungere altri campi in chiave primaria senza cancellare la tabella
stessa, come posso fare?
alter table <tab> add column etc..
poi inserisci/popoli i campi
alter table <tab> drop constraint <quello associato all PK>;
alter table <tab> add constraint <nome> primary key ( <lista campi> );
ciao
-R.
Other related posts: