BUG #13502: parser misconstrues table alias - Mailing list pgsql-bugs

From floriparob@gmail.com
Subject BUG #13502: parser misconstrues table alias
Date
Msg-id 20150716023321.2307.19959@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #13502: parser misconstrues table alias  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #13502: parser misconstrues table alias  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      13502
Logged by:          Robert Stone
Email address:      floriparob@gmail.com
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.

dinkumerp=# SELECT TO.tol_id, TO.lang_code, SL.lang_name, TO.no_list_text,
TO.table_comment FROM supported_languages SL, tables_opt_list TO  WHERE
TO.lang_code = SL.lang_code AND TO.table_key = 'COA' ORDER BY TO.lang_code;
ERROR:  syntax error at or near "TO"
LINE 1: SELECT TO.tol_id, TO.lang_code, SL.lang_name, TO.no_list_tex...


 PostgreSQL 9.4.4 on x86_64-unknown-linux-gnu, compiled by gcc-4.9.real
(Debian 4.9.2-20) 4.9.2, 64-bit
(1 row)

pgsql-bugs by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [BUGS] 9.4.4 max_wal_sendersについて
Next
From: Tom Lane
Date:
Subject: Re: BUG #13502: parser misconstrues table alias