pgsql: Fix regression test failure caused by commit 8d74fc96db.

2021-11-30 Thread Amit Kapila
Fix regression test failure caused by commit 8d74fc96db. The tests didn't considered that an error unrelated to apply changes, e.g. "replication origin with OID %d is already active ...", could occur on the table sync worker before starting to copy changes. To make the test robust we instead need

Re: pgsql: Add TAP tests for contrib/sslinfo

2021-11-30 Thread Michael Paquier
On Tue, Nov 30, 2021 at 11:34:21PM -0500, Tom Lane wrote: > Daniel Gustafsson writes: > > Oh, interesting, I hadn't realized that. I'll go do that instead then. > > ... okay, so all we learned is that it really is an ENOENT failure. > > At this point my guess is that the test is copying the key

pgsql: Doc: Add "Attach Partition" limitation during logical replicatio

2021-11-30 Thread Amit Kapila
Doc: Add "Attach Partition" limitation during logical replication. ATTACHing a table into a partition tree whose root is published using a publication with publish_via_partition_root set to true does not result in the table's existing contents being replicated. This happens because subscriber does

pgsql: Doc: Add "Attach Partition" limitation during logical replicatio

2021-11-30 Thread Amit Kapila
Doc: Add "Attach Partition" limitation during logical replication. ATTACHing a table into a partition tree whose root is published using a publication with publish_via_partition_root set to true does not result in the table's existing contents being replicated. This happens because subscriber does

pgsql: Doc: Add "Attach Partition" limitation during logical replicatio

2021-11-30 Thread Amit Kapila
Doc: Add "Attach Partition" limitation during logical replication. ATTACHing a table into a partition tree whose root is published using a publication with publish_via_partition_root set to true does not result in the table's existing contents being replicated. This happens because subscriber does

Re: pgsql: Add TAP tests for contrib/sslinfo

2021-11-30 Thread Tom Lane
Daniel Gustafsson writes: > Oh, interesting, I hadn't realized that. I'll go do that instead then. ... okay, so all we learned is that it really is an ENOENT failure. At this point my guess is that the test is copying the key file to the wrong place because of an MSys path issue. I don't know t

pgsql: Improve psql tab completion for various DROP commands

2021-11-30 Thread Michael Paquier
Improve psql tab completion for various DROP commands The following improvements are done: - Handling of RESTRICT/CASCADE for DROP OWNED, matviews and policies. - Handling of DROP TRANSFORM This is a continuation of the work done in 0cd6d3b and f44ceb4. Author: Ken Kato Reviewed-by: Asif Rehman

pgsql: Extend the private key stat checking error handling

2021-11-30 Thread Daniel Gustafsson
Extend the private key stat checking error handling If the stat operation on the private key failed, the code assumed it was due to an ENOENT, which may or may not be true. Extend the check by printing a different error message on non-ENOENT errors for easier debugging. Per suggestion by Tom Lane

pgsql: Cope with cross-compiling when checking for a random-number sour

2021-11-30 Thread Tom Lane
Cope with cross-compiling when checking for a random-number source. Commit 16f96c74d neglected to consider the possibility of cross-compiling, causing cross-compiles to fail at the configure stage unless you'd selected --with-openssl. Since we're now more or less assuming that /dev/urandom is ava

pgsql: Cope with cross-compiling when checking for a random-number sour

2021-11-30 Thread Tom Lane
Cope with cross-compiling when checking for a random-number source. Commit 16f96c74d neglected to consider the possibility of cross-compiling, causing cross-compiles to fail at the configure stage unless you'd selected --with-openssl. Since we're now more or less assuming that /dev/urandom is ava

Re: pgsql: Add TAP tests for contrib/sslinfo

2021-11-30 Thread Daniel Gustafsson
> On 30 Nov 2021, at 22:36, Tom Lane wrote: > > Daniel Gustafsson writes: >> That seems like a change worthy of doing regardless, so +1 on trying this. >> We >> can't use %m in frontend though can we? > > Yes we can, since v12 or whenever we started using our own snprintf always. Oh, interes

Re: pgsql: Add TAP tests for contrib/sslinfo

2021-11-30 Thread Tom Lane
Daniel Gustafsson writes: > That seems like a change worthy of doing regardless, so +1 on trying this. We > can't use %m in frontend though can we? Yes we can, since v12 or whenever we started using our own snprintf always. regards, tom lane

Re: pgsql: Add TAP tests for contrib/sslinfo

2021-11-30 Thread Daniel Gustafsson
> On 30 Nov 2021, at 21:55, Tom Lane wrote: > > Daniel Gustafsson writes: >> Scratch that, all the copying for tests 001 through 003 had failed. I >> clearly >> need another coffee. >> The question still stands though, does anyone have any ideas on what could've >> happened as I'm currently dr

Re: pgsql: Add TAP tests for contrib/sslinfo

2021-11-30 Thread Tom Lane
Daniel Gustafsson writes: > Scratch that, all the copying for tests 001 through 003 had failed. I clearly > need another coffee. > The question still stands though, does anyone have any ideas on what could've > happened as I'm currently drawing a blank? Dunno, but it strikes me that the libpq co

Re: pgsql: Update high level vacuumlazy.c comments.

2021-11-30 Thread Peter Geoghegan
On Tue, Nov 30, 2021 at 12:20 PM Robert Haas wrote: > +1. And that shouldn't happen often. Why shouldn't it happen often? I accept that I ought to have included a discussion link in this instance. But I don't see how that's related to how often I commit things where including a discussion link i

Re: pgsql: Update high level vacuumlazy.c comments.

