Re: pgsql: postgres_fdw: reestablish new connection if cached one is detect

2020-10-15 Thread Fujii Masao
On 2020/10/15 16:21, Fujii Masao wrote: On 2020/10/14 3:34, Tom Lane wrote: Fujii Masao writes: On 2020/10/11 9:16, Tom Lane wrote: Meanwhile, now that I've looked at commit 32a9c0bdf, I'm not very happy with it: * The control flow seems rather forced.  I think it was designed on the as

pgsql: postgres_fdw: Restructure connection retry logic.

2020-10-15 Thread Fujii Masao
postgres_fdw: Restructure connection retry logic. Commit 32a9c0bdf introduced connection retry logic into postgres_fdw. Previously it used goto statement for retry. This commit gets rid of that goto from the logic to make the code simpler and easier-to-read. When getting out of PG_CATCH() for the

pgsql: llvmjit: Work around bug in LLVM 3.9 causing crashes after 72559

2020-10-15 Thread Andres Freund
llvmjit: Work around bug in LLVM 3.9 causing crashes after 72559438f92. Unfortunately in LLVM 3.9 LLVMGetAttributeCountAtIndex(func, index) crashes when called with an index that has 0 attributes. Since there's no way to work around this in the C API, add a small C++ wrapper doing so. The only re

pgsql: llvmjit: Work around bug in LLVM 3.9 causing crashes after 72559

2020-10-15 Thread Andres Freund
llvmjit: Work around bug in LLVM 3.9 causing crashes after 72559438f92. Unfortunately in LLVM 3.9 LLVMGetAttributeCountAtIndex(func, index) crashes when called with an index that has 0 attributes. Since there's no way to work around this in the C API, add a small C++ wrapper doing so. The only re

pgsql: llvmjit: Work around bug in LLVM 3.9 causing crashes after 72559

2020-10-15 Thread Andres Freund
llvmjit: Work around bug in LLVM 3.9 causing crashes after 72559438f92. Unfortunately in LLVM 3.9 LLVMGetAttributeCountAtIndex(func, index) crashes when called with an index that has 0 attributes. Since there's no way to work around this in the C API, add a small C++ wrapper doing so. The only re

pgsql: llvmjit: Work around bug in LLVM 3.9 causing crashes after 72559

2020-10-15 Thread Andres Freund
llvmjit: Work around bug in LLVM 3.9 causing crashes after 72559438f92. Unfortunately in LLVM 3.9 LLVMGetAttributeCountAtIndex(func, index) crashes when called with an index that has 0 attributes. Since there's no way to work around this in the C API, add a small C++ wrapper doing so. The only re

pgsql: pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd

2020-10-15 Thread Bruce Momjian
pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd This commit required support for inline variable definition, which is not a requirement. RELEASE NOTE AUTHOR: the author of commit 3c0471b5fd (pg_upgrade/tablespaces) was Justin Pryzby, not me. Reported-by: Andres Freund Discussion:

pgsql: pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd

2020-10-15 Thread Bruce Momjian
pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd This commit required support for inline variable definition, which is not a requirement. RELEASE NOTE AUTHOR: the author of commit 3c0471b5fd (pg_upgrade/tablespaces) was Justin Pryzby, not me. Reported-by: Andres Freund Discussion:

pgsql: pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd

2020-10-15 Thread Bruce Momjian
pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd This commit required support for inline variable definition, which is not a requirement. RELEASE NOTE AUTHOR: the author of commit 3c0471b5fd (pg_upgrade/tablespaces) was Justin Pryzby, not me. Reported-by: Andres Freund Discussion:

pgsql: pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd

2020-10-15 Thread Bruce Momjian
pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd This commit required support for inline variable definition, which is not a requirement. RELEASE NOTE AUTHOR: the author of commit 3c0471b5fd (pg_upgrade/tablespaces) was Justin Pryzby, not me. Reported-by: Andres Freund Discussion:

pgsql: pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd

2020-10-15 Thread Bruce Momjian
pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd This commit required support for inline variable definition, which is not a requirement. RELEASE NOTE AUTHOR: the author of commit 3c0471b5fd (pg_upgrade/tablespaces) was Justin Pryzby, not me. Reported-by: Andres Freund Discussion:

pgsql: pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd

2020-10-15 Thread Bruce Momjian
pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd This commit required support for inline variable definition, which is not a requirement. RELEASE NOTE AUTHOR: the author of commit 3c0471b5fd (pg_upgrade/tablespaces) was Justin Pryzby, not me. Reported-by: Andres Freund Discussion:

pgsql: pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd

2020-10-15 Thread Bruce Momjian
pg_upgrade: remove C99 compiler req. from commit 3c0471b5fd This commit required support for inline variable definition, which is not a requirement. RELEASE NOTE AUTHOR: the author of commit 3c0471b5fd (pg_upgrade/tablespaces) was Justin Pryzby, not me. Reported-by: Andres Freund Discussion:

pgsql: pg_upgrade: generate check error for left-over new tablespace

2020-10-15 Thread Bruce Momjian
pg_upgrade: generate check error for left-over new tablespace Previously, if pg_upgrade failed, and the user recreated the cluster but did not remove the new cluster tablespace directory, a later pg_upgrade would fail since the new tablespace directory would already exists. This adds error report

pgsql: pg_upgrade: generate check error for left-over new tablespace

2020-10-15 Thread Bruce Momjian
pg_upgrade: generate check error for left-over new tablespace Previously, if pg_upgrade failed, and the user recreated the cluster but did not remove the new cluster tablespace directory, a later pg_upgrade would fail since the new tablespace directory would already exists. This adds error report

pgsql: pg_upgrade: generate check error for left-over new tablespace

2020-10-15 Thread Bruce Momjian
pg_upgrade: generate check error for left-over new tablespace Previously, if pg_upgrade failed, and the user recreated the cluster but did not remove the new cluster tablespace directory, a later pg_upgrade would fail since the new tablespace directory would already exists. This adds error report

pgsql: pg_upgrade: generate check error for left-over new tablespace

2020-10-15 Thread Bruce Momjian
pg_upgrade: generate check error for left-over new tablespace Previously, if pg_upgrade failed, and the user recreated the cluster but did not remove the new cluster tablespace directory, a later pg_upgrade would fail since the new tablespace directory would already exists. This adds error report

pgsql: pg_upgrade: generate check error for left-over new tablespace

2020-10-15 Thread Bruce Momjian
pg_upgrade: generate check error for left-over new tablespace Previously, if pg_upgrade failed, and the user recreated the cluster but did not remove the new cluster tablespace directory, a later pg_upgrade would fail since the new tablespace directory would already exists. This adds error report

pgsql: pg_upgrade: generate check error for left-over new tablespace

2020-10-15 Thread Bruce Momjian
pg_upgrade: generate check error for left-over new tablespace Previously, if pg_upgrade failed, and the user recreated the cluster but did not remove the new cluster tablespace directory, a later pg_upgrade would fail since the new tablespace directory would already exists. This adds error report

pgsql: pg_upgrade: generate check error for left-over new tablespace

2020-10-15 Thread Bruce Momjian
pg_upgrade: generate check error for left-over new tablespace Previously, if pg_upgrade failed, and the user recreated the cluster but did not remove the new cluster tablespace directory, a later pg_upgrade would fail since the new tablespace directory would already exists. This adds error report

pgsql: llvmjit: Also copy parameter / return value attributes from temp

2020-10-15 Thread Andres Freund
llvmjit: Also copy parameter / return value attributes from template functions. Previously we only copied the function attributes. That caused problems at least on s390x: Because we didn't copy the 'zeroext' attribute for ExecAggTransReparent()'s *IsNull parameters, expressions invoking it didn't

pgsql: llvmjit: Also copy parameter / return value attributes from temp

2020-10-15 Thread Andres Freund
llvmjit: Also copy parameter / return value attributes from template functions. Previously we only copied the function attributes. That caused problems at least on s390x: Because we didn't copy the 'zeroext' attribute for ExecAggTransReparent()'s *IsNull parameters, expressions invoking it didn't

pgsql: llvmjit: Also copy parameter / return value attributes from temp

2020-10-15 Thread Andres Freund
llvmjit: Also copy parameter / return value attributes from template functions. Previously we only copied the function attributes. That caused problems at least on s390x: Because we didn't copy the 'zeroext' attribute for ExecAggTransReparent()'s *IsNull parameters, expressions invoking it didn't

