Re: Set AUTOCOMMIT to on in script output by pg_dump

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: Shinya Kato <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Set AUTOCOMMIT to on in script output by pg_dump
Date: 2024-10-09 03:03:14
Message-ID: 20241009120314.118a641fa25148c3d564a6ae@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 09 Oct 2024 11:10:37 +0900
Shinya Kato <Shinya11(dot)Kato(at)oss(dot)nttdata(dot)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(at)sraoss(dot)co(dot)jp>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrei Lepikhov 2024-10-09 03:15:06 Re: Inconsistent RestrictInfo serial numbers
Previous Message Tatsuo Ishii 2024-10-09 02:49:29 Re: Doc: typo in config.sgml