pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Paul Lambert <plengada@optusnet.com.au>
To: Ken Johanson <pg-user@kensystem.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Shorthand column labels (SELECT col1 foo, ...) vs (SELECT col1 AS foo, ...)
Date: Thu, 10 Jan 2008 17:04:04 +0900
Message-ID: <4785D174.4030203@optusnet.com.au> (raw)
In-Reply-To: <4785CBE9.6000108@kensystem.com>
References: <4785C50F.6010505@kensystem.com>
	<4785C744.6080406@optusnet.com.au>
	<4785CBE9.6000108@kensystem.com>

Ken Johanson wrote:
> Interesting thread(s)!
> 
> What I didn't see discussed was the possibility of making a server 
> and/or session option, where we could elect to turn-off the old behavior 
> (PG specific behavior) and enable the standard/shorthand syntax. Users 
> need a migration path.
> 
> I personally cant ever see using those PGisms/features and would choose 
> to enable the standard mode. I think I'd have fewer compatibility problems.
> 
> Ken

What was discussed is that the AS keyword is required because of the way 
the interpreter parses the commands.

With the example given, how does it know that 1::character varying isn't 
casting to a character field with an alias of varying or a character 
varying field with no alias?

If there was simply a switch to turn the requirement on or off that's 
not going to stop things from breaking - the postfix operators still 
need to be picked up somehow, it's a technical limitation rather than a 
"let's just be difficult and be incompatible with other dbms's" limitation

I think it would be nice as well, I had to migrate a system that didn't 
bother putting AS in any of it's views/stored procedures etc and went 
through this pain - but I think having to change everything was worth it 
to make sure all my scripts were correctly written and free from 
possible misinterpretation.

My thoughts anyway.



view thread (4+ messages)

Message-ID: <4785D174.4030203@optusnet.com.au>
Permalink:  ../4785D174.4030203@optusnet.com.au/
Also on:    postgresql.org/message-id/4785D174.4030203@optusnet.com.au

 · 

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: pgsql-sql@postgresql.org
  Cc: plengada@optusnet.com.au, pg-user@kensystem.com
  Subject: Re: Shorthand column labels (SELECT col1 foo, ...) vs (SELECT col1 AS foo, ...)
  In-Reply-To: <4785D174.4030203@optusnet.com.au>

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

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