Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 8B959B5DCAE for ; Wed, 26 Oct 2011 13:39:25 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 68300-03 for ; Wed, 26 Oct 2011 16:39:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by mail.postgresql.org (Postfix) with SMTP id 7570FB5D803 for ; Wed, 26 Oct 2011 13:39:18 -0300 (ADT) Received: (qmail invoked by alias); 26 Oct 2011 16:39:16 -0000 Received: from a88-115-218-165.elisa-laajakaista.fi (EHLO [10.0.0.102]) [88.115.218.165] by mail.gmx.net (mp058) with SMTP; 26 Oct 2011 18:39:16 +0200 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX1+/FwF9I7q//+LnFPxso3kcjq1WPDOCgn/EYe3shR YLfnd+6sQbRxmr Message-ID: <1319647154.566.1.camel@vanquo.pezone.net> Subject: Re: BUG #6271: psql -f reporting unexpected syntax errors on first command From: Peter Eisentraut To: Shannon Cc: pgsql-bugs@postgresql.org Date: Wed, 26 Oct 2011 19:39:14 +0300 In-Reply-To: <201110260408.p9Q480jo087565@wwwmaster.postgresql.org> References: <201110260408.p9Q480jo087565@wwwmaster.postgresql.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.3-2 Content-Transfer-Encoding: 8bit Mime-Version: 1.0 X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.403 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/250 X-Sequence-Number: 31520 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.