Skip site navigation (1) Skip section navigation (2)

Re: schema question

From: Isaac Vetter <ivetter(at)math(dot)purdue(dot)edu>
To: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: schema question
Date: 2007-12-11 16:18:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
Sean Davis wrote:
>     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
> ;
> This should be:
> public.table2(id)
> Does that fix the problem?


This was exactly the problem: a stupid syntax error.

I've literally created hundreds of foreign keys in pgsql, but did not 
see the problem with this one.

Much thanks, Sean.


In response to

pgsql-novice by date

Next:From: Mija LeeDate: 2007-12-11 16:34:05
Subject: Re: failure with pg_dump
Previous:From: Sean DavisDate: 2007-12-11 16:01:36
Subject: Re: schema question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group