From: | "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov> |
---|---|
To: | "Isaac Vetter" <ivetter(at)math(dot)purdue(dot)edu> |
Cc: | pgsql-novice(at)postgresql(dot)org |
Subject: | Re: schema question |
Date: | 2007-12-11 16:01:36 |
Message-ID: | 264855a00712110801o47637b61vfb17e1e55dcc673c@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
On Dec 11, 2007 10:57 AM, Isaac Vetter <ivetter(at)math(dot)purdue(dot)edu> wrote:
> Hi All;
>
> I'm much more of a web developer than dba, that's why I'm asking this of
> the novice list.
>
> I've got a database in postgresql 7.4 with 111 tables.
>
> I recently created the 111th table and I cannot create foreign key
> constraints.
>
> Postgresql acts like the new table is in a different schema that the
> referenced table. Additionally, if I go back to a previously created
> table and try to rename a foreign key column (by dropping and adding) I
> cannot recreate the foreign key. The error that I get is that the
> referenced schema does not exist:
>
> ERROR: schema "table2" does not exist
>
> If I specify the schema name on both tablenames, when adding the
> constraint:
>
> alter table public.table1 add foreign key(table2_id) references
> public.table2.id;
>
This should be:
public.table2(id)
Does that fix the problem?
Sean
From | Date | Subject | |
---|---|---|---|
Next Message | Isaac Vetter | 2007-12-11 16:18:28 | Re: schema question |
Previous Message | Isaac Vetter | 2007-12-11 15:57:13 | schema question |