Search Postgresql Archives

ALTER TABLE RENAME and primary key

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

 



I'd like to rename a table but am unsure how this will affect the primary key. That is, the table currently being named 'service', it has a pkey named 'service_id_pkey'. I'd like to change the table name to 'service_provider' (which would mean i'd get 'service_provider_id_pkey').

There's a second table that has a foreign key constraint on service_id_pkey, so do i need to drop that constraint first, rename the first table, then re-create the constraint using the new pkey name?

brian


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux