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

From John Gage
Subject Identical command-line command will not work with \i metacommand and filename
Date
Msg-id 2B3E547C-F226-48E4-BA31-B81532C57F20@numericable.fr
Whole thread Raw
Responses Re: Identical command-line command will not work with \i metacommand and filename  (Scott Mead <scott.lists@enterprisedb.com>)
List pgsql-general
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?

Thanks,

John Gage

pgsql-general by date:

Previous
From: Thom Brown
Date:
Subject: Re: Listing tables in all schemas in psql
Next
From: Brian Peschel
Date:
Subject: Best way to replicate to large number of nodes