Re: BUG #13502: parser misconstrues table alias

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "floriparob(at)gmail(dot)com" <floriparob(at)gmail(dot)com>
Cc: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13502: parser misconstrues table alias
Date: 2015-07-16 03:23:55
Message-ID: CAKFQuwYx8nwg-uJ89FOd-Z=CaDQ-CR61m5Q5L43vnR_BCZHGmQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wednesday, July 15, 2015, <floriparob(at)gmail(dot)com> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 13502
> Logged by: Robert Stone
> Email address: floriparob(at)gmail(dot)com <javascript:;>
> PostgreSQL version: 9.4.4
> Operating system: Debian stretch/sid
> Description:
>
> I aliased a table using the letters TO and the parser pulled an error.
> Happens in psql as well as the JDBC driver.
> By altering the table alias to TOL overcame the problem.
>
>
Since TO is fully reserved in the SQL syntax, including PostgreSQL's
implementation, this is not surprising. If you really want to use those
letters you need to double-quite them. "TO".column_name.

http://www.postgresql.org/docs/9.4/interactive/sql-keywords-appendix.html

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message kolmyk 2015-07-16 06:44:20 BUG #13503: json_to_hstore does not works with backslash-quote in json value
Previous Message Tom Lane 2015-07-16 03:19:25 Re: BUG #13502: parser misconstrues table alias