Re: Alternative to psql -c ?

From: James Le Cuirot <chewi(at)aura-online(dot)co(dot)uk>
To: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Alternative to psql -c ?
Date: 2014-06-25 14:16:19
Message-ID: 20140625151619.222505c0@red.yakaraplc.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 25 Jun 2014 10:09:18 -0400
Andrew Sullivan <ajs(at)crankycanuck(dot)ca> wrote:

> On Wed, Jun 25, 2014 at 02:43:25PM +0100, James Le Cuirot wrote:
>
> > The cookbook currently uses PQexec so multiple SQL commands are
> > wrapped in a transaction unless an explicit transaction
> > instruction appears. I don't want to change this behaviour but
> > the only way to get exactly the same effect from psql is to use
> > the -c option.
>
> Why not just read a file? -f filename.
>
> A

Same problem as stdin, the transactional behaviour is different. There
is the --single-transaction option but as the man page says...

"If the script itself uses BEGIN, COMMIT, or ROLLBACK, this option will
not have the desired effects."

Regards,
James

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2014-06-25 14:24:53 Re: Alternative to psql -c ?
Previous Message Igor Neyman 2014-06-25 13:46:10 Re: Getting "cache lookup failed for aggregate" error