Re: Set AUTOCOMMIT to on in script output by pg_dump - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: Set AUTOCOMMIT to on in script output by pg_dump
Date
Msg-id 20241009.125822.628156783520278007.ishii@postgresql.org
Whole thread Raw
In response to Re: Set AUTOCOMMIT to on in script output by pg_dump  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
>> I am not sure if it is good to include psql's meta-command in
>> pg_dump/pg_dumpall
>> results. Can we assume users will always use psql to restore the pg_dump
>> results?
> 
> 
> Agreed.  If we aren’t already outputting psql-only stuff I am a strong -1
> for making this the first such case.

I think the pg_dumpall output already includes "\connect".

> It would be nice to describe exactly when there is a problem as well since
> very few things require being outside of a transaction.  There might be
> documentation or code patches possible here to improve matters (like adding
> a switch to output begin/commit in the places we’re a user might want
> single-transaction behavior) but this approach breaks well-established
> encapsulation and overrides user expectations in a bad way (since
> autocommit=on is the default they choose to turn it off so turning it back
> on silently - not even documented - is bad.)

+1.

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

pgsql-hackers by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Re: POC, WIP: OR-clause support for indexes
Next
From: Tom Lane
Date:
Subject: Re: Set AUTOCOMMIT to on in script output by pg_dump