pgsql: Cleanup code in reloptions.h regarding reloption handling

2019-11-13 Thread Michael Paquier
Cleanup code in reloptions.h regarding reloption handling reloptions.h includes since ba748f7 a set of macros to handle reloption types in a way similar to how parseRelOptions() works. They have never been used in the core code, and we have more simple methods now to parse and fill in rd_options

pgsql: Split handling of reloptions for partitioned tables

2019-11-13 Thread Michael Paquier
Split handling of reloptions for partitioned tables Partitioned tables do not have relation options yet, but, similarly to what's done for views which have their own parsing table, it could make sense to introduce new parameters for some of the existing default ones like fillfactor, autovacuum, et

pgsql: Fix plan instability in the new tuplesort test.

2019-11-13 Thread Andres Freund
Fix plan instability in the new tuplesort test. At least buildfarm member florican doesn't use a material node above a sort in the mark/restore case. As material is not intended to be tested with that query, disallow. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/

pgsql: Remove unused code from tuplesort.

2019-11-13 Thread Andres Freund
Remove unused code from tuplesort. copytup_index() is unused, as tuplesort_putindextuplevalues() doesn't use COPYTUP(). Replace function body with an elog(ERROR), as already done e.g. for copytup_datum(). Author: Andres Freund Discussion: https://postgr.es/m/20191013144153.ooxrfglvnaocs...@alap3

pgsql: Add tests for tuplesort.c.

2019-11-13 Thread Andres Freund
Add tests for tuplesort.c. Previously significant parts of tuplesort.c were untested. This commit, while not testing every path, significantly increases coverage. In particular, this adds tests for abbreviated key logic, forward/backward scans & scrolling and mark/restore. I tried to keep the ta

pgsql: Add missing check_collation_set call to bpcharne().

2019-11-13 Thread Tom Lane
Add missing check_collation_set call to bpcharne(). We should throw an error for indeterminate collation, but bpcharne() was missing that logic, resulting in a much less user-friendly error (either an assertion failure or "cache lookup failed for collation 0"). Per report from Manuel Rigger. Bac

pgsql: Add missing check_collation_set call to bpcharne().

2019-11-13 Thread Tom Lane
Add missing check_collation_set call to bpcharne(). We should throw an error for indeterminate collation, but bpcharne() was missing that logic, resulting in a much less user-friendly error (either an assertion failure or "cache lookup failed for collation 0"). Per report from Manuel Rigger. Bac

pgsql: Fix silly initializations (cosmetic only).

2019-11-13 Thread Tom Lane
Fix silly initializations (cosmetic only). Initializing a pointer to "false" isn't per project style, and reportedly some compilers warn about it (though I've not seen any such warnings in the buildfarm). Seems to have come in with commit ff11e7f4b, so back-patch to v12 where that was added. Did

pgsql: Fix silly initializations (cosmetic only).

2019-11-13 Thread Tom Lane
Fix silly initializations (cosmetic only). Initializing a pointer to "false" isn't per project style, and reportedly some compilers warn about it (though I've not seen any such warnings in the buildfarm). Seems to have come in with commit ff11e7f4b, so back-patch to v12 where that was added. Did

pgsql: Avoid using SplitIdentifierString to parse ListenAddresses, too.

2019-11-13 Thread Tom Lane
Avoid using SplitIdentifierString to parse ListenAddresses, too. This gets rid of our former behavior of forcibly downcasing the postmaster's hostname list and truncating the elements to NAMEDATALEN. In principle, DNS hostnames are case-insensitive so the first behavior should be harmless, and se

pgsql: Avoid downcasing/truncation of RADIUS authentication parameters.

2019-11-13 Thread Tom Lane
Avoid downcasing/truncation of RADIUS authentication parameters. Commit 6b76f1bb5 changed all the RADIUS auth parameters to be lists rather than single values. But its use of SplitIdentifierString to parse the list format was not very carefully thought through, because that function thinks it's p

pgsql: Avoid downcasing/truncation of RADIUS authentication parameters.

2019-11-13 Thread Tom Lane
Avoid downcasing/truncation of RADIUS authentication parameters. Commit 6b76f1bb5 changed all the RADIUS auth parameters to be lists rather than single values. But its use of SplitIdentifierString to parse the list format was not very carefully thought through, because that function thinks it's p

pgsql: Avoid downcasing/truncation of RADIUS authentication parameters.

2019-11-13 Thread Tom Lane
Avoid downcasing/truncation of RADIUS authentication parameters. Commit 6b76f1bb5 changed all the RADIUS auth parameters to be lists rather than single values. But its use of SplitIdentifierString to parse the list format was not very carefully thought through, because that function thinks it's p

pgsql: Avoid downcasing/truncation of RADIUS authentication parameters.

2019-11-13 Thread Tom Lane
Avoid downcasing/truncation of RADIUS authentication parameters. Commit 6b76f1bb5 changed all the RADIUS auth parameters to be lists rather than single values. But its use of SplitIdentifierString to parse the list format was not very carefully thought through, because that function thinks it's p

