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

Re: references to variable in another schema

From: "Sean Davis" <sdavis2(at)mail(dot)nih(dot)gov>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Mija Lee" <mija(at)scharp(dot)org>, pgsql-novice(at)postgresql(dot)org
Subject: Re: references to variable in another schema
Date: 2007-11-09 17:59:20
Message-ID: 264855a00711090959r1ed3dbbbra14dda1241a25ddd@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Nov 9, 2007 12:56 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Mija Lee <mija(at)scharp(dot)org> writes:
> > I wanted to put a reference on a table in the public schema that
> > references a column in a table in another schema. I tried:
>
> > create table cellphone(emplid integer not null references
> > admin.tbl_employee.employee_id);
>
> Should be
>
> create table cellphone(emplid integer not null
>         references admin.tbl_employee(employee_id));
>
> Or, if employee_id is the declared primary key of tbl_employee, you can
> just say
>
> create table cellphone(emplid integer not null
>         references admin.tbl_employee);

Thanks, Tom.  I was woefully off-target.

Sean

In response to

pgsql-novice by date

Next:From: Mija LeeDate: 2007-11-09 18:13:23
Subject: Re: references to variable in another schema
Previous:From: Tom LaneDate: 2007-11-09 17:56:43
Subject: Re: references to variable in another schema

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