Re: Foreign key joins revisited - Mailing list pgsql-hackers

From Corey Huinker
Subject Re: Foreign key joins revisited
Date
Msg-id CADkLM=dBY77FzeXWm6Mq2NmGA81TyowsdDufnKSur==u=X9jFQ@mail.gmail.com
Whole thread Raw
In response to Re: Foreign key joins revisited  ("Joel Jacobson" <joel@compiler.org>)
Responses Re: Foreign key joins revisited
List 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.

pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: Foreign key joins revisited
Next
From: "Euler Taveira"
Date:
Subject: Re: row filtering for logical replication