pgsql: Avoid some table rewrites for ALTER TABLE .. SET DATA TYPE times

2019-03-08 Thread Noah Misch
Avoid some table rewrites for ALTER TABLE .. SET DATA TYPE timestamp. When the timezone is UTC, timestamptz and timestamp are binary coercible in both directions. See b8a18ad4850ea5ad7884aa6ab731fd392e73b4ad and c22ecc6562aac895f0f0529707d7bdb460fd2a49 for the previous attempt in this problem spa

pgsql: Tighten use of OpenTransientFile and CloseTransientFile

2019-03-08 Thread Michael Paquier
Tighten use of OpenTransientFile and CloseTransientFile This fixes two sets of issues related to the use of transient files in the backend: 1) OpenTransientFile() has been used in some code paths with read-write flags while read-only is sufficient, so switch those calls to be read-only where neces

Re: pgsql: Fix crash with old libxml2

2019-03-08 Thread Alvaro Herrera
On 2019-Mar-08, Alvaro Herrera wrote: > Fix crash with old libxml2 > > Certain libxml2 versions (such as the 2.7.6 commonly seen in older > distributions, but apparently only on x86_64) contain a bug that causes > xmlCopyNode, when called on a XML_DOCUMENT_NODE, to return a node that > xmlFreeNod

pgsql: Fix crash with old libxml2

2019-03-08 Thread Alvaro Herrera
Fix crash with old libxml2 Certain libxml2 versions (such as the 2.7.6 commonly seen in older distributions, but apparently only on x86_64) contain a bug that causes xmlCopyNode, when called on a XML_DOCUMENT_NODE, to return a node that xmlFreeNode crashes on. Arrange to call xmlFreeDoc instead o

pgsql: Reformat catalog .dat files.

2019-03-08 Thread Tom Lane
Reformat catalog .dat files. Test run for my previous commit; cleans up formatting issues in some other recent commits. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/1b76168da7787505fbe506ef3ab74e9a14b4b7fb Modified Files -- src/include/catalog/pg_cla

pgsql: Minor improvements for reformat_dat_file.pl.

2019-03-08 Thread Tom Lane
Minor improvements for reformat_dat_file.pl. Use Getopt::Long in preference to hand-rolled option parsing code. Also, remove "-I .../backend/catalog" switch from the Makefile invocations. That's been unnecessary for some time, and leaving it there gives the false impression it's needed in manual

Re: pgsql: Fix minor deficiencies in XMLTABLE, xpath(), xmlexists()

2019-03-08 Thread Thomas Munro
On Fri, Mar 8, 2019 at 9:14 PM Thomas Munro wrote: > On Fri, Mar 8, 2019 at 10:20 AM Alvaro Herrera > wrote: > > Fix minor deficiencies in XMLTABLE, xpath(), xmlexists() > > This seems to have caused lapwing and grison to crash: Oh, sorry for the noise, I see this was already discussed elsewher

Re: pgsql: Fix minor deficiencies in XMLTABLE, xpath(), xmlexists()

2019-03-08 Thread Thomas Munro
On Fri, Mar 8, 2019 at 10:20 AM Alvaro Herrera wrote: > Fix minor deficiencies in XMLTABLE, xpath(), xmlexists() This seems to have caused lapwing and grison to crash: xml ... FAILED (test process exited with exit code 2)15590 ms Program terminated with signal