pgsql: Support named and default arguments in CALL

2018-04-14 Thread Peter Eisentraut
Support named and default arguments in CALL We need to call expand_function_arguments() to expand named and default arguments. In PL/pgSQL, we also need to deal with named and default INOUT arguments when receiving the output values into variables. Author: Pavel Stehule Branch -- master D

pgsql: Improve code comments

2018-04-14 Thread Peter Eisentraut
Improve code comments As of 0c2c81b403db420bfce36f168887db72932dbf09, the replication parameter in libpq is no longer "deliberately undocumented". Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e013288a6509549866c5d531257480f159c6900d Modified Files --

pgsql: Add commentary explaining why MaxIndexTuplesPerPage calculation

2018-04-14 Thread Tom Lane
Add commentary explaining why MaxIndexTuplesPerPage calculation is safe. MaxIndexTuplesPerPage ignores the fact that btree indexes sometimes store tuples with no data payload. But it also ignores the possibility of "special space" on index pages, which offsets that, so that the result isn't an un

pgsql: Fix enforcement of SELECT FOR UPDATE permissions with nested vie

2018-04-14 Thread Tom Lane
Fix enforcement of SELECT FOR UPDATE permissions with nested views. SELECT FOR UPDATE on a view should require UPDATE (as well as SELECT) permissions on the view, and then the view's owner needs those same permissions against the relations it references, and so on all the way down to base tables.

pgsql: Improve regression test coverage of expand_tuple().

2018-04-14 Thread Tom Lane
Improve regression test coverage of expand_tuple(). I was dissatisfied with the code coverage report for expand_tuple() in the wake of commit 7c44c46de: while better than no coverage at all, it was still not exercising the core function of inserting out-of-line default values, nor was the HeapTupl

pgsql: Reorganize partitioning code

2018-04-14 Thread Alvaro Herrera
Reorganize partitioning code There's been a massive addition of partitioning code in PostgreSQL 11, with little oversight on its placement, resulting in a catalog/partition.c with poorly defined boundaries and responsibilities. This commit tries to set a couple of distinct modules to separate thin

pgsql: List src/include/partitioning in src/include/Makefile

2018-04-14 Thread Alvaro Herrera
List src/include/partitioning in src/include/Makefile This omission prevented partitioning header files from being installed. Per buildfarm member crake. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4d64abc2feed10b8a8dd03181dfa3b0f9aa00c33 Modified Files --

pgsql: Simplify view-expansion code in rewriteHandler.c.

2018-04-14 Thread Tom Lane
Simplify view-expansion code in rewriteHandler.c. In the wake of commit 50c6bb022, it's not necessary for ApplyRetrieveRule to have a forUpdatePushedDown parameter. By the time control gets here for any given view-referencing RTE, we should already have pushed down the effects of any FOR UPDATE/S

Re: pgsql: Reorganize partitioning code

2018-04-14 Thread Amit Langote
Thanks for the commit... On Sun, Apr 15, 2018 at 9:15 AM, Alvaro Herrera wrote: > Reorganize partitioning code > > There's been a massive addition of partitioning code in PostgreSQL 11, > with little oversight on its placement, resulting in a > catalog/partition.c with poorly defined boundaries a