pgsql: Add missing errcode() in a few ereport calls.

2020-03-17 Thread Amit Kapila
Add missing errcode() in a few ereport calls. This will allow to specifying SQLSTATE error code for the errors in the missing places. Reported-by: Sawada Masahiko Author: Sawada Masahiko Backpatch-through: 9.5 Discussion: https://postgr.es/m/ca+fd4k6n8ejnvzpm8nme+y+05mz-sm8z_bgkixzka34r+ej...@ma

pgsql: Add missing errcode() in a few ereport calls.

2020-03-17 Thread Amit Kapila
Add missing errcode() in a few ereport calls. This will allow to specifying SQLSTATE error code for the errors in the missing places. Reported-by: Sawada Masahiko Author: Sawada Masahiko Backpatch-through: 9.5 Discussion: https://postgr.es/m/ca+fd4k6n8ejnvzpm8nme+y+05mz-sm8z_bgkixzka34r+ej...@ma

pgsql: Add missing errcode() in a few ereport calls.

2020-03-17 Thread Amit Kapila
Add missing errcode() in a few ereport calls. This will allow to specifying SQLSTATE error code for the errors in the missing places. Reported-by: Sawada Masahiko Author: Sawada Masahiko Backpatch-through: 9.5 Discussion: https://postgr.es/m/ca+fd4k6n8ejnvzpm8nme+y+05mz-sm8z_bgkixzka34r+ej...@ma

pgsql: Add missing errcode() in a few ereport calls.

2020-03-17 Thread Amit Kapila
Add missing errcode() in a few ereport calls. This will allow to specifying SQLSTATE error code for the errors in the missing places. Reported-by: Sawada Masahiko Author: Sawada Masahiko Backpatch-through: 9.5 Discussion: https://postgr.es/m/ca+fd4k6n8ejnvzpm8nme+y+05mz-sm8z_bgkixzka34r+ej...@ma

pgsql: Add missing errcode() in a few ereport calls.

2020-03-17 Thread Amit Kapila
Add missing errcode() in a few ereport calls. This will allow to specifying SQLSTATE error code for the errors in the missing places. Reported-by: Sawada Masahiko Author: Sawada Masahiko Backpatch-through: 9.5 Discussion: https://postgr.es/m/ca+fd4k6n8ejnvzpm8nme+y+05mz-sm8z_bgkixzka34r+ej...@ma

pgsql: Add missing errcode() in a few ereport calls.

2020-03-17 Thread Amit Kapila
Add missing errcode() in a few ereport calls. This will allow to specifying SQLSTATE error code for the errors in the missing places. Reported-by: Sawada Masahiko Author: Sawada Masahiko Backpatch-through: 9.5 Discussion: https://postgr.es/m/ca+fd4k6n8ejnvzpm8nme+y+05mz-sm8z_bgkixzka34r+ej...@ma

pgsql: Fix typo in indexcmds.c

