Re: references to variable in another schema - Mailing list pgsql-novice

From Tom Lane
Subject Re: references to variable in another schema
Date
Msg-id 12608.1194631003@sss.pgh.pa.us
Whole thread Raw
In response to references to variable in another schema  (Mija Lee <mija@scharp.org>)
Responses Re: references to variable in another schema
Re: references to variable in another schema
List pgsql-novice
Mija Lee <mija@scharp.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);

            regards, tom lane

pgsql-novice by date:

Previous
From: "Sean Davis"
Date:
Subject: Re: references to variable in another schema
Next
From: "Sean Davis"
Date:
Subject: Re: references to variable in another schema