pgsql: Allow pg_class xid & multixid horizons to not be set.

2019-04-23 Thread Andres Freund
Allow pg_class xid & multixid horizons to not be set. This allows table AMs that don't need these horizons. This was already documented in the tableam relation_set_new_filenode callback, but an assert prevented if from actually working (the test AM code contained the change itself). Defang the ass

pgsql: Fix detection of passwords hashed with MD5

2019-04-23 Thread Michael Paquier
Fix detection of passwords hashed with MD5 This commit fixes an issue related to the way password verifiers hashed with MD5 are detected, leading to possibly detect that plain passwords are legit MD5 hashes. A MD5-hashed entry was checked based on if its header uses "md5" and if the string length

pgsql: Fix detection of passwords hashed with MD5

2019-04-23 Thread Michael Paquier
Fix detection of passwords hashed with MD5 This commit fixes an issue related to the way password verifiers hashed with MD5 are detected, leading to possibly detect that plain passwords are legit MD5 hashes. A MD5-hashed entry was checked based on if its header uses "md5" and if the string length

pgsql: Fix detection of passwords hashed with MD5

2019-04-23 Thread Michael Paquier
Fix detection of passwords hashed with MD5 This commit fixes an issue related to the way password verifiers hashed with MD5 are detected, leading to possibly detect that plain passwords are legit MD5 hashes. A MD5-hashed entry was checked based on if its header uses "md5" and if the string length

pgsql: Repair assorted issues in locale data extraction.

2019-04-23 Thread Tom Lane
Repair assorted issues in locale data extraction. cache_locale_time (extraction of LC_TIME-related info) had never been taught the lessons we previously learned about extraction of info related to LC_MONETARY and LC_NUMERIC. Specifically, commit 95a777c61 taught PGLC_localeconv() that data coming

pgsql: Repair assorted issues in locale data extraction.

2019-04-23 Thread Tom Lane
Repair assorted issues in locale data extraction. cache_locale_time (extraction of LC_TIME-related info) had never been taught the lessons we previously learned about extraction of info related to LC_MONETARY and LC_NUMERIC. Specifically, commit 95a777c61 taught PGLC_localeconv() that data coming

pgsql: Repair assorted issues in locale data extraction.

2019-04-23 Thread Tom Lane
Repair assorted issues in locale data extraction. cache_locale_time (extraction of LC_TIME-related info) had never been taught the lessons we previously learned about extraction of info related to LC_MONETARY and LC_NUMERIC. Specifically, commit 95a777c61 taught PGLC_localeconv() that data coming

pgsql: Repair assorted issues in locale data extraction.

2019-04-23 Thread Tom Lane
Repair assorted issues in locale data extraction. cache_locale_time (extraction of LC_TIME-related info) had never been taught the lessons we previously learned about extraction of info related to LC_MONETARY and LC_NUMERIC. Specifically, commit 95a777c61 taught PGLC_localeconv() that data coming

pgsql: Repair assorted issues in locale data extraction.

2019-04-23 Thread Tom Lane
Repair assorted issues in locale data extraction. cache_locale_time (extraction of LC_TIME-related info) had never been taught the lessons we previously learned about extraction of info related to LC_MONETARY and LC_NUMERIC. Specifically, commit 95a777c61 taught PGLC_localeconv() that data coming

pgsql: Repair assorted issues in locale data extraction.

2019-04-23 Thread Tom Lane
Repair assorted issues in locale data extraction. cache_locale_time (extraction of LC_TIME-related info) had never been taught the lessons we previously learned about extraction of info related to LC_MONETARY and LC_NUMERIC. Specifically, commit 95a777c61 taught PGLC_localeconv() that data coming

pgsql: Remove useless comment.

2019-04-23 Thread Tom Lane
Remove useless comment. Commit e439c6f0c removed IndexStmt.relationId, but not the comment that had been added to explain it. Said comment was therefore very confusing. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/e0fb4c9d013f8c3f6eb31c5fb991e24b4af6dbb1 Modifi

pgsql: Prevent O(N^2) unique index insertion edge case.

2019-04-23 Thread Peter Geoghegan
Prevent O(N^2) unique index insertion edge case. Commit dd299df8 made nbtree treat heap TID as a tiebreaker column, establishing the principle that there is only one correct location (page and page offset number) for every index tuple, no matter what. Insertions of tuples into non-unique indexes p

pgsql: Avoid order-of-execution problems with ALTER TABLE ADD PRIMARY K

2019-04-23 Thread Tom Lane
Avoid order-of-execution problems with ALTER TABLE ADD PRIMARY KEY. Up to now, DefineIndex() was responsible for adding attnotnull constraints to the columns of a primary key, in any case where it hadn't been convenient for transformIndexConstraint() to mark those columns as is_not_null. It (or r

pgsql: Don't request pretty-printed output from xmlNodeDump().

2019-04-23 Thread Tom Lane
Don't request pretty-printed output from xmlNodeDump(). xml.c passed format = 1 to xmlNodeDump(), resulting in sometimes getting extra whitespace (newlines + spaces) in the output. We don't really want that, first because whitespace might be semantically significant in some XML uses, and second b

Re: pgsql: Allow insert and update tuple routing and COPY for foreign table

2019-04-23 Thread Amit Langote
On 2019/04/22 21:45, Etsuro Fujita wrote: > (2019/04/20 20:53), Laurenz Albe wrote: >> I propose that PostgreSQL only allows COPY FROM on a foreign table if >> the FDW >> implements BeginForeignInsert.  The attached patch implements that. > > I don't think that is a good idea, because there might