Re: Postgres config file: autocommit = off

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>, Rasmus Resen Amossen <rresena(at)hotmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Postgres config file: autocommit = off
Date: 2003-06-02 19:14:33
Message-ID: 200306021914.h52JEXm20625@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Oh, yes, sorry, I was confusing psql -c and -f. -c is clearly different.

---------------------------------------------------------------------------

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > Tom Lane wrote:
> >> Yeah, it's a bit warty, but psql -c is inherently different from a psql
> >> script. IMHO it's not reasonable to make (shell) scripts using psql -c
>
> > How is it different, except for having no prompt?
>
> It's different because it's explicitly designed for convenient execution
> of a single command. Thus, autocommit off would be useless and
> counterproductive. Also, since the -c string is fed to PQexec as a
> single query (again different from the psql stdin behavior), if you do
> put multiple commands into -c then you get them executed as a single
> transaction anyway. So you do not need or want .psqlrc modifying the
> behavior in either case.
>
> One of the reasons for taking autocommit control out of the backend and
> pushing it up to the client level is exactly to make it feasible to take
> these sorts of application-level considerations into account when
> choosing the behavior.
>
> regards, tom lane
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-06-02 19:23:26 Re: Status during copy [patch]
Previous Message Tom Lane 2003-06-02 19:11:25 Re: Postgres config file: autocommit = off