Re: 9.5.2: "sql" as reserved word?

From: Kevin Grittner <kgrittn(at)gmail(dot)com>
To: Marc Mamin <M(dot)Mamin(at)intershop(dot)de>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: 9.5.2: "sql" as reserved word?
Date: 2016-05-04 14:31:28
Message-ID: CACjxUsNCqtNM4PO4nwcxHN_Z=8iyb-_+cRbbX_jjDxEkfBo5LA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 4, 2016 at 8:58 AM, Marc Mamin <M(dot)Mamin(at)intershop(dot)de> wrote:

> select 'x' sql;
>
> ERROR: syntax error at or near "sql"
> LINE 1: select 'x' sql;

It's likely that you already know this, but for the benefit of
anyone finding the thread who doesn't -- you can avoid this sort of
error by either inserting the optional AS keyword or quoting the
column label:

select 'x' as sql;

or:

select 'x' "sql";

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-05-04 14:33:32 Re: Is pg_control file crashsafe?
Previous Message Kevin Grittner 2016-05-04 14:18:58 Re: old_snapshot_threshold's interaction with hash index