Re: Identical command-line command will not work with \i metacommand and filename - Mailing list pgsql-general

From Scott Mead
Subject Re: Identical command-line command will not work with \i metacommand and filename
Date
Msg-id t2hd3ab2ec81004211834z83bfec20t153b01554e4a7929@mail.gmail.com
Whole thread Raw
In response to Identical command-line command will not work with \i metacommand and filename  (John Gage <jsmgage@numericable.fr>)
Responses Re: Identical command-line command will not work with \i metacommand and filename  (John Gage <jsmgage@numericable.fr>)
Re: Identical command-line command will not work with \i metacommand and filename  (John Gage <jsmgage@numericable.fr>)
List pgsql-general

On Wed, Apr 21, 2010 at 6:07 PM, John Gage <jsmgage@numericable.fr> wrote:
I enter the identical command:

select * from mesh_descriptors;

using the psql command line and it works perfectly.

The same command in a file produces an immediate syntax error:

EFNWeb=# \i ./CopySql.sql
psql:./CopySql.sql:1: ERROR:  syntax error at or near "select"
LINE 1: select * from mesh_descriptors;

when run from a file using \i

What am I doing wrong?

Do you have some funky hidden characters at the beginning of the file?

   run:

   od -a CopySql.sql

  Look at the beginning, that'll show you character by character what's in there (should reveal anything hidden).

--Scott
 

Thanks,

John Gage
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Jonathan Vanasco
Date:
Subject: Re: trying to write a bit of logic as one query, can't seem to do it under 2
Next
From: Glen Parker
Date:
Subject: Re: trying to write a bit of logic as one query, can't seem to do it under 2