pgsql: Include TableFunc references when computing expression dependenc

2019-11-13 Thread Tom Lane
Include TableFunc references when computing expression dependencies. The TableFunc node (i.e., XMLTABLE) includes type and collation OIDs that might not be referenced anywhere else in the expression tree, so they need to be accounted for when extracting dependencies. Fortunately, the practical ef

pgsql: Include TableFunc references when computing expression dependenc

2019-11-13 Thread Tom Lane
Include TableFunc references when computing expression dependencies. The TableFunc node (i.e., XMLTABLE) includes type and collation OIDs that might not be referenced anywhere else in the expression tree, so they need to be accounted for when extracting dependencies. Fortunately, the practical ef

pgsql: Include TableFunc references when computing expression dependenc

2019-11-13 Thread Tom Lane
Include TableFunc references when computing expression dependencies. The TableFunc node (i.e., XMLTABLE) includes type and collation OIDs that might not be referenced anywhere else in the expression tree, so they need to be accounted for when extracting dependencies. Fortunately, the practical ef

pgsql: Include TableFunc references when computing expression dependenc

2019-11-13 Thread Tom Lane
Include TableFunc references when computing expression dependencies. The TableFunc node (i.e., XMLTABLE) includes type and collation OIDs that might not be referenced anywhere else in the expression tree, so they need to be accounted for when extracting dependencies. Fortunately, the practical ef

pgsql: Handle arrays and ranges in pg_upgrade's test for non-upgradable

2019-11-13 Thread Tom Lane
Handle arrays and ranges in pg_upgrade's test for non-upgradable types. pg_upgrade needs to check whether certain non-upgradable data types appear anywhere on-disk in the source cluster. It knew that it has to check for these types being contained inside domains and composite types; but it someho

pgsql: Handle arrays and ranges in pg_upgrade's test for non-upgradable

2019-11-13 Thread Tom Lane
Handle arrays and ranges in pg_upgrade's test for non-upgradable types. pg_upgrade needs to check whether certain non-upgradable data types appear anywhere on-disk in the source cluster. It knew that it has to check for these types being contained inside domains and composite types; but it someho

pgsql: Handle arrays and ranges in pg_upgrade's test for non-upgradable

2019-11-13 Thread Tom Lane
Handle arrays and ranges in pg_upgrade's test for non-upgradable types. pg_upgrade needs to check whether certain non-upgradable data types appear anywhere on-disk in the source cluster. It knew that it has to check for these types being contained inside domains and composite types; but it someho

pgsql: Handle arrays and ranges in pg_upgrade's test for non-upgradable

2019-11-13 Thread Tom Lane
Handle arrays and ranges in pg_upgrade's test for non-upgradable types. pg_upgrade needs to check whether certain non-upgradable data types appear anywhere on-disk in the source cluster. It knew that it has to check for these types being contained inside domains and composite types; but it someho

pgsql: Handle arrays and ranges in pg_upgrade's test for non-upgradable

2019-11-13 Thread Tom Lane
Handle arrays and ranges in pg_upgrade's test for non-upgradable types. pg_upgrade needs to check whether certain non-upgradable data types appear anywhere on-disk in the source cluster. It knew that it has to check for these types being contained inside domains and composite types; but it someho

pgsql: Handle arrays and ranges in pg_upgrade's test for non-upgradable

2019-11-13 Thread Tom Lane
Handle arrays and ranges in pg_upgrade's test for non-upgradable types. pg_upgrade needs to check whether certain non-upgradable data types appear anywhere on-disk in the source cluster. It knew that it has to check for these types being contained inside domains and composite types; but it someho

pgsql: Handle arrays and ranges in pg_upgrade's test for non-upgradable

2019-11-13 Thread Tom Lane
Handle arrays and ranges in pg_upgrade's test for non-upgradable types. pg_upgrade needs to check whether certain non-upgradable data types appear anywhere on-disk in the source cluster. It knew that it has to check for these types being contained inside domains and composite types; but it someho

pgsql: Make pg_waldump report more detail information about PREPARE TRA

2019-11-13 Thread Fujii Masao
Make pg_waldump report more detail information about PREPARE TRANSACTION record. This commit changes xact_desc() so that it reports the detail information about PREPARE TRANSACTION record, like GID (global transaction identifier), timestamp at prepare transaction, delete-on-abort/commit relations,

Re: pgsql: Make the order of the header file includes consistent in backend

2019-11-13 Thread Amit Kapila
On Tue, Nov 12, 2019 at 5:19 PM Amit Kapila wrote: > > On Tue, Nov 12, 2019 at 8:33 AM Amit Kapila wrote: > > > > Make the order of the header file includes consistent in backend modules. > > > > I see two buildfarm failures at this commit, but none seems to related > to this change. > Both the