pgsql: Remove unstable pg_amcheck tests.

2021-10-14 Thread Peter Geoghegan
Remove unstable pg_amcheck tests. Recent pg_amcheck bugfix commit d2bf06db added a test case that the buildfarm has shown to be non-portable. It doesn't particularly seem worth keeping anyway. Remove it. Discussion: https://postgr.es/m/[email protected]

pgsql: Remove unstable pg_amcheck tests.

2021-10-14 Thread Peter Geoghegan
Remove unstable pg_amcheck tests. Recent pg_amcheck bugfix commit d2bf06db added a test case that the buildfarm has shown to be non-portable. It doesn't particularly seem worth keeping anyway. Remove it. Discussion: https://postgr.es/m/[email protected]

pgsql: shm_mq: Update mq_bytes_written less often.

2021-10-14 Thread Robert Haas
shm_mq: Update mq_bytes_written less often. Do not update shm_mq's mq_bytes_written until we have written an amount of data greater than 1/4th of the ring size, unless the caller of shm_mq_send(v) requests a flush at the end of the message. This reduces the number of calls to SetLatch(), and also

pgsql: Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel().

2021-10-14 Thread Jeff Davis
Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel(). An extension may want to call GetSecurityLabel() on a shared object before the shared relcaches are fully initialized. For instance, a ClientAuthentication_hook might want to retrieve the security label on a role. Discussion: https:

pgsql: Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel().

2021-10-14 Thread Jeff Davis
Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel(). An extension may want to call GetSecurityLabel() on a shared object before the shared relcaches are fully initialized. For instance, a ClientAuthentication_hook might want to retrieve the security label on a role. Discussion: https:

pgsql: Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel().

2021-10-14 Thread Jeff Davis
Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel(). An extension may want to call GetSecurityLabel() on a shared object before the shared relcaches are fully initialized. For instance, a ClientAuthentication_hook might want to retrieve the security label on a role. Discussion: https:

pgsql: Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel().

2021-10-14 Thread Jeff Davis
Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel(). An extension may want to call GetSecurityLabel() on a shared object before the shared relcaches are fully initialized. For instance, a ClientAuthentication_hook might want to retrieve the security label on a role. Discussion: https:

pgsql: Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel().

2021-10-14 Thread Jeff Davis
Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel(). An extension may want to call GetSecurityLabel() on a shared object before the shared relcaches are fully initialized. For instance, a ClientAuthentication_hook might want to retrieve the security label on a role. Discussion: https:

pgsql: Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel().

2021-10-14 Thread Jeff Davis
Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel(). An extension may want to call GetSecurityLabel() on a shared object before the shared relcaches are fully initialized. For instance, a ClientAuthentication_hook might want to retrieve the security label on a role. Discussion: https:

pgsql: Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel().

2021-10-14 Thread Jeff Davis
Check criticalSharedRelcachesBuilt in GetSharedSecurityLabel(). An extension may want to call GetSecurityLabel() on a shared object before the shared relcaches are fully initialized. For instance, a ClientAuthentication_hook might want to retrieve the security label on a role. Discussion: https:

pgsql: Fix planner error with pulling up subquery expressions into func

2021-10-14 Thread Tom Lane
Fix planner error with pulling up subquery expressions into function RTEs. If a function-in-FROM laterally references the output of some sub-SELECT earlier in the FROM clause, and we are able to flatten that sub-SELECT into the outer query, the expression(s) copied into the function RTE missed bei

pgsql: Fix planner error with pulling up subquery expressions into func

2021-10-14 Thread Tom Lane
Fix planner error with pulling up subquery expressions into function RTEs. If a function-in-FROM laterally references the output of some sub-SELECT earlier in the FROM clause, and we are able to flatten that sub-SELECT into the outer query, the expression(s) copied into the function RTE missed bei

pgsql: Fix planner error with pulling up subquery expressions into func

2021-10-14 Thread Tom Lane
Fix planner error with pulling up subquery expressions into function RTEs. If a function-in-FROM laterally references the output of some sub-SELECT earlier in the FROM clause, and we are able to flatten that sub-SELECT into the outer query, the expression(s) copied into the function RTE missed bei

pgsql: Postpone some end-of-recovery operations related to allowing WAL

2021-10-14 Thread Robert Haas
Postpone some end-of-recovery operations related to allowing WAL. CreateOverwriteContrecordRecord(), UpdateFullPageWrites(), PerformRecoveryXLogAction(), and CleanupAfterArchiveRecovery() are moved somewhat later in StartupXLOG(). This is preparatory work for a future patch that wants to allow rec