From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: wesley.smith@zapproved.com
Subject: BUG #17806: PostgreSQL 13.10 returns "CREATE DATABASE cannot be executed within a pipeline"
Date: Thu, 23 Feb 2023 22:33:30 +0000
Message-ID: <17806-8ae970739d661c0b@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17806
Logged by: Wesley Smith
Email address: wesley.smith@zapproved.com
PostgreSQL version: 13.10
Operating system: Linux
Description:
I am starting up a fresh instance of Postgres inside of Docker using the
"postgres:13.10" tag. I'm then connecting to the database server using the
Ppgsql library for .NET (version 6.0.8) and creating a new database like
this:
var str = "
CREATE ROLE foo WITH PASSWORD 'foo' LOGIN NOINHERIT;
GRANT foo TO postgres;
CREATE DATABASE my_db OWNER foo;
-- More statements here
";
conn = new NpgsqlConnection(connString);
var cmd = new NpgsqlCommand(sql, conn);
await cmd.ExecuteNonQueryAsync();
In all versions of PostgreSQL 13 before 10 (13.1 - 13.9), this works fine.
There is no error and the database is created as expected.
However, with version 13.10, I get this error:
Severity: ERROR
InvariantSeverity: ERROR
SqlState: 25001
MessageText: CREATE DATABASE cannot be executed within a pipeline
File: xact.c
Line: 3412
Routine: PreventInTransactionBlock
As far as I know, I'm not executing these statements in a pipeline or a
transaction.
I don't see anything in the 13.10 release notes that mentions anything about
this. Please let me know whether 13.10 has a bug, or if it is correctly
enforcing something that should have always been enforced.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, wesley.smith@zapproved.com
Subject: Re: BUG #17806: PostgreSQL 13.10 returns "CREATE DATABASE cannot be executed within a pipeline"
In-Reply-To: <17806-8ae970739d661c0b@postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox