Re: schema question - Mailing list pgsql-novice

From Isaac Vetter
Subject Re: schema question
Date
Msg-id 475EB854.5050309@math.purdue.edu
Whole thread Raw
In response to Re: schema question  ("Sean Davis" <sdavis2@mail.nih.gov>)
List 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
>     public.table2.id ;
>
>
> This should be:
>
> public.table2(id)
>
> Does that fix the problem?


OMG!

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.

Isaac

Attachment

pgsql-novice by date:

Previous
From: "Sean Davis"
Date:
Subject: Re: schema question
Next
From: Mija Lee
Date:
Subject: Re: failure with pg_dump