Re: references to variable in another schema

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: references to variable in another schema
Дата
Msg-id 12608.1194631003@sss.pgh.pa.us
обсуждение исходный текст
Ответ на references to variable in another schema  (Mija Lee <mija@scharp.org>)
Ответы Re: references to variable in another schema  ("Sean Davis" <sdavis2@mail.nih.gov>)
Re: references to variable in another schema  (Mija Lee <mija@scharp.org>)
Список 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 по дате отправления:

Предыдущее
От: "Sean Davis"
Дата:
Сообщение: Re: references to variable in another schema
Следующее
От: "Sean Davis"
Дата:
Сообщение: Re: references to variable in another schema