pgsql: Update information_schema definition for not-null constraints

2023-09-07 Thread Alvaro Herrera
Update information_schema definition for not-null constraints Now that we have catalogued not-null constraints, our information_schema definition can be updated to grab those rather than fabricate synthetic definitions. Note that we still don't have catalog rows for not-null constraints on domain

pgsql: Move privilege check to the right place

2023-09-07 Thread Alvaro Herrera
Move privilege check to the right place Now that ATExecDropConstraint doesn't recurse anymore, so it's wrong to test privileges "during recursion" there. Move the check to dropconstraint_internal, which is the place where recursion occurs. In passing, remove now-useless 'recursing' argument to A

pgsql: Reorder tests in get_cheapest_path_for_pathkeys().

2023-09-07 Thread Robert Haas
Reorder tests in get_cheapest_path_for_pathkeys(). Checking parallel safety should be even cheaper than cost comparison, so do that first. Also make some minor, related comment improvements. Richard Guo, reviewed by Aleksander Alekseev, Andy Fan, and me. Discussion: http://postgr.es/m/CAMbWs4-

pgsql: doc: change "cross product" to "Cartesian product"

2023-09-07 Thread Bruce Momjian
doc: change "cross product" to "Cartesian product" Reported-by: Erik Wienhold Discussion: https://postgr.es/m/[email protected] Author: Erik Wienhold Backpatch-through: master Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8438

pgsql: Improve BackendXidGetPid() to only access allProcs on matching X

2023-09-07 Thread Michael Paquier
Improve BackendXidGetPid() to only access allProcs on matching XID Compilers are able to optimize that, but it makes the code slightly more readable this way. Author: Zhao Junwang Reviewed-by: Ashutosh Bapat Discussion: https://postgr.es/m/caeg8a3+i9gtqf65b+g_puvacquf0rzc-emqmyejgfjyoquu...@mail

pgsql: Remove some more "snapshot too old" vestiges.

2023-09-07 Thread Thomas Munro
Remove some more "snapshot too old" vestiges. Commit f691f5b8 removed the logic, but left behind some now-useless Snapshot arguments to various AM-internal functions, and missed a couple of comments. Reported-by: Peter Geoghegan Discussion: https://postgr.es/m/CAH2-Wznj9qSNXZ1P1uWTUD_FeaTezbUaz

pgsql: Teach WaitEventSetWait() to report multiple events on Windows.

2023-09-07 Thread Thomas Munro
Teach WaitEventSetWait() to report multiple events on Windows. The WAIT_USE_WIN32 implementation of WaitEventSetWait() previously reported at most one event per call, because that's what the underlying WaitForMultipleObjects() call does. We can make the behavior match the three Unix implementatio