pgsql: Move common catalog cache access routines to lsyscache.c

2022-08-01 Thread Amit Kapila
Move common catalog cache access routines to lsyscache.c In passing, move pg_relation_is_publishable next to similar functions. Suggested-by: Alvaro Herrera Author: Amit Kapila Reviewed-by: Hou Zhijie Discussion: https://postgr.es/m/[email protected].

pgsql: Fix comment in pg_db_role_setting.h

2022-08-01 Thread John Naylor
Fix comment in pg_db_role_setting.h Noted by Japin Li Discussion: https://www.postgresql.org/message-id/MEYP282MB16691ACEDBC94161CF4BA1CCB69A9%40MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c689baa158bbe76597b4dacd61c415b5

pgsql: Remove duplicated wait for subscription sync from 007_ddl.pl.

2022-08-01 Thread Amit Kapila
Remove duplicated wait for subscription sync from 007_ddl.pl. An oversight in 8f2e2bbf14. Author: Masahiko Sawada Reviewed by: Amit Kapila Backpatch-through: 15, where it was introduced Discussion: https://postgr.es/m/cad21aoc-fvakakha4t1urupwl8xbacwrepeetvshvy80f6w...@mail.gmail.com Branch ---

pgsql: Remove duplicated wait for subscription sync from 007_ddl.pl.

2022-08-01 Thread Amit Kapila
Remove duplicated wait for subscription sync from 007_ddl.pl. An oversight in 8f2e2bbf14. Author: Masahiko Sawada Reviewed by: Amit Kapila Backpatch-through: 15, where it was introduced Discussion: https://postgr.es/m/cad21aoc-fvakakha4t1urupwl8xbacwrepeetvshvy80f6w...@mail.gmail.com Branch ---

pgsql: Add a regression test for contrib/tcn.

2022-08-01 Thread Tom Lane
Add a regression test for contrib/tcn. Just whittling down the list of contrib modules with zero coverage. Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/418ec32072a6489e909e590247945011ec825059 Modi

pgsql: Relax overly strict rules in select_outer_pathkeys_for_merge()

2022-08-01 Thread David Rowley
Relax overly strict rules in select_outer_pathkeys_for_merge() The select_outer_pathkeys_for_merge function made an attempt to build the merge join pathkeys in the same order as query_pathkeys. This was done as it may have led to no sort being required for an ORDER BY or GROUP BY clause in the up

pgsql: Add a regression test for contrib/pg_prewarm.

2022-08-01 Thread Tom Lane
Add a regression test for contrib/pg_prewarm. We had a little bit of coverage here thanks to e2f65f425, but not enough; notably, autoprewarm wasn't exercised at all. Dong Wook Lee, with help from Julien Rouhaud and myself Discussion: https://postgr.es/m/20220629053812.mifmdrch5iuasg2s@home-deskt

pgsql: Have ExecFindPartition cache the last found partition

2022-08-01 Thread David Rowley
Have ExecFindPartition cache the last found partition Here we add code which detects when ExecFindPartition() continually finds the same partition and add a caching layer to improve partition lookup performance for such cases. Both RANGE and LIST partitioned tables traditionally require a binary

pgsql: Check maximum number of columns in function RTEs, too.

2022-08-01 Thread Tom Lane
Check maximum number of columns in function RTEs, too. I thought commit fd96d14d9 had plugged all the holes of this sort, but no, function RTEs could produce oversize tuples too, either via long coldeflists or just from multiple functions in one RTE. (I'm pretty sure the other variants of base RTE

pgsql: Check maximum number of columns in function RTEs, too.

2022-08-01 Thread Tom Lane
Check maximum number of columns in function RTEs, too. I thought commit fd96d14d9 had plugged all the holes of this sort, but no, function RTEs could produce oversize tuples too, either via long coldeflists or just from multiple functions in one RTE. (I'm pretty sure the other variants of base RTE

pgsql: Check maximum number of columns in function RTEs, too.

2022-08-01 Thread Tom Lane
Check maximum number of columns in function RTEs, too. I thought commit fd96d14d9 had plugged all the holes of this sort, but no, function RTEs could produce oversize tuples too, either via long coldeflists or just from multiple functions in one RTE. (I'm pretty sure the other variants of base RTE

pgsql: Check maximum number of columns in function RTEs, too.

2022-08-01 Thread Tom Lane
Check maximum number of columns in function RTEs, too. I thought commit fd96d14d9 had plugged all the holes of this sort, but no, function RTEs could produce oversize tuples too, either via long coldeflists or just from multiple functions in one RTE. (I'm pretty sure the other variants of base RTE

pgsql: Check maximum number of columns in function RTEs, too.

2022-08-01 Thread Tom Lane
Check maximum number of columns in function RTEs, too. I thought commit fd96d14d9 had plugged all the holes of this sort, but no, function RTEs could produce oversize tuples too, either via long coldeflists or just from multiple functions in one RTE. (I'm pretty sure the other variants of base RTE

pgsql: Check maximum number of columns in function RTEs, too.

2022-08-01 Thread Tom Lane
Check maximum number of columns in function RTEs, too. I thought commit fd96d14d9 had plugged all the holes of this sort, but no, function RTEs could produce oversize tuples too, either via long coldeflists or just from multiple functions in one RTE. (I'm pretty sure the other variants of base RTE

pgsql: Check maximum number of columns in function RTEs, too.

2022-08-01 Thread Tom Lane
Check maximum number of columns in function RTEs, too. I thought commit fd96d14d9 had plugged all the holes of this sort, but no, function RTEs could produce oversize tuples too, either via long coldeflists or just from multiple functions in one RTE. (I'm pretty sure the other variants of base RTE

pgsql: Fix error reporting after ioctl() call with pg_upgrade --clone

2022-08-01 Thread Michael Paquier
Fix error reporting after ioctl() call with pg_upgrade --clone errno was not reported correctly after attempting to clone a file, leading to incorrect error reports. While scanning through the code, I have not noticed any similar mistakes. Error introduced in 3a769d8. Author: Justin Pryzby Disc

pgsql: Fix error reporting after ioctl() call with pg_upgrade --clone

2022-08-01 Thread Michael Paquier
Fix error reporting after ioctl() call with pg_upgrade --clone errno was not reported correctly after attempting to clone a file, leading to incorrect error reports. While scanning through the code, I have not noticed any similar mistakes. Error introduced in 3a769d8. Author: Justin Pryzby Disc

pgsql: Fix error reporting after ioctl() call with pg_upgrade --clone

2022-08-01 Thread Michael Paquier
Fix error reporting after ioctl() call with pg_upgrade --clone errno was not reported correctly after attempting to clone a file, leading to incorrect error reports. While scanning through the code, I have not noticed any similar mistakes. Error introduced in 3a769d8. Author: Justin Pryzby Disc

pgsql: Fix error reporting after ioctl() call with pg_upgrade --clone

2022-08-01 Thread Michael Paquier
Fix error reporting after ioctl() call with pg_upgrade --clone errno was not reported correctly after attempting to clone a file, leading to incorrect error reports. While scanning through the code, I have not noticed any similar mistakes. Error introduced in 3a769d8. Author: Justin Pryzby Disc

pgsql: Fix error reporting after ioctl() call with pg_upgrade --clone

2022-08-01 Thread Michael Paquier
Fix error reporting after ioctl() call with pg_upgrade --clone errno was not reported correctly after attempting to clone a file, leading to incorrect error reports. While scanning through the code, I have not noticed any similar mistakes. Error introduced in 3a769d8. Author: Justin Pryzby Disc