On Mon, Dec 27, 2021, at 17:03, Isaac Morland wrote:
> On Mon, 27 Dec 2021 at 10:20, Joel Jacobson <j...@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

Reply via email to