Re: references to variable in another schema

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mija Lee <mija(at)scharp(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: references to variable in another schema
Date: 2007-11-09 17:56:43
Message-ID: 12608.1194631003@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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);

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Sean Davis 2007-11-09 17:59:20 Re: references to variable in another schema
Previous Message Sean Davis 2007-11-09 17:52:47 Re: references to variable in another schema