Re: [GENERAL] Syntax error needs fresh eyeballs

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: [GENERAL] Syntax error needs fresh eyeballs
Дата
Msg-id alpine.LNX.2.11.1612261610230.25972@localhost
обсуждение исходный текст
Ответ на Re: [GENERAL] Syntax error needs fresh eyeballs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Mon, 26 Dec 2016, Tom Lane wrote:

>> ERROR:  there is no unique constraint matching given keys for referenced
>> table "weather_params".
>
> because Weather_Params.param isn't constrained to be unique.
  ...
> Seeing that Weather_Data also has a site_id column, I'm going to guess
> that what you wanted to put in Weather_Data is a two-column FK:
>
>     FOREIGN KEY (site_id, param) REFERENCES Weather_Params (site_id, param)
>
> That would match Weather_Params' pkey, so it's enough to identify a
> unique row of Weather_Params.

   Thanks, Tom. Yes, I do want a 2-column FK.

Much appreciated,

Rich


В списке pgsql-general по дате отправления:

Предыдущее
От: "Mike Sofen"
Дата:
Сообщение: Re: [GENERAL] Syntax error needs fresh eyeballs
Следующее
От: Thomas.Deboben.ext@rohde-schwarz.com
Дата:
Сообщение: Re: [GENERAL] Windows installation - could not connect to server:Connection refused (0x0000274D/10061)