Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands
Date: 2022-07-26 16:03:06
Message-ID: 2361330.1658851386@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> That leaves us with changing the documentation then, from:
> CREATE DATABASE cannot be executed inside a transaction block.
> to:
> CREATE DATABASE cannot be executed inside an explicit transaction block (it
> will error in this case), and will commit (or rollback on failure) any
> implicit transaction it is a part of.

That's not going to help anybody unless we also provide a definition of
"implicit transaction", which is a bit far afield for that man page.

I did miss a bet in the proposed pipeline addendum, though.
I should have written

... However, there
are a few DDL commands (such as <command>CREATE DATABASE</command>)
that cannot be executed inside a transaction block. If one of
these is executed in a pipeline, it will, upon success, force an
immediate commit to preserve database consistency.

That ties the info to our standard wording in the per-command man
pages.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2022-07-26 16:11:52 Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands
Previous Message David G. Johnston 2022-07-26 15:48:23 Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-07-26 16:04:33 Re: Unprivileged user can induce crash by using an SUSET param in PGOPTIONS
Previous Message Dagfinn Ilmari Mannsåker 2022-07-26 16:02:40 Re: Unprivileged user can induce crash by using an SUSET param in PGOPTIONS