pgsql: llvmjit: Also copy parameter / return value attributes from temp

2020-10-15 Thread Andres Freund
llvmjit: Also copy parameter / return value attributes from template functions. Previously we only copied the function attributes. That caused problems at least on s390x: Because we didn't copy the 'zeroext' attribute for ExecAggTransReparent()'s *IsNull parameters, expressions invoking it didn't

pgsql: doc: improve description of synchronous_commit modes

2020-10-15 Thread Bruce Momjian
doc: improve description of synchronous_commit modes Previously it wasn't clear exactly what each of the synchronous_commit modes accomplished. This clarifies that, and adds a table describing it. Only backpatched through 9.6 since 9.5 doesn't have all the options. Reported-by: [email protected]

pgsql: doc: improve description of synchronous_commit modes

2020-10-15 Thread Bruce Momjian
doc: improve description of synchronous_commit modes Previously it wasn't clear exactly what each of the synchronous_commit modes accomplished. This clarifies that, and adds a table describing it. Only backpatched through 9.6 since 9.5 doesn't have all the options. Reported-by: [email protected]

pgsql: doc: improve description of synchronous_commit modes

2020-10-15 Thread Bruce Momjian
doc: improve description of synchronous_commit modes Previously it wasn't clear exactly what each of the synchronous_commit modes accomplished. This clarifies that, and adds a table describing it. Only backpatched through 9.6 since 9.5 doesn't have all the options. Reported-by: [email protected]

pgsql: doc: improve description of synchronous_commit modes

2020-10-15 Thread Bruce Momjian
doc: improve description of synchronous_commit modes Previously it wasn't clear exactly what each of the synchronous_commit modes accomplished. This clarifies that, and adds a table describing it. Only backpatched through 9.6 since 9.5 doesn't have all the options. Reported-by: [email protected]

pgsql: doc: improve description of synchronous_commit modes

2020-10-15 Thread Bruce Momjian
doc: improve description of synchronous_commit modes Previously it wasn't clear exactly what each of the synchronous_commit modes accomplished. This clarifies that, and adds a table describing it. Only backpatched through 9.6 since 9.5 doesn't have all the options. Reported-by: [email protected]

pgsql: doc: improve description of synchronous_commit modes

2020-10-15 Thread Bruce Momjian
doc: improve description of synchronous_commit modes Previously it wasn't clear exactly what each of the synchronous_commit modes accomplished. This clarifies that, and adds a table describing it. Only backpatched through 9.6 since 9.5 doesn't have all the options. Reported-by: [email protected]

pgsql: Revert "Remove pointless HeapTupleHeaderIndicatesMovedPartitions

2020-10-15 Thread Alvaro Herrera
Revert "Remove pointless HeapTupleHeaderIndicatesMovedPartitions calls" This reverts commit 85adb5e91ec2. It was not intended for commit just yet. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/93f84d59f80d11a3d8ade9ae71560162d6f3ecb2 Modified Files -

pgsql: Remove pointless HeapTupleHeaderIndicatesMovedPartitions calls

2020-10-15 Thread Alvaro Herrera
Remove pointless HeapTupleHeaderIndicatesMovedPartitions calls Pavan Deolasee recently noted that a few of the HeapTupleHeaderIndicatesMovedPartitions calls added by commit 5db6df0c0117 are useless, since they are done after comparing t_self with t_ctid. But because t_self can never be set to the

pgsql: In the postmaster, rely on the signal infrastructure to block si

2020-10-15 Thread Tom Lane
In the postmaster, rely on the signal infrastructure to block signals. POSIX sigaction(2) can be told to block a set of signals while a signal handler executes. Make use of that instead of manually blocking and unblocking signals in the postmaster's signal handlers. This should save a few cycles,

pgsql: In the postmaster, rely on the signal infrastructure to block si

2020-10-15 Thread Tom Lane
In the postmaster, rely on the signal infrastructure to block signals. POSIX sigaction(2) can be told to block a set of signals while a signal handler executes. Make use of that instead of manually blocking and unblocking signals in the postmaster's signal handlers. This should save a few cycles,

pgsql: In the postmaster, rely on the signal infrastructure to block si

2020-10-15 Thread Tom Lane
In the postmaster, rely on the signal infrastructure to block signals. POSIX sigaction(2) can be told to block a set of signals while a signal handler executes. Make use of that instead of manually blocking and unblocking signals in the postmaster's signal handlers. This should save a few cycles,

pgsql: In the postmaster, rely on the signal infrastructure to block si

2020-10-15 Thread Tom Lane
In the postmaster, rely on the signal infrastructure to block signals. POSIX sigaction(2) can be told to block a set of signals while a signal handler executes. Make use of that instead of manually blocking and unblocking signals in the postmaster's signal handlers. This should save a few cycles,

pgsql: Install pg_isolation_regress and isolationtester

2020-10-15 Thread Alvaro Herrera
Install pg_isolation_regress and isolationtester We already install assorted tools for testing extensions, but these two were missing. Having them installed, and after ISOLATION support was added to PGXS's makefiles by d3c09b9b1307, helps third-party modules usefully include isolation tests. Co

pgsql: Review logical replication tablesync code

2020-10-15 Thread Alvaro Herrera
Review logical replication tablesync code Most importantly, remove optimization in LogicalRepSyncTableStart that skips the normal walrcv_startstreaming/endstreaming dance. The optimization is not critically important for production uses anyway, since it only fires in cases with no activity, and s

pgsql: Refactor code for cross-partition updates to a separate function

2020-10-15 Thread Heikki Linnakangas
Refactor code for cross-partition updates to a separate function. ExecUpdate() is very long, so extract the part of it that deals with cross-partition updates to a separate function to make it more readable. Per Andres Freund's suggestion. Author: Amit Langote Discussion: https://www.postgresql.

pgsql: Fix query in new test to check tables are synced

2020-10-15 Thread Alvaro Herrera
Fix query in new test to check tables are synced Rather than looking for tablesync workers, it is more reliable to see the sync state of the tables. Per note from Amit Kapila. Discussion: https://postgr.es/m/caa4ek1jssd7fvwq+_rome86juztqfzjsnu06hq4-lirt1xf...@mail.gmail.com Branch -- REL_13

pgsql: Fix query in new test to check tables are synced

2020-10-15 Thread Alvaro Herrera
Fix query in new test to check tables are synced Rather than looking for tablesync workers, it is more reliable to see the sync state of the tables. Per note from Amit Kapila. Discussion: https://postgr.es/m/caa4ek1jssd7fvwq+_rome86juztqfzjsnu06hq4-lirt1xf...@mail.gmail.com Branch -- master

pgsql: Replace calls of htonl()/ntohl() with pg_bswap.h for GSSAPI encr

2020-10-15 Thread Michael Paquier
Replace calls of htonl()/ntohl() with pg_bswap.h for GSSAPI encryption The in-core equivalents can make use of built-in functions if the compiler supports this option, making optimizations possible. 0ba99c8 replaced all existing calls in the code base at this time, but b0b39f7 (GSSAPI encryption)

pgsql: Improve tab-completion for FETCH/MOVE.

2020-10-15 Thread Fujii Masao
Improve tab-completion for FETCH/MOVE. Author: Naoki Nakamichi Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/[email protected] Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/8176afd8b764e54fc6e34240928effc661fc40cd Modifie

pgsql: Fixup some appendStringInfo and appendPQExpBuffer calls

2020-10-15 Thread David Rowley
Fixup some appendStringInfo and appendPQExpBuffer calls A number of places were using appendStringInfo() when they could have been using appendStringInfoString() instead. While there's no functionality change there, it's just more efficient to use appendStringInfoString() when no formatting is re

Re: pgsql: postgres_fdw: reestablish new connection if cached one is detect

2020-10-15 Thread Fujii Masao
On 2020/10/14 3:34, Tom Lane wrote: Fujii Masao writes: On 2020/10/11 9:16, Tom Lane wrote: Meanwhile, now that I've looked at commit 32a9c0bdf, I'm not very happy with it: * The control flow seems rather forced. I think it was designed on the assumption that reindenting the existing code

pgsql: Add documentation link to attributes supported by Clang

2020-10-15 Thread Peter Eisentraut
Add documentation link to attributes supported by Clang Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/73c381cee71e7dd8a78a394731958b0bbb4d8991 Modified Files -- src/include/c.h | 1 + 1 file changed, 1 insertion(+)