pgsql: Fix race condition in committing a serializable transaction

2024-10-21 Thread Heikki Linnakangas
Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin adva

pgsql: Fix race condition in committing a serializable transaction

2024-10-21 Thread Heikki Linnakangas
Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin adva

pgsql: Fix race condition in committing a serializable transaction

2024-10-21 Thread Heikki Linnakangas
Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin adva

pgsql: Fix race condition in committing a serializable transaction

2024-10-21 Thread Heikki Linnakangas
Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin adva

pgsql: Fix race condition in committing a serializable transaction

2024-10-21 Thread Heikki Linnakangas
Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin adva

pgsql: Fix race condition in committing a serializable transaction

2024-10-21 Thread Heikki Linnakangas
Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin adva

pgsql: Fix race condition in committing a serializable transaction

2024-10-21 Thread Heikki Linnakangas
Fix race condition in committing a serializable transaction The finished transaction list can contain XIDs that are older than the serializable global xmin. It's a short-lived state; ClearOldPredicateLocks() removes any such transactions from the list, and it's called whenever the global xmin adva

pgsql: Update outdated comment on WAL-logged locks with invalid XID

2024-10-21 Thread Heikki Linnakangas
Update outdated comment on WAL-logged locks with invalid XID We haven't generated those for a long time. Discussion: https://www.postgresql.org/message-id/b439edfc-c5e5-43a9-802d-4cb51ec20...@iki.fi Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/3c7d78427ea9d92d3

pgsql: Fix wrong assertion and poor error messages in "COPY (query) TO"

2024-10-21 Thread Tom Lane
Fix wrong assertion and poor error messages in "COPY (query) TO". If the query is rewritten into a NOTIFY command by a DO INSTEAD rule, we'd get an assertion failure, or in non-assert builds issue a rather confusing error message. Improve that. Also fix a longstanding grammar mistake in a nearby

pgsql: Fix wrong assertion and poor error messages in "COPY (query) TO"

2024-10-21 Thread Tom Lane
Fix wrong assertion and poor error messages in "COPY (query) TO". If the query is rewritten into a NOTIFY command by a DO INSTEAD rule, we'd get an assertion failure, or in non-assert builds issue a rather confusing error message. Improve that. Also fix a longstanding grammar mistake in a nearby

pgsql: Fix wrong assertion and poor error messages in "COPY (query) TO"

2024-10-21 Thread Tom Lane
Fix wrong assertion and poor error messages in "COPY (query) TO". If the query is rewritten into a NOTIFY command by a DO INSTEAD rule, we'd get an assertion failure, or in non-assert builds issue a rather confusing error message. Improve that. Also fix a longstanding grammar mistake in a nearby

pgsql: Fix wrong assertion and poor error messages in "COPY (query) TO"

2024-10-21 Thread Tom Lane
Fix wrong assertion and poor error messages in "COPY (query) TO". If the query is rewritten into a NOTIFY command by a DO INSTEAD rule, we'd get an assertion failure, or in non-assert builds issue a rather confusing error message. Improve that. Also fix a longstanding grammar mistake in a nearby

pgsql: Fix wrong assertion and poor error messages in "COPY (query) TO"

2024-10-21 Thread Tom Lane
Fix wrong assertion and poor error messages in "COPY (query) TO". If the query is rewritten into a NOTIFY command by a DO INSTEAD rule, we'd get an assertion failure, or in non-assert builds issue a rather confusing error message. Improve that. Also fix a longstanding grammar mistake in a nearby

pgsql: Fix wrong assertion and poor error messages in "COPY (query) TO"

2024-10-21 Thread Tom Lane
Fix wrong assertion and poor error messages in "COPY (query) TO". If the query is rewritten into a NOTIFY command by a DO INSTEAD rule, we'd get an assertion failure, or in non-assert builds issue a rather confusing error message. Improve that. Also fix a longstanding grammar mistake in a nearby

pgsql: Fix wrong assertion and poor error messages in "COPY (query) TO"

2024-10-21 Thread Tom Lane
Fix wrong assertion and poor error messages in "COPY (query) TO". If the query is rewritten into a NOTIFY command by a DO INSTEAD rule, we'd get an assertion failure, or in non-assert builds issue a rather confusing error message. Improve that. Also fix a longstanding grammar mistake in a nearby

pgsql: pg_stat_statements: Add tests for nested queries with level trac

2024-10-21 Thread Michael Paquier
pg_stat_statements: Add tests for nested queries with level tracking There have never been any regression tests in PGSS for various query patterns for nested queries combined with level tracking, like: - Multi-statements. - CREATE TABLE AS - CREATE/REFRESH MATERIALIZED VIEW - DECLARE CURSOR - EXPL

pgsql: Fix C23 compiler warning

2024-10-21 Thread Peter Eisentraut
Fix C23 compiler warning The approach of declaring a function pointer with an empty argument list and hoping that the compiler will not complain about casting it to another type no longer works with C23, because foo() is now equivalent to foo(void). We don't need to do this here. With a few stru