pgsql: Remove use of deprecated containment operators in tests

2020-11-03 Thread Peter Eisentraut
Remove use of deprecated containment operators in tests Switch @ to <@ and ~ to @> in gist-related tests. The old operator names have been deprecated and will eventually (possibly soon) be removed. Author: Justin Pryzby Discussion: https://www.postgresql.org/message-id/flat/20201027032511.gf9.

pgsql: Use be_tls_* API for SSL information in sslinfo

2020-11-03 Thread Magnus Hagander
Use be_tls_* API for SSL information in sslinfo sslinfo was passing the Port->ssl member directly to OpenSSL in order to extract information regarding the connection. This breaks the API provided by the backend TLS implementation, as well as duplicates code for no benefit. Rewrite to make use of t

pgsql: Improve error handling in backend OpenSSL implementation

2020-11-03 Thread Magnus Hagander
Improve error handling in backend OpenSSL implementation Commit d94c36a45ab introduced error handling to sslinfo to handle OpenSSL errors gracefully. This ports this errorhandling to the backend TLS implementation. Author: Daniel Gustafsson Branch -- master Details --- https://git.post

pgsql: Use the non-deprecated TG_TABLE_MAME in test trigger

2020-11-03 Thread Magnus Hagander
Use the non-deprecated TG_TABLE_MAME in test trigger Commit 3a9ae3d2068 (back in 2006) deprecated TG_RELNAME in favor of TG_TABLE_NAME, but the existing usage in test cases has remained till today. Change to use TG_TABLE_NAME instead (TG_RELNAME is still covered by a test case). Branch -- mas

pgsql: Remove deprecated containment operators for built-in types

2020-11-03 Thread Peter Eisentraut
Remove deprecated containment operators for built-in types Remove old containment operators @ and ~ for built-in geometry data types. These have been deprecated; use <@ and @> instead. (Some contrib modules still contain the same deprecated operators. That will be dealt with separately.) Author

pgsql: Disallow ALTER TABLE ONLY / DROP EXPRESSION

2020-11-03 Thread Peter Eisentraut
Disallow ALTER TABLE ONLY / DROP EXPRESSION The current implementation cannot handle this correctly, so just forbid it for now. GENERATED clauses must be attached to the column definition and cannot be added later like DEFAULT, so if a child table has a generation expression that the parent does

pgsql: Disallow ALTER TABLE ONLY / DROP EXPRESSION

2020-11-03 Thread Peter Eisentraut
Disallow ALTER TABLE ONLY / DROP EXPRESSION The current implementation cannot handle this correctly, so just forbid it for now. GENERATED clauses must be attached to the column definition and cannot be added later like DEFAULT, so if a child table has a generation expression that the parent does

pgsql: Allow users with BYPASSRLS to alter their own passwords.

2020-11-03 Thread Tom Lane
Allow users with BYPASSRLS to alter their own passwords. The intention in commit 491c029db was to require superuserness to change the BYPASSRLS property, but the actual effect of the coding in AlterRole() was to require superuserness to change anything at all about a BYPASSRLS role. Other propert

pgsql: Allow users with BYPASSRLS to alter their own passwords.

2020-11-03 Thread Tom Lane
Allow users with BYPASSRLS to alter their own passwords. The intention in commit 491c029db was to require superuserness to change the BYPASSRLS property, but the actual effect of the coding in AlterRole() was to require superuserness to change anything at all about a BYPASSRLS role. Other propert

pgsql: Allow users with BYPASSRLS to alter their own passwords.

2020-11-03 Thread Tom Lane
Allow users with BYPASSRLS to alter their own passwords. The intention in commit 491c029db was to require superuserness to change the BYPASSRLS property, but the actual effect of the coding in AlterRole() was to require superuserness to change anything at all about a BYPASSRLS role. Other propert

pgsql: Allow users with BYPASSRLS to alter their own passwords.

2020-11-03 Thread Tom Lane
Allow users with BYPASSRLS to alter their own passwords. The intention in commit 491c029db was to require superuserness to change the BYPASSRLS property, but the actual effect of the coding in AlterRole() was to require superuserness to change anything at all about a BYPASSRLS role. Other propert

pgsql: Allow users with BYPASSRLS to alter their own passwords.

2020-11-03 Thread Tom Lane
Allow users with BYPASSRLS to alter their own passwords. The intention in commit 491c029db was to require superuserness to change the BYPASSRLS property, but the actual effect of the coding in AlterRole() was to require superuserness to change anything at all about a BYPASSRLS role. Other propert

pgsql: Allow users with BYPASSRLS to alter their own passwords.

2020-11-03 Thread Tom Lane
Allow users with BYPASSRLS to alter their own passwords. The intention in commit 491c029db was to require superuserness to change the BYPASSRLS property, but the actual effect of the coding in AlterRole() was to require superuserness to change anything at all about a BYPASSRLS role. Other propert

pgsql: Allow users with BYPASSRLS to alter their own passwords.

2020-11-03 Thread Tom Lane
Allow users with BYPASSRLS to alter their own passwords. The intention in commit 491c029db was to require superuserness to change the BYPASSRLS property, but the actual effect of the coding in AlterRole() was to require superuserness to change anything at all about a BYPASSRLS role. Other propert

