Re: POC: postgres_fdw insert batching

2021-02-17 Thread Amit Langote
On Thu, Feb 18, 2021 at 4:36 AM Tomas Vondra wrote: > On 2/17/21 9:51 AM, Amit Langote wrote: > > On Wed, Feb 17, 2021 at 5:46 PM Amit Langote > > wrote: > >> Sorry, I hadn't shared enough details of my investigations when I > >> originally ran into this. Such as that I had considered

Re: ERROR: "ft1" is of the wrong type.

2021-02-17 Thread Michael Paquier
On Tue, Feb 16, 2021 at 06:14:15PM +0900, Kyotaro Horiguchi wrote: > The attached is just fixing that. I tried to make it generic but > didn't find a clean and translatable way. > > Also I found that only three cases in the function are excecised by > make check. > > ATT_TABLE

Re: adding wait_start column to pg_locks

2021-02-17 Thread torikoshia
On 2021-02-16 16:59, Fujii Masao wrote: On 2021/02/15 15:17, Fujii Masao wrote: On 2021/02/10 10:43, Fujii Masao wrote: On 2021/02/09 23:31, torikoshia wrote: On 2021-02-09 22:54, Fujii Masao wrote: On 2021/02/09 19:11, Fujii Masao wrote: On 2021/02/09 18:13, Fujii Masao wrote: On

Re: Is it worth accepting multiple CRLs?

2021-02-17 Thread Peter Eisentraut
On 2021-02-17 05:05, Kyotaro Horiguchi wrote: The commit fe61df7f82 shot down this. This patch allows a new GUC ssl_crl_dir and a new libpq connection option sslcrldir to specify CRL directory, which stores multiple files that contains one CRL. With that method server loads only CRLs for the CA

Re: pg_collation_actual_version() ERROR: cache lookup failed for collation 123

2021-02-17 Thread Michael Paquier
On Thu, Feb 18, 2021 at 10:45:53AM +1300, Thomas Munro wrote: > I guess I was trying to preserve a distinction between "unknown OID" > and "this is a collation OID, but I don't have version information for > it" (for example, "C.utf8"). But it hardly matters, and your > suggestion works for me.

Re: Asynchronous Append on postgres_fdw nodes.

2021-02-17 Thread Kyotaro Horiguchi
Sorry that I haven't been able to respond. At Thu, 18 Feb 2021 11:51:59 +0900, Etsuro Fujita wrote in > On Wed, Feb 10, 2021 at 9:31 PM Etsuro Fujita wrote: > > Please find attached an updated patch. > > I noticed that this doesn’t work for cases where ForeignScans are > executed inside

Re: A qsort template

2021-02-17 Thread Andres Freund
Hi, On 2021-02-18 16:09:49 +1300, Thomas Munro wrote: > In another thread[1], I proposed $SUBJECT, but then we found a better > solution to that thread's specific problem. The general idea is still > good though: it's possible to (1) replace several existing copies of > our qsort algorithm with

Re: Parallel INSERT (INTO ... SELECT ...)

2021-02-17 Thread Amit Langote
On Thu, Feb 18, 2021 at 10:03 AM Greg Nancarrow wrote: > On Thu, Feb 18, 2021 at 12:34 AM Amit Langote wrote: > > All that is to say that we should move our code to add partition OIDs > > as plan dependencies to somewhere in set_plan_references(), which > > otherwise populates

Re: progress reporting for partitioned REINDEX

2021-02-17 Thread Michael Paquier
On Wed, Feb 17, 2021 at 10:24:37AM -0600, Justin Pryzby wrote: > When we implemented REINDEX of partitioned tables, it should've handled > progress reporting in the fields where that's reported for CREATE INDEX. > Or else we should document that "partitions_total/done are not populated for >

Re: POC: postgres_fdw insert batching

2021-02-17 Thread Amit Langote
On Thu, Feb 18, 2021 at 8:38 AM Tomas Vondra wrote: > On 2/17/21 8:36 PM, Tomas Vondra wrote: > > Thanks. The patch seems reasonable, but it's a bit too large for a fix, > > so I'll go ahead and push one of the previous fixes restricting batching > > to plain INSERT commands. But this seems

RE: Determine parallel-safety of partition relations for Inserts

2021-02-17 Thread Hou, Zhijie
Hi, Attaching v6 patches with the changes: * rebase the code on the greg's latest parallel insert patch. * fix some code comment. * add some test to cover the partitioned table. Please consider it for further review. Best regards, Houzj

A qsort template

2021-02-17 Thread Thomas Munro
Hello, In another thread[1], I proposed $SUBJECT, but then we found a better solution to that thread's specific problem. The general idea is still good though: it's possible to (1) replace several existing copies of our qsort algorithm with one, and (2) make new specialised versions a bit more

