Re: Idea: Avoid JOINs by using path expressions to follow FKs - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Idea: Avoid JOINs by using path expressions to follow FKs
Date
Msg-id 20210327211106.GA2507@alvherre.pgsql
Whole thread Raw
In response to Idea: Avoid JOINs by using path expressions to follow FKs  ("Joel Jacobson" <joel@compiler.org>)
Responses Re: Idea: Avoid JOINs by using path expressions to follow FKs  ("Joel Jacobson" <joel@compiler.org>)
Re: Idea: Avoid JOINs by using path expressions to follow FKs  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
On 2021-Mar-27, Joel Jacobson wrote:

> If there would be multiple foreign keys on a column we try to follow,
> the query planner would throw an error forcing the user to use explicit joins instead.

This seems pretty dangerous -- you just have to create one more FK, and
suddenly a query that worked perfectly fine, now starts throwing errors
because it's now ambiguous.  Feels a bit like JOIN NATURAL, which many
people discourage because of this problem.

-- 
Álvaro Herrera                            39°49'30"S 73°17'W
Si no sabes adonde vas, es muy probable que acabes en otra parte.



pgsql-hackers by date:

Previous
From: Pantelis Theodosiou
Date:
Subject: Re: Idea: Avoid JOINs by using path expressions to follow FKs
Next
From: Mark Wong
Date:
Subject: Re: [GSoC] Question about Add functionality to pg_top and supporting tools