Re: Foreign key joins revisited

From: Sascha Kuhl <yogidabanli(at)gmail(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Foreign key joins revisited
Date: 2021-12-26 18:54:40
Message-ID: CAPvVvKB6+mmAqCQbrWAikbEf4zcihrWmsbqD5K=2mFDCTC+mOA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Could you make

JOIN key ?

Joel Jacobson <joel(at)compiler(dot)org> schrieb am So., 26. Dez. 2021, 19:52:

> On Sun, Dec 26, 2021, at 19:33, Sascha Kuhl wrote:
> > The Syntax is great. Which language does it come from. I consider it not
> german. But I understand it mathematically.
> > Great extension.
>
> It doesn't come from any language. But I've seen similar features in ORMs,
> such as the jOOQ Java project. [1]
>
> Actually, I think jOOQ's "ON KEY" terminology might be something to take
> inspiration from.
> In jOOQ, it's a Java method .onKey(), but I think it would look nice in
> SQL too:
>
> LEFT JOIN role r ON KEY p.permission_role_id_fkey
>
> I think it would be nice if we could simply using dot "." instead of "->"
> or whatever.
> I think it should be possible since "ON KEY" would avoid any ambiguity in
> how to interpret what comes after.
> We would know "permission_role_id_fkey" is a foreign key name and not a
> column.
> Or is the grammar too sensitive for such creativity?
>
> [1]
> https://www.jooq.org/doc/latest/manual/sql-building/table-expressions/joined-tables/join-predicate-on-key/
>
> /Joel
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2021-12-26 19:00:09 Re: Foreign key joins revisited
Previous Message Joel Jacobson 2021-12-26 18:52:37 Re: Foreign key joins revisited