2021-11-30 Thread Robert Haas
On Tue, Nov 30, 2021 at 9:41 AM Alvaro Herrera wrote: > I think the only reason not to include a discussion link in the commit > message is that the patch is so trivial that there *is* no related post > in the mailing list. +1. And that shouldn't happen often. -- Robert Haas EDB: http://www.ent

pgsql: vacuumlazy.c: fix remaining "dead tuple" references.

2021-11-30 Thread Peter Geoghegan
vacuumlazy.c: fix remaining "dead tuple" references. Oversight in commit 4f8d9d12. Reported-By: Masahiko Sawada Discussion: https://postgr.es/m/cad21aodm38em0bvrqeqkr4hpvoj65y8cugcp4idmk39ialr...@mail.gmail.com Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4bdf

pgsql: Ignore BRIN indexes when checking for HOT udpates

2021-11-30 Thread Tomas Vondra
Ignore BRIN indexes when checking for HOT udpates When determining whether an index update may be skipped by using HOT, we can ignore attributes indexed only by BRIN indexes. There are no index pointers to individual tuples in BRIN, and the page range summary will be updated anyway as it relies on

pgsql: Increase size of shared memory for pg_commit_ts

2021-11-30 Thread Alvaro Herrera
Increase size of shared memory for pg_commit_ts Like 5364b357fb11 did for pg_commit, change the formula used to determine number of pg_commit_ts buffers, which helps performance with larger servers. Discussion: https://postgr.es/m/[email protected] Reviewed-by: Noah Misch Rev

Re: pgsql: Add TAP tests for contrib/sslinfo

2021-11-30 Thread Daniel Gustafsson
> On 30 Nov 2021, at 17:40, Daniel Gustafsson wrote: > >> On 30 Nov 2021, at 11:50, Daniel Gustafsson >> wrote: >> >> Add TAP tests for contrib/sslinfo > > This just failed on fairywren with the below: > > not ok 1 - certificate authorization succeeds with correct client cert in > PEM form

Re: pgsql: Add TAP tests for contrib/sslinfo

2021-11-30 Thread Daniel Gustafsson
> On 30 Nov 2021, at 11:50, Daniel Gustafsson > wrote: > > Add TAP tests for contrib/sslinfo This just failed on fairywren with the below: not ok 1 - certificate authorization succeeds with correct client cert in PEM format # Failed test 'certificate authorization succeeds with correct

Re: pgsql: Update high level vacuumlazy.c comments.

2021-11-30 Thread Alvaro Herrera
On 2021-Nov-29, Peter Geoghegan wrote: > This was a piece of the patch I posted here, which was discussed in > general terms: > > https://postgr.es/m/cah2-wzktgbg4si6dedmq3q6soxsdqni6mtmb8cmmtmvhsxd...@mail.gmail.com > > I found it useful to spin off the parts that reworked the high level > comm

pgsql: Disable unused-variable warning C4101 in MSVC

2021-11-30 Thread Daniel Gustafsson
Disable unused-variable warning C4101 in MSVC The C4101 warning for unused variable cannot be individually suppressed with PG_USED_FOR_ASSERTS_ONLY, and thus cause false-positive warnings for variables which are defined but only read/written in an assertion. Until a satisfactory solution for per-v

pgsql: Remove PF_USED_FOR_ASSERTS_ONLY from variables in general use

2021-11-30 Thread Daniel Gustafsson
Remove PF_USED_FOR_ASSERTS_ONLY from variables in general use fsstate in process_pending_requests (in postgres_fdw.c) was added in 8998e3cafa2 as an assertion-only variable, 1ec7fca8592 stated using the variable outside of assertions. rd_index in get_index_column_opclass (in lsyscache.c) was int

pgsql: Extend configure_test_server_for_ssl to add extensions

2021-11-30 Thread Daniel Gustafsson
Extend configure_test_server_for_ssl to add extensions In order to be able to test extensions with SSL connections, allow configure_test_server_for_ssl to create any extensions passed as an array. Each extension is created in all the test databases. Reviewed-by: Tom Lane Reviewed-by: Andrew Duns

pgsql: Add TAP tests for contrib/sslinfo

2021-11-30 Thread Daniel Gustafsson
Add TAP tests for contrib/sslinfo This adds rudimentary coverage of the sslinfo extension into the SSL test harness. The output is validated by comparing with pg_stat_ssl to provide some level of test stability should the underlying certs be slightly altered. A new cert is added to provide an ex

pgsql: Use test-specific temp path for keys during SSL test

2021-11-30 Thread Daniel Gustafsson
Use test-specific temp path for keys during SSL test The SSL and SCRAM TAP test suites both use temporary copies of the supplied test keys in order to ensure correct permissions. These were however copied inside the tree using temporary filenames rather than a true temporary folder. Fix by using

Re: pgsql: Add a view to show the stats of subscription workers.

2021-11-30 Thread Amit Kapila
On Tue, Nov 30, 2021 at 12:46 PM Masahiko Sawada wrote: > > On Tue, Nov 30, 2021 at 3:04 PM Amit Kapila wrote: > > > > On Tue, Nov 30, 2021 at 9:05 AM Amit Kapila wrote: > > > > > > Add a view to show the stats of subscription workers. > > > > > > > sidewinder is showing failure in the test adde

Re: pgsql: Add a view to show the stats of subscription workers.

2021-11-30 Thread Amit Kapila
On Tue, Nov 30, 2021 at 12:46 PM Masahiko Sawada wrote: > > On Tue, Nov 30, 2021 at 3:04 PM Amit Kapila wrote: > > > > FWIW, I'm still not investigating why "replication origin with OID 2 > is already active for PID 23706" occurred. > I think I know why this error occurred. In process 23706 (whi