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

From Yugo Nagata
Subject Re: Set AUTOCOMMIT to on in script output by pg_dump
Date
Msg-id 20241009120314.118a641fa25148c3d564a6ae@sraoss.co.jp
Whole thread Raw
Responses Re: Set AUTOCOMMIT to on in script output by pg_dump
List pgsql-hackers
On Wed, 09 Oct 2024 11:10:37 +0900
Shinya Kato <Shinya11.Kato@oss.nttdata.com> wrote:

> Hi hackers!
> 
> When SQL scripts created with pg_dump/pg_dumpall/pg_restore are executed 
> in psql with AUTOCOMMIT turned off, they will not succeed in many cases.
> This is because the script contains SQL statements that cannot be 
> executed within a transaction block.
> 
> If you simply add set AUTOCOMMIT on to the scripts created by 
> pg_dump/pg_dumpall/pg_restore, they will work fine.
> A patch is attached
> 
> No documentation has been added as we could not find any documentation 
> on the details in the script.
> 
> Do you think?

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?

Regards,
Yugo Nagata

-- 
Yugo Nagata <nagata@sraoss.co.jp>



pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Doc: typo in config.sgml
Next
From: Andrei Lepikhov
Date:
Subject: Re: Inconsistent RestrictInfo serial numbers