pgsql: Track new configure flags introduced for version 11 in pg_config

2018-06-18 Thread Michael Paquier
Track new configure flags introduced for version 11 in pg_config.h.win32 The following set of flags mainly matter when building Postgres code with MSVC and those have been forgotten with latest developments: - HAVE_LDAP_INITIALIZE, added by 35c0754f, and marked as disabled. ldap_initialize() is a

pgsql: Fix jsonb_plperl to convert Perl UV values correctly.

2018-06-18 Thread Tom Lane
Fix jsonb_plperl to convert Perl UV values correctly. Values greater than IV_MAX were incorrectly converted to SQL, for instance ~0 would become -1 rather than 18446744073709551615 (on a 64-bit machine). Dagfinn Ilmari Mannsåker, adjusted a bit by me Discussion: https://postgr.es/m/d8jtvskjzzs..

pgsql: Fix contrib/hstore_plperl to look through scalar refs.

2018-06-18 Thread Tom Lane
Fix contrib/hstore_plperl to look through scalar refs. Bring this transform function into sync with the policy established by commit 3a382983d. Also, fix it to make sure that what it drills down to is indeed a hash, and not some other kind of Perl SV. Previously, the test cases added here provok

pgsql: Fix contrib/hstore_plperl to look through scalar refs.

2018-06-18 Thread Tom Lane
Fix contrib/hstore_plperl to look through scalar refs. Bring this transform function into sync with the policy established by commit 3a382983d. Also, fix it to make sure that what it drills down to is indeed a hash, and not some other kind of Perl SV. Previously, the test cases added here provok

pgsql: Fix contrib/hstore_plperl to look through scalar refs.

2018-06-18 Thread Tom Lane
Fix contrib/hstore_plperl to look through scalar refs. Bring this transform function into sync with the policy established by commit 3a382983d. Also, fix it to make sure that what it drills down to is indeed a hash, and not some other kind of Perl SV. Previously, the test cases added here provok

pgsql: Fix contrib/hstore_plperl to look through scalar refs.

2018-06-18 Thread Tom Lane
Fix contrib/hstore_plperl to look through scalar refs. Bring this transform function into sync with the policy established by commit 3a382983d. Also, fix it to make sure that what it drills down to is indeed a hash, and not some other kind of Perl SV. Previously, the test cases added here provok

pgsql: Allow plperl_sv_to_datum to look through scalar refs.

2018-06-18 Thread Tom Lane
Allow plperl_sv_to_datum to look through scalar refs. There seems little reason for the policy of throwing error if we find a ref to something other than a hash or array. Recursively look through the ref, instead. This makes the behavior in non-transform cases comparable to what was already ins

pgsql: Avoid platform-dependent output from Data::Dumper.

2018-06-18 Thread Tom Lane
Avoid platform-dependent output from Data::Dumper. Per buildfarm, the output from Data::Dumper for an IEEE infinity is platform-dependent (e.g. "inf" vs "Inf"). Just skip that one test case in the plperlu test; testing it on the plperl side is coverage enough. Fixes issue in commit 1731e3741. B

pgsql: Fix excessive enreferencing in jsonb-to-plperl transform.

2018-06-18 Thread Tom Lane
Fix excessive enreferencing in jsonb-to-plperl transform. We want, say, 2 to be transformed as 2, not \\2 which is what the original coding produced. Perl's standard seems to be to add an RV wrapper only for hash and array SVs, so do it like that. This was missed originally because the test case

pgsql: Remove obsolete prohibition on function name matching a column n

2018-06-18 Thread Tom Lane
Remove obsolete prohibition on function name matching a column name. ProcedureCreate formerly threw an error if the function to be created has one argument of composite type and the function name matches some column of the composite type. This was a (very non-bulletproof) defense against creating

pgsql: Consider syntactic form when disambiguating function vs column r

2018-06-18 Thread Tom Lane
Consider syntactic form when disambiguating function vs column reference. Postgres has traditionally considered the syntactic forms f(x) and x.f to be equivalent, allowing tricks such as writing a function and then using it as though it were a computed-on-demand column. However, our behavior when