Re: Fix typo about WalSndPrepareWrite

2021-02-17 Thread japin
On Thu, 18 Feb 2021 at 02:13, Cary Huang wrote: > The following review has been posted through the commitfest application: > make installcheck-world: tested, passed > Implements feature: tested, passed > Spec compliant: tested, passed > Documentation:tested, passed

Re: Asynchronous Append on postgres_fdw nodes.

2021-02-17 Thread Etsuro Fujita
On Wed, Feb 10, 2021 at 9:31 PM Etsuro Fujita wrote: > Please find attached an updated patch. I noticed that this doesn’t work for cases where ForeignScans are executed inside functions, and I don’t have any simple solution for that. So I’m getting back to what Horiguchi-san proposed for

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-02-17 Thread japin
On Tue, 16 Feb 2021 at 09:58, Bharath Rupireddy wrote: > On Mon, Feb 15, 2021 at 8:13 AM Bharath Rupireddy > wrote: >> >> On Sat, Feb 13, 2021 at 11:41 AM japin wrote: >> > > IIUC, with the current patch, the new ALTER SUBSCRIPTION ... ADD/DROP >> > > errors out on the first publication that

Re: cryptohash: missing locking functions for OpenSSL <= 1.0.2?

2021-02-17 Thread Michael Paquier
On Wed, Feb 17, 2021 at 06:34:36PM +, Jacob Champion wrote: > This would only affect threaded libpq clients running OpenSSL 1.0.2 and > below, and it looks like the most likely code path to be affected is > the OpenSSL error stack. So if anything went wrong with one of those > hash calls, it's

Re: Parallel INSERT (INTO ... SELECT ...)

2021-02-17 Thread Greg Nancarrow
On Thu, Feb 18, 2021 at 12:34 AM Amit Langote wrote: > > > Your revised version seems OK, though I do have a concern: > > Is the use of "table_close(rel, NoLock)'' intentional? That will keep > > the lock (lockmode) until end-of-transaction. > > I think we always keep any locks on relations that

Re: [PATCH] pg_hba.conf error messages for logical replication connections

2021-02-17 Thread Euler Taveira
On Wed, Feb 17, 2021, at 8:01 AM, Amit Kapila wrote: > Before fix > ERROR: could not connect to the publisher: connection to server at > "localhost" (::1), port 5432 failed: FATAL: pg_hba.conf rejects > replication connection for host "::1", user "KapilaAm", no encryption > > After fix error: >

Re: Finding cause of test fails on the cfbot site