2020-03-17 Thread Michael Paquier
Fix typo in indexcmds.c Introduced by 61d7c7b. Backpatch-through: 12 Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/c5b6b9c0d74400300b77d44194f6679f470352f2 Modified Files -- src/backend/commands/indexcmds.c | 2 +- 1 file changed, 1 insertion(+

pgsql: Fix typo in indexcmds.c

2020-03-17 Thread Michael Paquier
Fix typo in indexcmds.c Introduced by 61d7c7b. Backpatch-through: 12 Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fdeeb524b4e28affc527548af389c75e0a99c340 Modified Files -- src/backend/commands/indexcmds.c | 2 +- 1 file changed, 1 insertion(+), 1 de

Re: pgsql: Revert "initdb: Change authentication defaults"

2020-03-17 Thread Michael Paquier
On Tue, Mar 17, 2020 at 10:37:40AM -0400, Tom Lane wrote: > As of this morning, the only active animal ("active" meaning "has > built HEAD in the last month") that is not running REL_11 is > hamerkop. I think we could proceed. +1. -- Michael signature.asc Description: PGP signature

pgsql: Assert that we don't acquire a heavyweight lock on another objec

2020-03-17 Thread Amit Kapila
Assert that we don't acquire a heavyweight lock on another object after relation extension lock. The only exception to the rule is that we can try to acquire the same relation extension lock more than once. This is allowed as we are not creating any new lock for this case. This restriction impli

pgsql: nbtree: Remove useless local variables.

2020-03-17 Thread Peter Geoghegan
nbtree: Remove useless local variables. Copying block and offset numbers to local variables in _bt_insertonpg() made the code less readable. Remove the variables. There is already code that conditionally calls BufferGetBlockNumber() in the same block, so consistently do it that way instead. Cal

Re: pgsql: Add kqueue(2) support to the WaitEventSet API.

2020-03-17 Thread Thomas Munro
On Tue, Mar 17, 2020 at 10:21 AM Thomas Munro wrote: > I'm now far away from my home Mac so I can't test until later but I > think we can fix this by double checking with the pipe: Pushed.

pgsql: Fix kqueue support under debugger on macOS.

2020-03-17 Thread Thomas Munro
Fix kqueue support under debugger on macOS. While running under a debugger, macOS's getppid() can return the debugger's PID. That could cause a backend to exit because it falsely believed that the postmaster had died, since commit 815c2f09. Continue to use getppid() as a fast postmaster check af

pgsql: Don't use EV_CLEAR for kqueue events.

2020-03-17 Thread Thomas Munro
Don't use EV_CLEAR for kqueue events. For the semantics to match the epoll implementation, we need a socket to continue to appear readable/writable if you wait multiple times without doing I/O in between (in Linux terminology: level-triggered rather than edge-triggered). This distinction will be

pgsql: Refactor our checks for valid function and aggregate signatures.

2020-03-17 Thread Tom Lane
Refactor our checks for valid function and aggregate signatures. pg_proc.c and pg_aggregate.c had near-duplicate copies of the logic to decide whether a function or aggregate's signature is legal. This seems like a bad thing even without the problem that the upcoming "anycompatible" patch would ro

pgsql: Doc: Correct deduplicate_items varlistentry id.

2020-03-17 Thread Peter Geoghegan
Doc: Correct deduplicate_items varlistentry id. Use a varlistentry id for the deduplicate_items storage parameter that is derived from the name of the parameter itself. This oversight happened because the storage parameter was renamed relatively late during the development of the patch that becam

pgsql: Adjust handling of an ANYARRAY actual input for an ANYARRAY argu

2020-03-17 Thread Tom Lane
Adjust handling of an ANYARRAY actual input for an ANYARRAY argument. Ordinarily it's impossible for an actual input of a function to have declared type ANYARRAY, since we'd resolve that to a concrete array type before doing argument type resolution for the function. But an exception arises for f

pgsql: Remove logical_read_local_xlog_page

2020-03-17 Thread Alvaro Herrera
Remove logical_read_local_xlog_page It devolved into a content-less wrapper over read_local_xlog_page, with nothing to add, plus it's easily confused with walsender's logical_read_xlog_page. There doesn't seem to be any reason for it to stay. src/include/replication/logicalfuncs.h becomes empty,

pgsql: Fix consistency issues with replication slot copy

2020-03-17 Thread Alvaro Herrera
Fix consistency issues with replication slot copy Commit 9f06d79ef831's replication slot copying failed to properly reserve the WAL that the slot is expecting to see during DecodingContextFindStartpoint (to set the confirmed_flush LSN), so concurrent activity could remove that WAL and cause the co

pgsql: Fix consistency issues with replication slot copy

2020-03-17 Thread Alvaro Herrera
Fix consistency issues with replication slot copy Commit 9f06d79ef831's replication slot copying failed to properly reserve the WAL that the slot is expecting to see during DecodingContextFindStartpoint (to set the confirmed_flush LSN), so concurrent activity could remove that WAL and cause the co

pgsql: Doc: clarify behavior of "anyrange" pseudo-type.

2020-03-17 Thread Tom Lane
Doc: clarify behavior of "anyrange" pseudo-type. I noticed that we completely failed to document the restriction that an "anyrange" result type has to be inferred from an "anyrange" input. The docs also were less clear than they could be about the relationship between "anyrange" and "anyarray".

pgsql: Doc: clarify behavior of "anyrange" pseudo-type.

2020-03-17 Thread Tom Lane
Doc: clarify behavior of "anyrange" pseudo-type. I noticed that we completely failed to document the restriction that an "anyrange" result type has to be inferred from an "anyrange" input. The docs also were less clear than they could be about the relationship between "anyrange" and "anyarray".

pgsql: Doc: clarify behavior of "anyrange" pseudo-type.

2020-03-17 Thread Tom Lane
Doc: clarify behavior of "anyrange" pseudo-type. I noticed that we completely failed to document the restriction that an "anyrange" result type has to be inferred from an "anyrange" input. The docs also were less clear than they could be about the relationship between "anyrange" and "anyarray".

pgsql: Doc: clarify behavior of "anyrange" pseudo-type.

2020-03-17 Thread Tom Lane
Doc: clarify behavior of "anyrange" pseudo-type. I noticed that we completely failed to document the restriction that an "anyrange" result type has to be inferred from an "anyrange" input. The docs also were less clear than they could be about the relationship between "anyrange" and "anyarray".

pgsql: Doc: clarify behavior of "anyrange" pseudo-type.

2020-03-17 Thread Tom Lane
Doc: clarify behavior of "anyrange" pseudo-type. I noticed that we completely failed to document the restriction that an "anyrange" result type has to be inferred from an "anyrange" input. The docs also were less clear than they could be about the relationship between "anyrange" and "anyarray".

pgsql: Doc: clarify behavior of "anyrange" pseudo-type.

2020-03-17 Thread Tom Lane
Doc: clarify behavior of "anyrange" pseudo-type. I noticed that we completely failed to document the restriction that an "anyrange" result type has to be inferred from an "anyrange" input. The docs also were less clear than they could be about the relationship between "anyrange" and "anyarray".

pgsql: Remove bogus assertion about polymorphic SQL function result.

2020-03-17 Thread Tom Lane
Remove bogus assertion about polymorphic SQL function result. It is possible to reach check_sql_fn_retval() with an unresolved polymorphic rettype, resulting in an assertion failure as demonstrated by one of the added test cases. However, the code following that throws what seems an acceptable er

pgsql: Use pkg-config, if available, to locate libxml2 during configure

2020-03-17 Thread Tom Lane
Use pkg-config, if available, to locate libxml2 during configure. If pkg-config is installed and knows about libxml2, use its information rather than asking xml2-config. Otherwise proceed as before. This patch allows "configure --with-libxml" to succeed on platforms that have pkg-config but not

pgsql: Use pkg-config, if available, to locate libxml2 during configure

2020-03-17 Thread Tom Lane
Use pkg-config, if available, to locate libxml2 during configure. If pkg-config is installed and knows about libxml2, use its information rather than asking xml2-config. Otherwise proceed as before. This patch allows "configure --with-libxml" to succeed on platforms that have pkg-config but not

pgsql: Use pkg-config, if available, to locate libxml2 during configure

2020-03-17 Thread Tom Lane
Use pkg-config, if available, to locate libxml2 during configure. If pkg-config is installed and knows about libxml2, use its information rather than asking xml2-config. Otherwise proceed as before. This patch allows "configure --with-libxml" to succeed on platforms that have pkg-config but not

pgsql: Use pkg-config, if available, to locate libxml2 during configure

2020-03-17 Thread Tom Lane
Use pkg-config, if available, to locate libxml2 during configure. If pkg-config is installed and knows about libxml2, use its information rather than asking xml2-config. Otherwise proceed as before. This patch allows "configure --with-libxml" to succeed on platforms that have pkg-config but not

Re: pgsql: Revert "initdb: Change authentication defaults"

2020-03-17 Thread Tom Lane
Andrew Dunstan writes: > Everyone on the list has been asked to upgrade their animals. In a > couple of cases people have told me it will take them a week or so. As of this morning, the only active animal ("active" meaning "has built HEAD in the last month") that is not running REL_11 is hamerkop

pgsql: Add the type information for index storage parameters to the doc

2020-03-17 Thread Fujii Masao
Add the type information for index storage parameters to the documentation. Author: Atsushi Torikoshi Discussion: https://postgr.es/m/cacz0uyfqebs4wt5eu3dk4qm_2purzuvb++8ndvsbg0ebrwm...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/28e0a103a835aec8