ALTER TABLE RENAME and primary key

From: brian <brian(at)zijn-digital(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: ALTER TABLE RENAME and primary key
Date: 2006-12-09 23:22:49
Message-ID: 457B4549.5080309@zijn-digital.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Darci 2006-12-09 23:40:44 drop role with privileges
Previous Message Jamie Lawrence Jenner 2006-12-09 21:32:35 db andtable schemas