Set AUTOCOMMIT to on in script output by pg_dump

From: Shinya Kato <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Set AUTOCOMMIT to on in script output by pg_dump
Date: 2024-10-09 02:10:37
Message-ID: 96ff23a5d858ff72ca8e823a014d16fe@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

Regards,
Shinya Kato
NTT DATA GROUP CORPORATION

Attachment Content-Type Size
v1-0001-Set-AUTOCOMMIT-to-on-in-script-output-by-pg_dump.patch text/x-diff 1.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2024-10-09 02:14:58 Re: Inconsistent RestrictInfo serial numbers
Previous Message jian he 2024-10-09 02:01:53 Re: overflow bug for inhcounts