Subject: references to variable in another schema
From: tgl@sss.pgh.pa.us (Tom Lane)
Date: 11/9/2007 12:56:43 PM
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
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
|