2021-02-17 Thread Peter Smith
On Thu, Feb 18, 2021 at 9:55 AM Thomas Munro wrote: > > On Thu, Feb 18, 2021 at 9:42 AM Thomas Munro wrote: > > ... (there have been a few random terminations I can't explain > > recently, but they look different, I think there was a Google Compute > > Engine outage that might explain that), ...

Re: POC: postgres_fdw insert batching

2021-02-17 Thread Tomas Vondra
On 2/17/21 8:36 PM, Tomas Vondra wrote: > > ... > > Thanks. The patch seems reasonable, but it's a bit too large for a fix, > so I'll go ahead and push one of the previous fixes restricting batching > to plain INSERT commands. But this seems useful, so I suggest adding it > to the next

Re: Finding cause of test fails on the cfbot site

2021-02-17 Thread Thomas Munro
On Thu, Feb 18, 2021 at 9:42 AM Thomas Munro wrote: > ... (there have been a few random terminations I can't explain > recently, but they look different, I think there was a Google Compute > Engine outage that might explain that), ... There's also occasionally a failure like this[1], on FreeBSD

Re: new heapcheck contrib module

2021-02-17 Thread Robert Haas
On Wed, Feb 17, 2021 at 1:46 PM Mark Dilger wrote: > Reworking the code took a while. Version 39 patches attached. Regarding the documentation, I think the Usage section at the top is far too extensive and duplicates the option description section to far too great an extent. You have 21 usage

Re: Support for NSS as a libpq TLS backend

2021-02-17 Thread Jacob Champion
On Wed, 2021-02-17 at 22:19 +0100, Daniel Gustafsson wrote: > > On 17 Feb 2021, at 02:02, Jacob Champion wrote: > > Would that be desirable, or do we want this interface to be something > > more generally compatible with (some as-of-yet unspecified) spec? > > Regardless of approach taken I think

Re: pg_collation_actual_version() ERROR: cache lookup failed for collation 123

2021-02-17 Thread Thomas Munro
On Wed, Feb 17, 2021 at 8:04 PM Michael Paquier wrote: > On Wed, Feb 17, 2021 at 03:08:36PM +1300, Thomas Munro wrote: > > tp = SearchSysCache1(COLLOID, ObjectIdGetDatum(oid)); > > if (!HeapTupleIsValid(tp)) > > + { > > + if (found) > >

Re: Support for NSS as a libpq TLS backend

2021-02-17 Thread Daniel Gustafsson
> On 17 Feb 2021, at 02:02, Jacob Champion wrote: > On Mon, 2020-07-20 at 15:35 +0200, Daniel Gustafsson wrote: >> This version adds support for sslinfo on NSS for most the functions. > > I've poked around to see what can be done about the > unimplemented ssl_client_dn_field/ssl_issuer_field

Re: Some regular-expression performance hacking

2021-02-17 Thread Tom Lane
"Joel Jacobson" writes: > I've tested all 4 patches successfully. Thanks! I found one other area that could be improved with the same idea of getting rid of unnecessary subre's: right now, every pair of capturing parentheses gives rise to a "capture" subre with an NFA identical to its single

Re: Tid scan improvements

2021-02-17 Thread David Rowley
Thanks for having a look at this. On Wed, 17 Feb 2021 at 11:05, Andres Freund wrote: > > On 2021-02-04 23:51:39 +1300, David Rowley wrote: > > and > > bool (*scan_tid_range_nextslot) (TableScanDesc sscan, > > ScanDirection direction, > > TupleTableSlot *slot); > > > > I added an additional

Re: new heapcheck contrib module

2021-02-17 Thread Robert Haas
On Wed, Feb 17, 2021 at 1:46 PM Mark Dilger wrote: > It will reconnect and retry a command one time on error. That should cover > the case that the connection to the database was merely lost. If the second > attempt also fails, no further retry of the same command is attempted, though >

Re: Finding cause of test fails on the cfbot site

2021-02-17 Thread Thomas Munro
On Thu, Feb 18, 2021 at 9:18 AM Andrew Dunstan wrote: > On 2/17/21 11:06 AM, Tom Lane wrote: > > Peter Smith writes: > >> I saw that one of our commitfest entries (32/2914) is recently > >> reporting a fail on the cfbot site [1]. I thought this was all ok a > >> few days ago. > >> ... > >> Is

Re: documentation fix for SET ROLE

2021-02-17 Thread Bossart, Nathan
On 2/17/21, 12:15 PM, "Joe Conway" wrote: > On 2/17/21 2:12 PM, David G. Johnston wrote: >> On Wednesday, February 17, 2021, Bossart, Nathan > > wrote: >> >> >> postgres=# ALTER ROLE test1 SET ROLE test2; >> ALTER ROLE >> >> >> I would not have

Re: Finding cause of test fails on the cfbot site

2021-02-17 Thread Andrew Dunstan
On 2/17/21 11:06 AM, Tom Lane wrote: > Peter Smith writes: >> I saw that one of our commitfest entries (32/2914) is recently >> reporting a fail on the cfbot site [1]. I thought this was all ok a >> few days ago. >> ... >> Is there any other detailed information available anywhere, e.g. >>

Re: documentation fix for SET ROLE

2021-02-17 Thread Joe Conway
On 2/17/21 2:12 PM, David G. Johnston wrote: > On Wednesday, February 17, 2021, Bossart, Nathan > wrote: > > >     postgres=# ALTER ROLE test1 SET ROLE test2; >     ALTER ROLE > > > I would not have expected this to work - “role” isn’t a >

Re: POC: postgres_fdw insert batching

2021-02-17 Thread Tomas Vondra
On 2/17/21 9:51 AM, Amit Langote wrote: > On Wed, Feb 17, 2021 at 5:46 PM Amit Langote wrote: >> On Wed, Feb 17, 2021 at 12:04 AM Tomas Vondra >> wrote: >>> On 2/16/21 10:25 AM, Amit Langote wrote: On Tue, Feb 16, 2021 at 1:36 AM Tomas Vondra > Thanks for the patch, it seems fine to me.

Re: documentation fix for SET ROLE

2021-02-17 Thread David G. Johnston
On Wednesday, February 17, 2021, Bossart, Nathan wrote: > > postgres=# ALTER ROLE test1 SET ROLE test2; > ALTER ROLE > I would not have expected this to work - “role” isn’t a configuration_parameter. Its actually cool that it does, but this doc fix should address this oversight as

documentation fix for SET ROLE

2021-02-17 Thread Bossart, Nathan
Hi hackers, I noticed some interesting role behavior that seems to be either a bug or a miss in the documentation. The documentation for SET ROLE claims that RESET ROLE resets "the current user identifier to be the current session user identifier" [0], but this doesn't seem to hold true when

cryptohash: missing locking functions for OpenSSL <= 1.0.2?

2021-02-17 Thread Jacob Champion
While reviewing the NSS patch [1], I noticed that the cryptohash implementation for OpenSSL doesn't set up any locking callbacks in frontend code. I think there has to be a call to OPENSSL_set_locking_callback() before libpq starts reaching into the EVP_* API, if ENABLE_THREAD_SAFETY and

Re: Fix typo about WalSndPrepareWrite

2021-02-17 Thread Cary Huang
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Hi, thanks for the patch, however I don't think it is a

Re: progress reporting for partitioned REINDEX

2021-02-17 Thread Justin Pryzby
On Wed, Feb 17, 2021 at 03:36:20PM +0900, Michael Paquier wrote: > On Wed, Feb 17, 2021 at 12:10:43AM -0600, Justin Pryzby wrote: > > On Wed, Feb 17, 2021 at 02:55:04PM +0900, Michael Paquier wrote: > >> I see no bug here. > > > > pg_stat_progress_create_index includes partitions_{done,total} for

Re: Finding cause of test fails on the cfbot site

2021-02-17 Thread Tom Lane
Peter Smith writes: > I saw that one of our commitfest entries (32/2914) is recently > reporting a fail on the cfbot site [1]. I thought this was all ok a > few days ago. > ... > Is there any other detailed information available anywhere, e.g. > logs?, which might help us work out what was the

Re: Parallel INSERT (INTO ... SELECT ...)

2021-02-17 Thread Amit Langote
On Wed, Feb 17, 2021 at 10:44 AM Greg Nancarrow wrote: > On Wed, Feb 17, 2021 at 12:19 AM Amit Langote wrote: > > On Mon, Feb 15, 2021 at 4:39 PM Greg Nancarrow wrote: > > > On Sat, Feb 13, 2021 at 12:17 AM Amit Langote > > > wrote: > > > > On Thu, Feb 11, 2021 at 4:43 PM Greg Nancarrow > >

Re: [PATCH] pg_hba.conf error messages for logical replication connections

2021-02-17 Thread Amit Kapila
On Tue, Feb 16, 2021 at 10:40 PM Paul Martinez wrote: > > On Tue, Feb 16, 2021 at 2:22 AM Amit Kapila wrote: > > > > I don't think we need to update the error messages, it makes the code > > a bit difficult to parse without much benefit. How about just adding > > errdetail? See attached and let

Finding cause of test fails on the cfbot site

2021-02-17 Thread Peter Smith
Hi - I saw that one of our commitfest entries (32/2914) is recently reporting a fail on the cfbot site [1]. I thought this was all ok a few days ago. We can see the test log indicating what was the test that failed [2] Test Summary Report --- t/002_twophase_streaming.pl (Wstat:

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-02-17 Thread Mark Rofail
Hey Joel, I will now proceed with the review of fk_arrays_elem_v2 as well. > Great work!! /Mark >

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-02-17 Thread Joel Jacobson
Hi all, On Tue, Feb 16, 2021, at 11:07, Mark Rofail wrote: >Changelog: >- anyarray_anyelement_operators-v4 (compatible with current master 2021-02-16, >>commit f672df5fdd22dac14c98d0a0bf5bbaa6ab17f8a5) >* revert anycompatiblenonarray in docs to anyelement Good. I've marked

Re: GSoC 2017: Foreign Key Arrays

2021-02-17 Thread Joel Jacobson
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed I've tested and reviewed

Re: [PoC] Non-volatile WAL buffer

2021-02-17 Thread Takashi Menjo
Hi Sawada, Thank you for your performance report. First, I'd say that the latest v5 non-volatile WAL buffer patchset looks not bad itself. I made a performance test for the v5 and got better performance than the original (non-patched) one and our previous work. See the attached figure for

Re: POC: postgres_fdw insert batching

2021-02-17 Thread Amit Langote
On Wed, Feb 17, 2021 at 5:46 PM Amit Langote wrote: > On Wed, Feb 17, 2021 at 12:04 AM Tomas Vondra > wrote: > > On 2/16/21 10:25 AM, Amit Langote wrote: > > > On Tue, Feb 16, 2021 at 1:36 AM Tomas Vondra > > >> Thanks for the patch, it seems fine to me. > > > > > > Thanks for checking. > > > >

Re: A reloption for partitioned tables - parallel_workers

2021-02-17 Thread Amit Langote
On Tue, Feb 16, 2021 at 11:02 PM Laurenz Albe wrote: > On Tue, 2021-02-16 at 16:29 +0900, Amit Langote wrote: > > > I am +1 on allowing to override the degree of parallelism on a parallel > > > append. If "parallel_workers" on the partitioned table is an option for > > > that, it might be a