pgsql: Add new part SQL/MDA to information_schema.sql_parts

2020-03-30 Thread Peter Eisentraut
Add new part SQL/MDA to information_schema.sql_parts Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a01e1b8b9d937894a916465643d9707861ffb838 Modified Files -- src/backend/catalog/information_schema.sql | 1 + 1 file changed, 1 insertion(+)

pgsql: Improve handling of parameter differences in physical replicatio

2020-03-30 Thread Peter Eisentraut
Improve handling of parameter differences in physical replication When certain parameters are changed on a physical replication primary, this is communicated to standbys using the XLOG_PARAMETER_CHANGE WAL record. The standby then checks whether its own settings are at least as big as the ones on

pgsql: Report waiting via PS while recovery is waiting for buffer pin i

2020-03-30 Thread Fujii Masao
Report waiting via PS while recovery is waiting for buffer pin in hot standby. Previously while the startup process was waiting for the recovery conflict with snapshot, tablespace or lock to be resolved, waiting was reported in PS display, but not in the case of recovery conflict with buffer pin.

pgsql: Attempt to fix unstable regression tests, take 2

2020-03-30 Thread David Rowley
Attempt to fix unstable regression tests, take 2 Following up on 2dc16efed, petalura has suffered some additional failures in stats_ext which again appear to be around the timing of an autovacuum during the test, causing instability in the row estimates. Again, let's fix this by explicitly perfor

Re: pgsql: Improve handling of parameter differences in physical replicatio

2020-03-30 Thread Fujii Masao
On 2020/03/30 16:58, Peter Eisentraut wrote: Improve handling of parameter differences in physical replication When certain parameters are changed on a physical replication primary, this is communicated to standbys using the XLOG_PARAMETER_CHANGE WAL record. The standby then checks whether i

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

2020-03-30 Thread Rémi Zara
> Le 28 mars 2020 à 23:25, Thomas Munro a écrit : > > Hmm, I see that Remi also runs an ancient PowerPC Mac on macOS > 10.5/Darwin 9.8. His build farm animal "locust" hasn't reported in 22 > days. Remi, is that animal down for other reasons, or could it be > stuck like this? Hi, locust is

pgsql: Be more careful about extracting encoding from locale strings on

2020-03-30 Thread Tom Lane
Be more careful about extracting encoding from locale strings on Windows. GetLocaleInfoEx() can fail on strings that setlocale() was perfectly happy with. A common way for that to happen is if the locale string is actually a Unix-style string, say "et_EE.UTF-8". In that case, what's after the do

pgsql: Be more careful about extracting encoding from locale strings on

2020-03-30 Thread Tom Lane
Be more careful about extracting encoding from locale strings on Windows. GetLocaleInfoEx() can fail on strings that setlocale() was perfectly happy with. A common way for that to happen is if the locale string is actually a Unix-style string, say "et_EE.UTF-8". In that case, what's after the do

pgsql: Be more careful about extracting encoding from locale strings on

2020-03-30 Thread Tom Lane
Be more careful about extracting encoding from locale strings on Windows. GetLocaleInfoEx() can fail on strings that setlocale() was perfectly happy with. A common way for that to happen is if the locale string is actually a Unix-style string, say "et_EE.UTF-8". In that case, what's after the do

pgsql: Be more careful about extracting encoding from locale strings on

2020-03-30 Thread Tom Lane
Be more careful about extracting encoding from locale strings on Windows. GetLocaleInfoEx() can fail on strings that setlocale() was perfectly happy with. A common way for that to happen is if the locale string is actually a Unix-style string, say "et_EE.UTF-8". In that case, what's after the do

pgsql: Be more careful about extracting encoding from locale strings on

2020-03-30 Thread Tom Lane
Be more careful about extracting encoding from locale strings on Windows. GetLocaleInfoEx() can fail on strings that setlocale() was perfectly happy with. A common way for that to happen is if the locale string is actually a Unix-style string, say "et_EE.UTF-8". In that case, what's after the do

pgsql: Be more careful about extracting encoding from locale strings on

2020-03-30 Thread Tom Lane
Be more careful about extracting encoding from locale strings on Windows. GetLocaleInfoEx() can fail on strings that setlocale() was perfectly happy with. A common way for that to happen is if the locale string is actually a Unix-style string, say "et_EE.UTF-8". In that case, what's after the do

pgsql: Allow using Unix-domain sockets on Windows in tests

2020-03-30 Thread Peter Eisentraut
Allow using Unix-domain sockets on Windows in tests The test suites currently don't use Unix-domain sockets on Windows. This optionally allows enabling that by setting the environment variable PG_TEST_USE_UNIX_SOCKETS. This should currently be considered experimental. In particular, pg_regress.c

pgsql: Implement operator class parameters

2020-03-30 Thread Alexander Korotkov
Implement operator class parameters PostgreSQL provides set of template index access methods, where opclasses have much freedom in the semantics of indexing. These index AMs are GiST, GIN, SP-GiST and BRIN. There opclasses define representation of keys, operations on them and supported search st

Re: pgsql: Improve handling of parameter differences in physical replicatio

2020-03-30 Thread Andres Freund
Hi, On 2020-03-30 19:41:43 +0900, Fujii Masao wrote: > On 2020/03/30 16:58, Peter Eisentraut wrote: > > Improve handling of parameter differences in physical replication > > > > When certain parameters are changed on a physical replication primary, > > this is communicated to standbys using the X

Re: pgsql: Implement operator class parameters

2020-03-30 Thread Andres Freund
Hi, On 2020-03-30 16:17:53 +, Alexander Korotkov wrote: > Implement operator class parameters > > PostgreSQL provides set of template index access methods, where opclasses have > much freedom in the semantics of indexing. These index AMs are GiST, GIN, > SP-GiST and BRIN. There opclasses de

pgsql: Consistently truncate non-key suffix columns.

2020-03-30 Thread Peter Geoghegan
Consistently truncate non-key suffix columns. INCLUDE indexes failed to have their non-key attributes physically truncated away in certain rare cases. This led to physically larger pivot tuples that contained useless non-key attribute values. The impact on users should be negligible, but this is

pgsql: Consistently truncate non-key suffix columns.

2020-03-30 Thread Peter Geoghegan
Consistently truncate non-key suffix columns. INCLUDE indexes failed to have their non-key attributes physically truncated away in certain rare cases. This led to physically larger pivot tuples that contained useless non-key attribute values. The impact on users should be negligible, but this is

Re: pgsql: Implement operator class parameters

2020-03-30 Thread Alexander Korotkov
On Mon, Mar 30, 2020 at 9:36 PM Andres Freund wrote: > This triggers a few new (harmless) warnings for me: > In file included from /home/andres/src/postgresql/src/include/postgres.h:46, > from > /home/andres/src/postgresql/src/backend/access/index/indexam.c:44: > /home/andres/src

pgsql: Remove rudiments of supporting procnum == 0 from 911e702077

2020-03-30 Thread Alexander Korotkov
Remove rudiments of supporting procnum == 0 from 911e702077 Early versions of opclass options patch uses zero support procedure as opclass options procedure. This commit removes rudiments of it, which were committed in 911e702077. Also, it implements correct handling of amoptsprocnum == 0. Bran

pgsql: Fix missing SP-GiST support in 911e702077

2020-03-30 Thread Alexander Korotkov
Fix missing SP-GiST support in 911e702077 911e702077 misses setting of amoptsprocnum for SP-GiST. This commit fixes that. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/364bdd0b411343747aeca17708ff7817d7fe0b00 Modified Files -- src/backend/access/spgi

pgsql: Deduplicate PageIsNew() check in lazy_scan_heap().

2020-03-30 Thread Andres Freund
Deduplicate PageIsNew() check in lazy_scan_heap(). The recheck isn't needed anymore, as RelationGetBufferForTuple() now extends the relation with RBM_ZERO_AND_LOCK. Previously we needed to handle the fact that relation extension extended the relation and then separately acquired a lock on the page

Re: pgsql: Implement operator class parameters

2020-03-30 Thread Andres Freund
Hi, On 2020-03-30 23:11:06 +0300, Alexander Korotkov wrote: > BTW, what version of compiler (and options) do you use? At the first > glance gcc and clang don't show these warnings to me. In this case it was a snapshot of gcc-10, but I think it'd have been there with older compilers too. The warn

pgsql: Refactor nbtree high key truncation.

2020-03-30 Thread Peter Geoghegan
Refactor nbtree high key truncation. Simplify _bt_truncate(), the routine that generates truncated leaf page high keys. Remove a micro-optimization that avoided a second palloc0() call (this was used when a heap TID was needed in the final pivot tuple, though only when the index happened to not b

pgsql: Revert "Skip redundant anti-wraparound vacuums"

2020-03-30 Thread Michael Paquier
Revert "Skip redundant anti-wraparound vacuums" This reverts commit 2aa6e33, that added a fast path to skip anti-wraparound and non-aggressive autovacuum jobs (these have no sense as anti-wraparound implies aggressive). With a cluster using a high amount of relations with a portion of them being

pgsql: Revert "Skip redundant anti-wraparound vacuums"

2020-03-30 Thread Michael Paquier
Revert "Skip redundant anti-wraparound vacuums" This reverts commit 2aa6e33, that added a fast path to skip anti-wraparound and non-aggressive autovacuum jobs (these have no sense as anti-wraparound implies aggressive). With a cluster using a high amount of relations with a portion of them being

Re: pgsql: Attempt to fix unstable regression tests, take 2

2020-03-30 Thread Tom Lane
David Rowley writes: > Attempt to fix unstable regression tests, take 2 That still isn't working, and I'm starting to think that we're blaming the messenger. To wit, what we are seeing here is that these tests are unstable ... and that's a bug of the tests, not of any adjustments of autovacuum t

pgsql: Further simplify nbtree high key truncation.

2020-03-30 Thread Peter Geoghegan
Further simplify nbtree high key truncation. Commit 7c2dbc69 reorganized _bt_truncate() in a way that enables a further simplification that I (pgeoghegan) missed: Since we mark the tuple that is returned to the caller as a pivot tuple before the point where its heap TID is set as of 7c2dbc69, it

Re: pgsql: Improve handling of parameter differences in physical replicatio

2020-03-30 Thread Fujii Masao
On 2020/03/31 3:10, Andres Freund wrote: Hi, On 2020-03-30 19:41:43 +0900, Fujii Masao wrote: On 2020/03/30 16:58, Peter Eisentraut wrote: Improve handling of parameter differences in physical replication When certain parameters are changed on a physical replication primary, this is commun

Re: pgsql: Attempt to fix unstable regression tests, take 2

2020-03-30 Thread Tom Lane
I wrote: > Specifically, I notice that in the last couple of failures involving > tests on "mcv_lists", we are considering stats on a 5000-row table. > With the standard setting default_statistics_target = 100, ANALYZE > will take a 3000-row random sample, meaning that its results are > *inherently

Re: pgsql: Attempt to fix unstable regression tests, take 2

2020-03-30 Thread Tom Lane
I wrote: > Anyway, I remain suspicious that the instability is the fault > of something in the statistics code, not of autovacuum. I've been trying to reproduce this by dint of running just the stats_ext script, over and over in a loop. I've not had any success on fast machines, but on a slow one

pgsql: Avoid calls to RelationGetRelationName() and RelationGetNamespac

2020-03-30 Thread Amit Kapila
Avoid calls to RelationGetRelationName() and RelationGetNamespace() in vacuum code. After commit b61d161c14, during vacuum, we cache the information of relation name and relation namespace in local structure LVRelStats so that we can use it in an error callback function. We can use the cached inf

pgsql: Update SQL features

2020-03-30 Thread Peter Eisentraut
Update SQL features Set T653 to supported. This has always been possible. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/fc8c3bdde20c4045659f082910cfcbb2b8c9fa4a Modified Files -- src/backend/catalog/sql_features.txt | 2 +- 1 file changed, 1 insertion

pgsql: Move routine definitions of xlogarchive.c to a new header file

2020-03-30 Thread Michael Paquier
Move routine definitions of xlogarchive.c to a new header file The definitions of the routines defined in xlogarchive.c have been part of xlog_internal.h which is included by several frontend tools, but all those routines are only called by the backend. More cleanup could be done within xlog_inte

pgsql: Fix INSERT OVERRIDING USER VALUE behavior

2020-03-30 Thread Peter Eisentraut
Fix INSERT OVERRIDING USER VALUE behavior The original implementation disallowed using OVERRIDING USER VALUE on identity columns defined as GENERATED ALWAYS, which is not per standard. So allow that now. Expand documentation and tests around this. Author: Dean Rasheed Reviewed-by: Peter Eisent