On Wednesday, July 15, 2015, <floriparob@gmail.com> wrote:
> The following bug has been logged on the website:
>
> Bug reference: 13502
> Logged by: Robert Stone
> Email address: floriparob@gmail.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.