Re: Foreign key joins revisited

From: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Foreign key joins revisited
Date: 2021-12-26 22:25:05
Message-ID: CADkLM=dBY77FzeXWm6Mq2NmGA81TyowsdDufnKSur==u=X9jFQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
>
>
> Perhaps this would be more SQL idiomatic:
>
> FROM permission p
> LEFT JOIN ON KEY role IN p AS r
> LEFT JOIN team_role AS tr ON KEY role TO r
> LEFT JOIN ON KEY team IN tr AS t
> LEFT JOIN user_role AS ur ON KEY role TO r
> LEFT JOIN ON KEY user IN ur AS u
>
>
My second guess would be:

FROM permission p
LEFT JOIN role AS r ON [FOREIGN] KEY [(p.col1 [, p.col2 ...])]

where the key spec is only required when there are multiple foreign keys in
permission pointing to role.

But my first guess would be that the standards group won't get around to it.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Euler Taveira 2021-12-26 22:57:24 Re: row filtering for logical replication
Previous Message Joel Jacobson 2021-12-26 21:51:30 Re: Foreign key joins revisited