On 05/31/2010 05:14 PM, Tom Lane wrote:
> Mariateresa L<mariateresa(dot)ll(at)bresciaonline(dot)it> writes:
>> ... I want to pack everything in a nice shell script,
>> with proper error control, automated file shuffling,
>> predefined queries in text files and so on, but I cannot
>> convince psql that the SQL commands (select, insert or
>> copy...) it has to handle come from a file.
>> I can submit ("\i filename" or "psql --file filename")
>> files that contains commands, eg starting with "\" but
>> psql does not understand the same sintax if tne file
>> contains a simple "SELECT * FROM tablex".
> Really? Works for most people.
The problem is probably in an un-escaped "*" character in the script.
Shell will translate that into the list of files and really mess up the
underlying SQL command. I must admit, though, that the problem
description is a bit vague and that without a much more precise script
template and the resulting error message, I am unable to provide any
more useful information. The OP talks both about psql and \i command, as
well as the shell script. I suspect that therein lies the reason for the
Sr. Oracle DBA
New York, NY 10036
The Leader in integrated Media Intelligence Solutions
In response to
pgsql-novice by date
|Next:||From: Jeanne Louize Emygdio||Date: 2010-06-01 12:16:59|
|Subject: Invitation to connect on LinkedIn|
|Previous:||From: Joe Brenner||Date: 2010-05-31 21:37:55|
|Subject: Re: sql files in psql ?|