Re: Foreign key joins revisited

Поиск
Список
Период
Сортировка
От Joel Jacobson
Тема Re: Foreign key joins revisited
Дата
Msg-id 1ff9d756-f1f1-4048-af80-2098501f5a59@www.fastmail.com
обсуждение исходный текст
Ответ на Re: Foreign key joins revisited  (Isaac Morland <isaac.morland@gmail.com>)
Список pgsql-hackers
On Mon, Dec 27, 2021, at 17:03, Isaac Morland wrote:
> On Mon, 27 Dec 2021 at 10:20, Joel Jacobson <joel@compiler.org> wrote:

> Foreign key constraint names have been given the same names as the referenced tables.
>
> While I agree this could be a simple approach in many real cases for having easy to understand FK constraint names, I
> wonder if for illustration and explaining the feature if it might work better to use names that are completely unique so that
> it's crystal clear that the names are constraint names, not table names.

Good point, I agree. New version below:

FROM permission p
LEFT JOIN KEY p.permission_role_id_fkey r
LEFT JOIN team_role tr KEY team_role_role_id_fkey REF r
LEFT JOIN KEY tr.team_role_team_id_fkey t
LEFT JOIN user_role ur KEY user_role_role_id_fkey REF r
LEFT JOIN KEY ur.user_role_user_id_fkey u
WHERE p.id = 1;

Thoughts?

/Joel

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: default to to ON_ERROR_STOP=on (Re: psql: exit status with multiple -c and -f)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Column Filtering in Logical Replication