pgsql: Fix many typos and inconsistencies

2019-06-30 Thread Michael Paquier
Fix many typos and inconsistencies Author: Alexander Lakhin Discussion: https://postgr.es/m/af27d1b3-a128-9d62-46e0-88f424397...@gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c74d49d41c9e0fabeb1179dcabfb3137833ed831 Modified Files -- contrib

pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.

pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.

pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.

pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.

pgsql: Don't read fields of a misaligned ExpandedObjectHeader or AnyArr

2019-06-30 Thread Noah Misch
Don't read fields of a misaligned ExpandedObjectHeader or AnyArrayType. UBSan complains about this. Instead, cast to a suitable type requiring only 4-byte alignment. DatumGetAnyArrayP() already assumes one can cast between AnyArrayType and ArrayType, so this doesn't introduce a new assumption.

pgsql: Repair logic for reordering grouping sets optimization.

2019-06-30 Thread Andrew Gierth
Repair logic for reordering grouping sets optimization. The logic in reorder_grouping_sets to order grouping set elements to match a pre-specified sort ordering was defective, resulting in unnecessary sort nodes (though the query output would still be correct). Repair, simplifying the code a littl

pgsql: Repair logic for reordering grouping sets optimization.

2019-06-30 Thread Andrew Gierth
Repair logic for reordering grouping sets optimization. The logic in reorder_grouping_sets to order grouping set elements to match a pre-specified sort ordering was defective, resulting in unnecessary sort nodes (though the query output would still be correct). Repair, simplifying the code a littl

pgsql: Repair logic for reordering grouping sets optimization.

2019-06-30 Thread Andrew Gierth
Repair logic for reordering grouping sets optimization. The logic in reorder_grouping_sets to order grouping set elements to match a pre-specified sort ordering was defective, resulting in unnecessary sort nodes (though the query output would still be correct). Repair, simplifying the code a littl

pgsql: Repair logic for reordering grouping sets optimization.

2019-06-30 Thread Andrew Gierth
Repair logic for reordering grouping sets optimization. The logic in reorder_grouping_sets to order grouping set elements to match a pre-specified sort ordering was defective, resulting in unnecessary sort nodes (though the query output would still be correct). Repair, simplifying the code a littl

pgsql: Repair logic for reordering grouping sets optimization.

2019-06-30 Thread Andrew Gierth
Repair logic for reordering grouping sets optimization. The logic in reorder_grouping_sets to order grouping set elements to match a pre-specified sort ordering was defective, resulting in unnecessary sort nodes (though the query output would still be correct). Repair, simplifying the code a littl

pgsql: Exclude new src/test/modules/unsafe_tests directory from MSVC bu

2019-06-30 Thread Tom Lane
Exclude new src/test/modules/unsafe_tests directory from MSVC build. There's nothing to build here, and that was confusing AddContrib(). Per buildfarm. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/c000a47ad1fdd4fb92c7068279d97e0c3db4f8eb Modified Files -

pgsql: Blind attempt to fix SSPI-auth case in 010_dump_connstr.pl.

2019-06-30 Thread Tom Lane
Blind attempt to fix SSPI-auth case in 010_dump_connstr.pl. Up to now, pg_regress --config-auth had a hard-wired assumption that the target cluster uses the default bootstrap superuser name. pg_dump's 010_dump_connstr.pl TAP test uses non-default superuser names, and was klugily getting around the

pgsql: Move rolenames test out of the core regression tests.

2019-06-30 Thread Tom Lane
Move rolenames test out of the core regression tests. This test script is unsafe to run in "make installcheck" mode for (at least) two reasons: it creates and destroys some role names that don't follow the "regress_xxx" naming convention, and it sets and then resets the application_name GUC attach

pgsql: Fix breakage introduced in pg_lsn_in()

2019-06-30 Thread Peter Eisentraut
Fix breakage introduced in pg_lsn_in() Using PG_RETURN_LSN() from non-fmgr pg_lsn_in_internal() happened to work on some platforms, but should just be a plain "return". Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/2e810508f6b0d89621094445620a1bea3ceff3f1 Modifie

pgsql: Don't call data type input functions in GUC check hooks

2019-06-30 Thread Peter Eisentraut
Don't call data type input functions in GUC check hooks Instead of calling pg_lsn_in() in check_recovery_target_lsn and timestamptz_in() in check_recovery_target_time, reorganize the respective code so that we don't raise any errors in the check hooks. The previous code tried to use PG_TRY/PG_CATC

pgsql: Remove explicit error handling for obsolete date/time values

2019-06-30 Thread Peter Eisentraut
Remove explicit error handling for obsolete date/time values The date/time values 'current', 'invalid', and 'undefined' were removed a long time ago, but the code still contains explicit error handling for the transition. To simplify the code and avoid having to handle these values everywhere, ju