Re: BUG #6271: psql -f reporting unexpected syntax errors on first command - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #6271: psql -f reporting unexpected syntax errors on first command
Date
Msg-id 1319647154.566.1.camel@vanquo.pezone.net
Whole thread Raw
In response to BUG #6271: psql -f reporting unexpected syntax errors on first command  ("Shannon" <shannon@arc.net.au>)
List pgsql-bugs
On ons, 2011-10-26 at 04:08 +0000, Shannon wrote:
> The following bug has been logged online:
>
> Bug reference:      6271
> Logged by:          Shannon
> Email address:      shannon@arc.net.au
> PostgreSQL version: 8.4.9
> Operating system:   Gentoo Linux 64bit
> Description:        psql -f reporting unexpected syntax errors on first
> command
> Details:
>
> Given the following 2 line SQL script in a file:
>
> --- test.sql ---
> SHOW client_encoding;
> SHOW client_encoding;
> ----------------
>
> $ psql -ftest.sql -U postgres template1
>
> psql:test.sql:1: ERROR:  syntax error at or near "SHOW"
> LINE 1: SHOW client_encoding;
>         ^
>  client_encoding
> -----------------
>  UTF8
> (1 row)

Look at the file with a hex editor or od or something like that to see
whether there are any "invisible" characters on the first line.  A
Unicode byte-order mark is a possibility.

pgsql-bugs by date:

Previous
From: goudvis
Date:
Subject: Re: BUG #6269: Anomaly detection
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #6271: psql -f reporting unexpected syntax errors on first command