pgsql: Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id(

2021-08-19 Thread Andres Freund
Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id() safe. Previously log messages late during shutdown could end up using either another backend's PgBackendStatus (multi user) or segfault (single user) because pgstat_get_my_query_id()'s check for !MyBEEntry didn't filter out use afte

pgsql: Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id(

2021-08-19 Thread Andres Freund
Unset MyBEEntry, making elog.c's call to pgstat_get_my_query_id() safe. Previously log messages late during shutdown could end up using either another backend's PgBackendStatus (multi user) or segfault (single user) because pgstat_get_my_query_id()'s check for !MyBEEntry didn't filter out use afte

pgsql: Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.

2021-08-19 Thread Tom Lane
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE. transformLockingClause neglected to exclude the pseudo-RTEs for OLD/NEW when processing a rule's query. This led to odd errors or even crashes later on. This bug is very ancient, but it's not terribly surprising that nobody noticed, since t

pgsql: Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.

2021-08-19 Thread Tom Lane
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE. transformLockingClause neglected to exclude the pseudo-RTEs for OLD/NEW when processing a rule's query. This led to odd errors or even crashes later on. This bug is very ancient, but it's not terribly surprising that nobody noticed, since t

pgsql: Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.

2021-08-19 Thread Tom Lane
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE. transformLockingClause neglected to exclude the pseudo-RTEs for OLD/NEW when processing a rule's query. This led to odd errors or even crashes later on. This bug is very ancient, but it's not terribly surprising that nobody noticed, since t

pgsql: Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.

2021-08-19 Thread Tom Lane
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE. transformLockingClause neglected to exclude the pseudo-RTEs for OLD/NEW when processing a rule's query. This led to odd errors or even crashes later on. This bug is very ancient, but it's not terribly surprising that nobody noticed, since t

pgsql: Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.

2021-08-19 Thread Tom Lane
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE. transformLockingClause neglected to exclude the pseudo-RTEs for OLD/NEW when processing a rule's query. This led to odd errors or even crashes later on. This bug is very ancient, but it's not terribly surprising that nobody noticed, since t

pgsql: Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.

2021-08-19 Thread Tom Lane
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE. transformLockingClause neglected to exclude the pseudo-RTEs for OLD/NEW when processing a rule's query. This led to odd errors or even crashes later on. This bug is very ancient, but it's not terribly surprising that nobody noticed, since t

pgsql: Avoid trying to lock OLD/NEW in a rule with FOR UPDATE.

2021-08-19 Thread Tom Lane
Avoid trying to lock OLD/NEW in a rule with FOR UPDATE. transformLockingClause neglected to exclude the pseudo-RTEs for OLD/NEW when processing a rule's query. This led to odd errors or even crashes later on. This bug is very ancient, but it's not terribly surprising that nobody noticed, since t