Re: [Postgresql-it] Cambio primary key

  • From: Enrico <scotty@xxxxxxxxxxxx>
  • To: postgresql-it@xxxxxxxxxxxxxxxxx
  • Date: Thu, 03 Feb 2005 18:16:48 +0100

Roberto Rambaldi wrote:

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.
_______________________________________________

TNX Enrico

Other related posts: