pgsql: Use C99 designated initializers for some structs

2018-09-07 Thread Peter Eisentraut
Use C99 designated initializers for some structs These are just a few particularly egregious cases that were hard to read and write, and error prone because of many similar adjacent types. Discussion: https://www.postgresql.org/message-id/flat/4c9f01be-9245-2148-b569-61a8562ef190%402ndquadrant.c

pgsql: libpq: Change "options" dispchar to normal

2018-09-07 Thread Peter Eisentraut
libpq: Change "options" dispchar to normal libpq connection options as returned by PQconndefaults() have a "dispchar" field that determines (among other things) whether an option is a "debug" option, which shouldn't be shown by default to clients. postgres_fdw makes use of that to control which co

pgsql: Refactor installation of extension headers.

2018-09-07 Thread Andrew Gierth
Refactor installation of extension headers. Commit be54b3777 failed on gmake 3.80 due to a chained conditional, which on closer examination could be removed entirely with some refactoring elsewhere for a net simplification and more robustness against empty expansions. Along the way, add some more

pgsql: Refactor installation of extension headers.

2018-09-07 Thread Andrew Gierth
Refactor installation of extension headers. Commit be54b3777 failed on gmake 3.80 due to a chained conditional, which on closer examination could be removed entirely with some refactoring elsewhere for a net simplification and more robustness against empty expansions. Along the way, add some more

pgsql: Improve handling of corrupted two-phase state files at recovery

2018-09-07 Thread Michael Paquier
Improve handling of corrupted two-phase state files at recovery When a corrupted two-phase state file is found by WAL replay, be it for crash recovery or archive recovery, then the file is simply skipped and a WARNING is logged to the user, causing the transaction to be silently lost. Facing an o

Re: pgsql: Allow extensions to install built as well as unbuilt headers.

2018-09-07 Thread Michael Paquier
On Thu, Sep 06, 2018 at 05:18:10PM +0100, Andrew Gierth wrote: > Yeah; I checked the other constructs I used for what version they were > added in, but that one slipped through. Fix coming shortly. For the sake of the archives, Andrew has pushed 7b6b167 to address the issue, which looks fine at qu

pgsql: Fix longstanding recursion hazard in sinval message processing.

2018-09-07 Thread Tom Lane
Fix longstanding recursion hazard in sinval message processing. LockRelationOid and sibling routines supposed that, if our session already holds the lock they were asked to acquire, they could skip calling AcceptInvalidationMessages on the grounds that we must have already read any remote sinval m

pgsql: Fix longstanding recursion hazard in sinval message processing.

2018-09-07 Thread Tom Lane
Fix longstanding recursion hazard in sinval message processing. LockRelationOid and sibling routines supposed that, if our session already holds the lock they were asked to acquire, they could skip calling AcceptInvalidationMessages on the grounds that we must have already read any remote sinval m

pgsql: Fix longstanding recursion hazard in sinval message processing.

2018-09-07 Thread Tom Lane
Fix longstanding recursion hazard in sinval message processing. LockRelationOid and sibling routines supposed that, if our session already holds the lock they were asked to acquire, they could skip calling AcceptInvalidationMessages on the grounds that we must have already read any remote sinval m

pgsql: Fix longstanding recursion hazard in sinval message processing.

2018-09-07 Thread Tom Lane
Fix longstanding recursion hazard in sinval message processing. LockRelationOid and sibling routines supposed that, if our session already holds the lock they were asked to acquire, they could skip calling AcceptInvalidationMessages on the grounds that we must have already read any remote sinval m

pgsql: Fix longstanding recursion hazard in sinval message processing.

2018-09-07 Thread Tom Lane
Fix longstanding recursion hazard in sinval message processing. LockRelationOid and sibling routines supposed that, if our session already holds the lock they were asked to acquire, they could skip calling AcceptInvalidationMessages on the grounds that we must have already read any remote sinval m

pgsql: Fix longstanding recursion hazard in sinval message processing.

2018-09-07 Thread Tom Lane
Fix longstanding recursion hazard in sinval message processing. LockRelationOid and sibling routines supposed that, if our session already holds the lock they were asked to acquire, they could skip calling AcceptInvalidationMessages on the grounds that we must have already read any remote sinval m

pgsql: Fix longstanding recursion hazard in sinval message processing.

2018-09-07 Thread Tom Lane
Fix longstanding recursion hazard in sinval message processing. LockRelationOid and sibling routines supposed that, if our session already holds the lock they were asked to acquire, they could skip calling AcceptInvalidationMessages on the grounds that we must have already read any remote sinval m

pgsql: Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY.

