public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Denis Garsh <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Add system column support to the USING clause
Date: Fri, 13 Sep 2024 10:56:19 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Denis Garsh <[email protected]> writes:
> The patch adds support for system columns in JOIN USING clause.

I think this is an actively bad idea, and it was likely intentional
that it's not supported today.  A few reasons why:

* There are, fundamentally, no use-cases for joining on system
columns.  The only one that is stable enough to even consider
using for the purpose is tableoid, and I'm not detecting a reason
why that'd be useful.  If there are any edge cases where people
would actually wish to do that, it can be done easily enough with
a standard JOIN ON clause.

* Non-heap table AMs may not provide the same system columns that
heap does, further reducing the scope for plausible use-cases.
(Yeah, I know we don't support that too well today.)

* This breaks ruleutils.c's mechanism for dealing with name
conflicts across multiple USING clauses.  That relies on being
able to assign aliases to the USING inputs at the table level
(that is, "FROM realtable AS aliastable(aliascolumn,...)").
There's no way to alias a system column in the FROM syntax.

			regards, tom lane






view thread (5+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Add system column support to the USING clause
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox