pgsql: Check default partitions constraints while descending

2020-09-08 Thread Alvaro Herrera
Check default partitions constraints while descending Partitioning tuple route code assumes that the partition chosen while descending the partition hierarchy is always the correct one. This is true except when the partition is the default partition and another partition has been added concurrent

pgsql: Check default partitions constraints while descending

2020-09-08 Thread Alvaro Herrera
Check default partitions constraints while descending Partitioning tuple route code assumes that the partition chosen while descending the partition hierarchy is always the correct one. This is true except when the partition is the default partition and another partition has been added concurrent

pgsql: Check default partitions constraints while descending

2020-09-08 Thread Alvaro Herrera
Check default partitions constraints while descending Partitioning tuple route code assumes that the partition chosen while descending the partition hierarchy is always the correct one. This is true except when the partition is the default partition and another partition has been added concurrent

pgsql: Install an error check into cancel_before_shmem_exit().

2020-09-08 Thread Tom Lane
Install an error check into cancel_before_shmem_exit(). Historically, cancel_before_shmem_exit() just silently did nothing if the specified callback wasn't the top-of-stack. The folly of ignoring this case was exposed by the bugs fixed in 303640199 and bab150045, so let's make it throw elog(ERROR

pgsql: Fix autovacuum cancellation.

2020-09-08 Thread Andres Freund
Fix autovacuum cancellation. The problem is caused by me (Andres) having ProcSleep() look at the wrong PGPROC entry in 5788e258bb2. Unfortunately it seems hard to write a reliable test for autovacuum cancellations. Perhaps somebody will come up with a good approach, but it seems worth fixing the

pgsql: Use plain memset() in numeric.c, not MemSet and friends.

2020-09-08 Thread Tom Lane
Use plain memset() in numeric.c, not MemSet and friends. This essentially reverts a micro-optimization I made years ago, as part of the much larger commit d72f6c750. It's doubtful that there was any hard evidence for it being helpful even then, and the case is even more dubious now that modern co

pgsql: Use for name of unnamed portal's memory context

2020-09-08 Thread Peter Eisentraut
Use for name of unnamed portal's memory context Otherwise just printing an empty string makes the memory context debug output slightly confusing. Discussion: https://www.postgresql.org/message-id/flat/ccb353ef-89ff-09b3-8046-1d2514624b9c%402ndquadrant.com Branch -- master Details ---

pgsql: Use return instead of exit() in configure

2020-09-08 Thread Peter Eisentraut
Use return instead of exit() in configure Using exit() requires stdlib.h, which is not included. Use return instead. Also add return type for main(). Reviewed-by: Heikki Linnakangas Reviewed-by: Thomas Munro Backpatched because Apple macOS 10.16/11 (Big Sur) compiler makes calling undeclared

pgsql: Use return instead of exit() in configure

2020-09-08 Thread Peter Eisentraut
Use return instead of exit() in configure Using exit() requires stdlib.h, which is not included. Use return instead. Also add return type for main(). Reviewed-by: Heikki Linnakangas Reviewed-by: Thomas Munro Backpatched because Apple macOS 10.16/11 (Big Sur) compiler makes calling undeclared

pgsql: Remove unused parameter

2020-09-08 Thread Peter Eisentraut
Remove unused parameter unused since f0d6f20278b7c5c412ce40a9b86c6b31dc2fbfdd Discussion: https://www.postgresql.org/message-id/flat/511bb100-f829-ba21-2f10-9f952ec06ead%402ndquadrant.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1dec091d5b0bfad1a9b061cac820