From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Naz Gassiep <naz(at)mira(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Removing a schema |
Date: | 2007-08-07 13:59:55 |
Message-ID: | 20601.1186495195@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Naz Gassiep <naz(at)mira(dot)net> writes:
> I'm trying to remove a schema and move all the tables to another schema.
> I've manually run alter table on every table to move them, however all
> the foreign keys still reference the old schema,
What? It works fine for me:
regression=# create schema s1;
CREATE SCHEMA
regression=# create table s1.t1(f1 int primary key);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "t1_pkey" for table "t1"
CREATE TABLE
regression=# create table s1.t2(f1 int references s1.t1);
CREATE TABLE
regression=# create schema s2;
CREATE SCHEMA
regression=# alter table s1.t1 set schema s2;
ALTER TABLE
regression=# \d s1.t2
Table "s1.t2"
Column | Type | Modifiers
--------+---------+-----------
f1 | integer |
Foreign-key constraints:
"t2_f1_fkey" FOREIGN KEY (f1) REFERENCES s2.t1(f1)
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Kenji Morishige | 2007-08-07 14:05:18 | Re: finding reusable ids |
Previous Message | Ranieri Mazili | 2007-08-07 13:41:03 | Restricting columns by users |