Shorthand column labels (SELECT col1 foo, ...) vs (SELECT col1 AS foo, ...)

From: Ken Johanson <pg-user(at)kensystem(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Shorthand column labels (SELECT col1 foo, ...) vs (SELECT col1 AS foo, ...)
Date: 2008-01-10 07:11:11
Message-ID: 4785C50F.6010505@kensystem.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I notice PG doesn't allow shorthand column labels -- it requires the
'AS' operand.

SELECT col1 foo, ...; -> ERROR: syntax error at or near "foo"

For compatibility with other databases, what objections might be argued
in allowing this syntax in the future?

On the 'pros' side I think it eases migration to PG, shortens code, is
similar syntax to shorthand table aliases, and some users might argue it
has become defacto syntax among DBs.

Regards,
Ken

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Paul Lambert 2008-01-10 07:20:36 Re: Shorthand column labels (SELECT col1 foo, ...) vs (SELECT col1 AS foo, ...)
Previous Message Phillip Smith 2008-01-10 03:19:43 Re: Support for SQL TOP clause?