Re: scripting & psql issues - Mailing list pgsql-general

From Oliver Elphick
Subject Re: scripting & psql issues
Date
Msg-id 1092910654.19932.44.camel@braydb
Whole thread Raw
In response to Re: scripting & psql issues  ("Bob Parkinson" <rwp@biome.ac.uk>)
List pgsql-general
On Wed, 2004-08-18 at 16:26, Bob Parkinson wrote:
> I've started to use the "here document" idea a lot when writing scripts to do tasks.
>
> #!/usr/local/bin/bash
>
> psql -d myDB <<EOSQL
>
> select foo ....
> update bar;
> delete from ...
>
> EOSQL

If the here document is long and complicated, you should make that
command line

  psql -d myDB -f - <<EOSQL

so as to get the line number of any error (counting from the start of
the here document).



pgsql-general by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: libpq: passwords WAS: scripting & psql issues
Next
From: Oliver Elphick
Date:
Subject: Re: Stored Procedures woes