Re: [HACKERS] Make subquery alias optional in FROM clause - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: [HACKERS] Make subquery alias optional in FROM clause
Date
Msg-id CAKFQuwb4Vo+_oj2mfqEo=Jv-iddvN-90BjcwU1kUN7jDssKdJQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Make subquery alias optional in FROM clause  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Make subquery alias optional in FROM clause
List pgsql-hackers
On Wed, Feb 22, 2017 at 8:08 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Bernd Helmle <mailings@oopsware.de> writes:
>> From time to time, especially during migration projects from Oracle to
> PostgreSQL, i'm faced with people questioning why the alias in the FROM
> clause for subqueries in PostgreSQL is mandatory. The default answer
> here is, the SQL standard requires it.

Indeed.  When I wrote the comment you're referring to, quite a few years
ago now, I thought that popular demand might force us to allow omitted
aliases.  But the demand never materialized.  At this point it seems
clear to me that there isn't really good reason to exceed the spec here.
It just encourages people to write unportable SQL code.

​I'll contribute to the popular demand aspect but given that the error is good and the fix is very simple its not exactly a strong desire.

My code is already unportable since I choose to use "::" for casting - and I'm sure quite a few other PostgreSQL-specific things - so the portability aspect to the argument is already thin for me and moreso given other DBMSes already relax the requirement.

David J.​

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [HACKERS] Replication vs. float timestamps is a disaster
Next
From: Jim Nasby
Date:
Subject: Re: [HACKERS] Change in "policy" on dump ordering?