Re: "SELECT ... FROM DUAL" is not quite as silly as it appears

David Rowley <david.rowley@2ndquadrant.com>

From: David Rowley <david.rowley@2ndquadrant.com>
To: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Stefan Keller <sfkeller@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-01-28T11:38:15Z
Lists: pgsql-hackers
On Mon, 28 Jan 2019 at 22:31, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> Stefan Keller wrote:
> > Pls. try to give DUAL a better name, since it's IMHO neither
> > self-explaining nor correct.
>
> I agree with the sentiment.
> On the other hand, people who migrate from Oracle might be happy if
> there is a DUAL table that allows them to migrate some of their
> statements unmodified.

hmm. You both know the table of that name exists only as part of a
regression test, right?  It'll just exist for a handful of
milliseconds during make check.

My comment about the poorly named table may have been a bit pedantic
as far as what a table in a test should be called, but I also felt a
bit of an urge to make a little bit of fun about having a table named
dual which always has just a single row. Knowing the reasons for
Oracle's naming of the table helps explain why they ended up with the
poorly named table. I didn't think that warranted us doing the same
thing, even if it's just a short-lived table inside a regression test.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Commits

  1. In the planner, replace an empty FROM clause with a dummy RTE.

  2. Fix jit compilation bug on wide tables.