2018-09-07 Thread Tom Lane
Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY. It's somewhat surprising that we got away with this before. (Actually, since nobody tests this routinely AFAIK, it might've been broken for awhile. But it's definitely broken in the wake of commit f868a8143.) It seems sufficient to l

pgsql: Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY.

2018-09-07 Thread Tom Lane
Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY. It's somewhat surprising that we got away with this before. (Actually, since nobody tests this routinely AFAIK, it might've been broken for awhile. But it's definitely broken in the wake of commit f868a8143.) It seems sufficient to l

pgsql: Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY.

2018-09-07 Thread Tom Lane
Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY. It's somewhat surprising that we got away with this before. (Actually, since nobody tests this routinely AFAIK, it might've been broken for awhile. But it's definitely broken in the wake of commit f868a8143.) It seems sufficient to l

pgsql: Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY.

2018-09-07 Thread Tom Lane
Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY. It's somewhat surprising that we got away with this before. (Actually, since nobody tests this routinely AFAIK, it might've been broken for awhile. But it's definitely broken in the wake of commit f868a8143.) It seems sufficient to l

pgsql: Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY.

2018-09-07 Thread Tom Lane
Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY. It's somewhat surprising that we got away with this before. (Actually, since nobody tests this routinely AFAIK, it might've been broken for awhile. But it's definitely broken in the wake of commit f868a8143.) It seems sufficient to l

pgsql: Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY.

2018-09-07 Thread Tom Lane
Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY. It's somewhat surprising that we got away with this before. (Actually, since nobody tests this routinely AFAIK, it might've been broken for awhile. But it's definitely broken in the wake of commit f868a8143.) It seems sufficient to l

pgsql: Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY.

2018-09-07 Thread Tom Lane
Limit depth of forced recursion for CLOBBER_CACHE_RECURSIVELY. It's somewhat surprising that we got away with this before. (Actually, since nobody tests this routinely AFAIK, it might've been broken for awhile. But it's definitely broken in the wake of commit f868a8143.) It seems sufficient to l

pgsql: Save/restore SPI's global variables in SPI_connect() and SPI_fin

2018-09-07 Thread Tom Lane
Save/restore SPI's global variables in SPI_connect() and SPI_finish(). This patch removes two sources of interference between nominally independent functions when one SPI-using function calls another, perhaps without knowing that it does so. Chapman Flack pointed out that xml.c's query_to_xml_int

pgsql: Save/restore SPI's global variables in SPI_connect() and SPI_fin

2018-09-07 Thread Tom Lane
Save/restore SPI's global variables in SPI_connect() and SPI_finish(). This patch removes two sources of interference between nominally independent functions when one SPI-using function calls another, perhaps without knowing that it does so. Chapman Flack pointed out that xml.c's query_to_xml_int

pgsql: Save/restore SPI's global variables in SPI_connect() and SPI_fin

2018-09-07 Thread Tom Lane
Save/restore SPI's global variables in SPI_connect() and SPI_finish(). This patch removes two sources of interference between nominally independent functions when one SPI-using function calls another, perhaps without knowing that it does so. Chapman Flack pointed out that xml.c's query_to_xml_int

pgsql: Save/restore SPI's global variables in SPI_connect() and SPI_fin

2018-09-07 Thread Tom Lane
Save/restore SPI's global variables in SPI_connect() and SPI_finish(). This patch removes two sources of interference between nominally independent functions when one SPI-using function calls another, perhaps without knowing that it does so. Chapman Flack pointed out that xml.c's query_to_xml_int

pgsql: Save/restore SPI's global variables in SPI_connect() and SPI_fin

2018-09-07 Thread Tom Lane
Save/restore SPI's global variables in SPI_connect() and SPI_finish(). This patch removes two sources of interference between nominally independent functions when one SPI-using function calls another, perhaps without knowing that it does so. Chapman Flack pointed out that xml.c's query_to_xml_int

pgsql: Save/restore SPI's global variables in SPI_connect() and SPI_fin

2018-09-07 Thread Tom Lane
Save/restore SPI's global variables in SPI_connect() and SPI_finish(). This patch removes two sources of interference between nominally independent functions when one SPI-using function calls another, perhaps without knowing that it does so. Chapman Flack pointed out that xml.c's query_to_xml_int

pgsql: Save/restore SPI's global variables in SPI_connect() and SPI_fin

2018-09-07 Thread Tom Lane
Save/restore SPI's global variables in SPI_connect() and SPI_finish(). This patch removes two sources of interference between nominally independent functions when one SPI-using function calls another, perhaps without knowing that it does so. Chapman Flack pointed out that xml.c's query_to_xml_int