pgsql: Improve error messages around REPLICATION and BYPASSRLS properti

2020-11-03 Thread Tom Lane
Improve error messages around REPLICATION and BYPASSRLS properties. Clarify wording as per suggestion from Wolfgang Walther. No back-patch; this doesn't seem worth thrashing translatable strings in the back branches. Tom Lane and Stephen Frost Discussion: https://postgr.es/m/a5548a9f-89ee-3167-

pgsql: Guard against core dump from uninitialized subplan.

2020-11-03 Thread Tom Lane
Guard against core dump from uninitialized subplan. If the planner erroneously puts a non-parallel-safe SubPlan into a parallelized portion of the query tree, nodeSubplan.c will fail in the worker processes because it finds a null in es_subplanstates, which it's unable to cope with. It seems wort

pgsql: Guard against core dump from uninitialized subplan.

2020-11-03 Thread Tom Lane
Guard against core dump from uninitialized subplan. If the planner erroneously puts a non-parallel-safe SubPlan into a parallelized portion of the query tree, nodeSubplan.c will fail in the worker processes because it finds a null in es_subplanstates, which it's unable to cope with. It seems wort

pgsql: Guard against core dump from uninitialized subplan.

2020-11-03 Thread Tom Lane
Guard against core dump from uninitialized subplan. If the planner erroneously puts a non-parallel-safe SubPlan into a parallelized portion of the query tree, nodeSubplan.c will fail in the worker processes because it finds a null in es_subplanstates, which it's unable to cope with. It seems wort

pgsql: Guard against core dump from uninitialized subplan.

2020-11-03 Thread Tom Lane
Guard against core dump from uninitialized subplan. If the planner erroneously puts a non-parallel-safe SubPlan into a parallelized portion of the query tree, nodeSubplan.c will fail in the worker processes because it finds a null in es_subplanstates, which it's unable to cope with. It seems wort

pgsql: Guard against core dump from uninitialized subplan.

2020-11-03 Thread Tom Lane
Guard against core dump from uninitialized subplan. If the planner erroneously puts a non-parallel-safe SubPlan into a parallelized portion of the query tree, nodeSubplan.c will fail in the worker processes because it finds a null in es_subplanstates, which it's unable to cope with. It seems wort

pgsql: Use INT64_FORMAT to print int64 variables in sort debug

2020-11-03 Thread Tomas Vondra
Use INT64_FORMAT to print int64 variables in sort debug Commit 6ee3b5fb99 cleaned up most of the long/int64 confusion related to incremental sort, but the sort debug messages were still using %ld for int64 variables. So fix that. Author: Haiying Tang Backpatch-through: 13, where the incremental s

pgsql: Use INT64_FORMAT to print int64 variables in sort debug

2020-11-03 Thread Tomas Vondra
Use INT64_FORMAT to print int64 variables in sort debug Commit 6ee3b5fb99 cleaned up most of the long/int64 confusion related to incremental sort, but the sort debug messages were still using %ld for int64 variables. So fix that. Author: Haiying Tang Backpatch-through: 13, where the incremental s

pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions

2020-11-03 Thread Tomas Vondra
Fix get_useful_pathkeys_for_relation for volatile expressions When considering Incremental Sort below a Gather Merge, we need to be a bit more careful when matching pathkeys to EC members. It's not enough to find a member whose Vars are all in the current relation's target; volatile expressions in

pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions

2020-11-03 Thread Tomas Vondra
Fix get_useful_pathkeys_for_relation for volatile expressions When considering Incremental Sort below a Gather Merge, we need to be a bit more careful when matching pathkeys to EC members. It's not enough to find a member whose Vars are all in the current relation's target; volatile expressions in

pgsql: Revert pg_relation_check_pages()

2020-11-03 Thread Michael Paquier
Revert pg_relation_check_pages() This reverts the following set of commits, following complaints about the lack of portability of the central part of the code in bufmgr.c as well as the use of partition mapping locks during page reads: c780a7a9 f2b88396 b787d4ce ce7f772c 60a51c6b Per discussion w

pgsql: Tolerate version lookup failure for old style Windows locale nam

2020-11-03 Thread Thomas Munro
Tolerate version lookup failure for old style Windows locale names. Accept that we can't get versions for such locale names for now. Users will need to specify the newer language tag format to enable the collation versioning feature. It's not clear that we can do automatic conversion from the ol

pgsql: Use standard SIGHUP handler in syslogger.

2020-11-03 Thread Fujii Masao
Use standard SIGHUP handler in syslogger. Commit 1e53fe0e70 changed background processes so that they use standard SIGHUP handler. Like that, this commit makes syslogger use standard SIGHUP handler to simplify the code. Author: Bharath Rupireddy Reviewed-by: Fujii Masao Discussion: https://postg

pgsql: Get rid of the dedicated latch for signaling the startup process

2020-11-03 Thread Fujii Masao
Get rid of the dedicated latch for signaling the startup process. This commit gets rid of the dedicated latch for signaling the startup process in favor of using its procLatch, since that comports better with possible generic signal handlers using that latch. Commit 1e53fe0e70 changed background