Re: Use compiler intrinsics for bit ops in hash

2020-04-07 Thread David Rowley
On Wed, 8 Apr 2020 at 15:06, John Naylor wrote: > Looks good to me, marked RFC. Thanks a lot for reviewing those changes. I've now pushed all 3 of the patches. David

Re: 2pc leaks fds

2020-04-07 Thread Michael Paquier
On Tue, Apr 07, 2020 at 05:12:49PM -0700, Andres Freund wrote: > I pushed a fix. While it might not be the best medium/long term fix, it > unbreaks 2PC. Perhaps we should add an open item to track whether we > want to fix this differently? Sounds fine to me. I have updated the open item that we

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-07 Thread Masahiko Sawada
On Wed, 8 Apr 2020 at 14:44, Amit Kapila wrote: > > On Tue, Apr 7, 2020 at 5:17 PM Masahiko Sawada > wrote: > > > > On Tue, 7 Apr 2020 at 18:29, Masahiko Sawada > > wrote: > > > > > > On Tue, 7 Apr 2020 at 17:42, Amit Kapila wrote: > > > > > > > > On Tue, Apr 7, 2020 at 1:30 PM Masahiko Sawada

Re: Transactions involving multiple postgres foreign servers, take 2

2020-04-07 Thread Masahiko Sawada
On Fri, 27 Mar 2020 at 22:06, Muhammad Usama wrote: > > Hi Sawada San, > > I have been further reviewing and testing the transaction involving multiple > server patches. > Overall the patches are working as expected bar a few important exceptions. > So as discussed over the call I have fixed the

Re: Run-time pruning for ModifyTable

2020-04-07 Thread Amit Langote
On Tue, Apr 7, 2020 at 8:52 PM David Rowley wrote: > On Wed, 25 Mar 2020 at 15:37, Amit Langote wrote: > > Actually, I was saying in that email that the update/delete planning > > overhaul being talked about will make the entirety of the > > functionality this patch is adding, which is ModifyTabl

Re: WIP/PoC for parallel backup

2020-04-07 Thread Rajkumar Raghuwanshi
Hi Asif, Thanks for new patches. Patches need to be rebased on head. Getting a failure while applying the 0003 patch. edb@localhost postgresql]$ git apply v11/0003-Parallel-Backup-Backend-Replication-commands.patch error: patch failed: src/backend/storage/ipc/ipci.c:147 error: src/backend/storage

Re: adding partitioned tables to publications

2020-04-07 Thread Amit Langote
On Wed, Apr 8, 2020 at 1:22 AM Amit Langote wrote: > On Tue, Apr 7, 2020 at 6:01 PM Peter Eisentraut > wrote: > > The descriptions of the new fields in RelationSyncEntry don't seem to > > match the code accurately, or at least it's confusing. > > replicate_as_relid is always filled in with an anc

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-07 Thread Amit Kapila
On Tue, Apr 7, 2020 at 5:17 PM Masahiko Sawada wrote: > > On Tue, 7 Apr 2020 at 18:29, Masahiko Sawada > wrote: > > > > On Tue, 7 Apr 2020 at 17:42, Amit Kapila wrote: > > > > > > On Tue, Apr 7, 2020 at 1:30 PM Masahiko Sawada > > > wrote: > > > > > > > > Buffer usage statistics seem correct. T

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-07 Thread Kyotaro Horiguchi
At Wed, 08 Apr 2020 09:37:10 +0900 (JST), Kyotaro Horiguchi wrote in > > I pushed version 26, with a few further adjustments. > > > > I think what we have now is sufficient, but if you want to attempt this > > "invalidated" flag on top of what I pushed, be my guest. > > I don't think the inval

Re: backup manifests

2020-04-07 Thread Fujii Masao
On 2020/04/04 4:22, Robert Haas wrote: On Thu, Apr 2, 2020 at 4:34 PM David Steele wrote: +1. These would be great tests to have and a win for pg_basebackup overall but I don't think they should be a prerequisite for this commit. Not to mention the server. I can't say that I have a lot of c

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2020-04-07 Thread Ashutosh Bapat
Thanks a lot Fujita-san. Thanks Dmitry, Rajkumar, Amul, Mark, Robert, Antonin, Amit, Justin,Thomas and Tomas for all your help and review. On Wed, 8 Apr 2020 at 07:07, Etsuro Fujita wrote: > On Wed, Apr 8, 2020 at 2:24 AM Etsuro Fujita > wrote: > > On Wed, Apr 8, 2020 at 12:15 AM Tomas Vondra >

Re: A problem about partitionwise join

2020-04-07 Thread Richard Guo
On Sun, Apr 5, 2020 at 4:38 AM Tom Lane wrote: > Richard Guo writes: > > Rebased the patch with latest master and also addressed the test case > > failure reported by PostgreSQL Patch Tester. > > I looked this patch over, but I don't like it too much: it seems very > brute-force (and badly under

Re: FETCH FIRST clause WITH TIES option

2020-04-07 Thread Andrew Gierth
> "Alvaro" == Alvaro Herrera writes: >> This needs to be fixed in ruleutils, IMO, not by changing what the >> grammar accepts. Alvaro> Fair. I didn't change what the grammar accepts. I ended up only Alvaro> throwing an error in parse analysis when a bare NULL const is Alvaro> seen. Thi

Re: proposal \gcsv

2020-04-07 Thread Pavel Stehule
út 7. 4. 2020 v 23:47 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > út 7. 4. 2020 v 19:27 odesílatel Tom Lane napsal: > >> Considering this is the last day before v13 feature freeze, should > >> I push this, or sit on it till v14? I feel reasonably good that we > >> have a nice featu

Re: doc review for parallel vacuum

2020-04-07 Thread Amit Kapila
On Tue, Apr 7, 2020 at 10:25 AM Justin Pryzby wrote: > > On Tue, Apr 07, 2020 at 09:57:46AM +0530, Amit Kapila wrote: > > On Mon, Mar 23, 2020 at 10:34 AM Amit Kapila > > wrote: > > > On Sun, Mar 22, 2020 at 7:48 AM Justin Pryzby > > > wrote: > > > > > > > > Original, long thread > > > > https

Re: Internal key management system

2020-04-07 Thread Ahsan Hadi
Hi Bruce/Joe, In the last meeting we discussed the need for improving the documentation for KMS so it is easier to understand the interface. Cary from highgo had a go at doing that, please see the previous email on this thread from Cary and let us know if it looks good...? -- Ahsan On Wed, Apr 8

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-04-07 Thread Tom Lane
hyrax is not too happy with this test: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hyrax&dt=2020-04-07%2004%3A55%3A15 It's not too clear to me why CLOBBER_CACHE_ALWAYS would be breaking EXPLAIN output, but it evidently is. regards, tom lane

Re: FETCH FIRST clause WITH TIES option

2020-04-07 Thread Alvaro Herrera
On 2020-Apr-08, Andrew Gierth wrote: > > "Alvaro" == Alvaro Herrera writes: > > Alvaro> It turns out that the SQL standard is much more limited in what > Alvaro> it will accept there. But our grammar (what we'll accept for > Alvaro> the ancient LIMIT clause) is very lenient -- it'll take

Re: Use compiler intrinsics for bit ops in hash

2020-04-07 Thread John Naylor
On Wed, Apr 8, 2020 at 9:04 AM David Rowley wrote: > [v8] Looks good to me, marked RFC. -- John Naylorhttps://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: WAL usage calculation patch

2020-04-07 Thread Amit Kapila
On Tue, Apr 7, 2020 at 3:30 PM Peter Eisentraut wrote: > > On 2020-04-07 04:12, Amit Kapila wrote: > > On Mon, Apr 6, 2020 at 10:01 PM Justin Pryzby wrote: > >> > >> On Mon, Apr 06, 2020 at 05:01:30PM +0200, Peter Eisentraut wrote: > >>> I noticed in some of the screenshots that were tweeted that

Re: pgsql: Allow users to limit storage reserved by replication slots

2020-04-07 Thread Tom Lane
Alvaro Herrera writes: > However, even with that change, we're still testing that a checkpoint is > 216 bytes ... in other words, whenever someone changes the definition of > struct CheckPoint, this test will fail. That seems unnecessary and > unfriendly. I'm not sure how to improve that without

Re: d25ea01275 and partitionwise join

2020-04-07 Thread Amit Langote
On Wed, Apr 8, 2020 at 11:17 AM Tom Lane wrote: > Amit Langote writes: > > On Tue, Apr 7, 2020 at 2:41 AM Tom Lane wrote: > >> I *think* that it might be all right, because although what we > >> are matching to is a user-written COALESCE() not an actual > >> FULL JOIN USING column, it has to beh

Re: implicit declaration of datumIsEqual in parse_coerce.c

2020-04-07 Thread Tom Lane
Michael Paquier writes: > On Tue, Apr 07, 2020 at 05:16:58PM -0400, Tom Lane wrote: >> That's inside "#ifdef RANDOMIZE_ALLOCATED_MEMORY", which probably >> explains why most of us aren't seeing it. My guess is somebody >> removed an #include without realizing that this chunk of code >> needed it.

Re: d25ea01275 and partitionwise join

2020-04-07 Thread Etsuro Fujita
On Wed, Apr 8, 2020 at 11:17 AM Tom Lane wrote: > But this patch seems to still work, > and the other thing doesn't fix the problem, so pushed. Thanks for working on this! Best regards, Etsuro Fujita

Re: pgsql: Allow users to limit storage reserved by replication slots

2020-04-07 Thread Michael Paquier
On Tue, Apr 07, 2020 at 07:10:07PM -0700, Andres Freund wrote: > I have not looked at the source, but the error messages show LSNs > and bytes. I can't really imagine how that could be made stable. Another bad news is that this is page-size dependent. What if you removed pg_size_pretty() and repl

Re: implicit declaration of datumIsEqual in parse_coerce.c

2020-04-07 Thread Michael Paquier
On Tue, Apr 07, 2020 at 05:16:58PM -0400, Tom Lane wrote: > That's inside "#ifdef RANDOMIZE_ALLOCATED_MEMORY", which probably > explains why most of us aren't seeing it. My guess is somebody > removed an #include without realizing that this chunk of code > needed it. [cough] commit: 4dbcb3f844ec

Re: d25ea01275 and partitionwise join

2020-04-07 Thread Tom Lane
Amit Langote writes: > On Tue, Apr 7, 2020 at 2:41 AM Tom Lane wrote: >> I *think* that it might be all right, because although what we >> are matching to is a user-written COALESCE() not an actual >> FULL JOIN USING column, it has to behave in somewhat the same >> way. In particular, by constru

Re: pgsql: Allow users to limit storage reserved by replication slots

2020-04-07 Thread Andres Freund
Hi, On April 7, 2020 6:13:51 PM PDT, Tom Lane wrote: >Alvaro Herrera writes: >> I fixed the perlcritic complaint from buildfarm member crake, but >> there's a new one in francolin: > >Other buildfarm members are showing related-but-different failures. >I think this test is just plain unstable.

Re: FETCH FIRST clause WITH TIES option

2020-04-07 Thread Andrew Gierth
> "Alvaro" == Alvaro Herrera writes: Alvaro> It turns out that the SQL standard is much more limited in what Alvaro> it will accept there. But our grammar (what we'll accept for Alvaro> the ancient LIMIT clause) is very lenient -- it'll take just Alvaro> any expression. I thought about re

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2020-04-07 Thread Etsuro Fujita
On Wed, Apr 8, 2020 at 2:24 AM Etsuro Fujita wrote: > On Wed, Apr 8, 2020 at 12:15 AM Tomas Vondra > wrote: > > On Mon, Apr 06, 2020 at 05:28:52PM +0900, Etsuro Fujita wrote: > > >On Sat, Apr 4, 2020 at 12:15 AM Etsuro Fujita > > >wrote: > > >> Attached is the original patch (0001) and one patc

Re: pgsql: Allow users to limit storage reserved by replication slots

2020-04-07 Thread Tom Lane
Alvaro Herrera writes: > I fixed the perlcritic complaint from buildfarm member crake, but > there's a new one in francolin: Other buildfarm members are showing related-but-different failures. I think this test is just plain unstable. regards, tom lane

Re: [HACKERS] make async slave to wait for lsn to be replayed

2020-04-07 Thread Kyotaro Horiguchi
At Wed, 8 Apr 2020 02:52:55 +0300, Alexander Korotkov wrote in > On Wed, Apr 8, 2020 at 2:14 AM Kartyshov Ivan > wrote: > > On 2020-04-08 00:27, Tom Lane wrote: > > > Alexander Korotkov writes: > > » WAIT FOR LSN lsn [ TIMEOUT timeout ] > > > > > > This seems like a really carelessly chosen

Re: Use compiler intrinsics for bit ops in hash

2020-04-07 Thread David Rowley
On Wed, 8 Apr 2020 at 01:16, John Naylor wrote: > > On Tue, Apr 7, 2020 at 8:26 PM David Rowley wrote: > > > > Hi John, > > > > Thanks for having a look at this. > > > > On Wed, 8 Apr 2020 at 00:16, John Naylor > > wrote: > > > Overall looks good to me. Just a couple things I see: > > > > > > I

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-04-07 Thread Tomas Vondra
On Tue, Apr 07, 2020 at 12:17:44PM +0530, Amit Kapila wrote: On Mon, Mar 30, 2020 at 8:58 PM Tomas Vondra wrote: On Mon, Mar 30, 2020 at 11:47:57AM +0530, Amit Kapila wrote: > >I think we need to cache the subxids on the replica somehow but I >don't have a very good idea for it. Basically, th

Re: WIP: WAL prefetch (another approach)

2020-04-07 Thread Thomas Munro
On Wed, Apr 8, 2020 at 4:24 AM Thomas Munro wrote: > Thanks for all that feedback. It's been a strange couple of weeks, > but I finally have a new version that addresses most of that feedback > (but punts on a couple of suggestions for later development, due to > lack of time). Here's an executi

Re: FETCH FIRST clause WITH TIES option

2020-04-07 Thread Alvaro Herrera
Hello On 2020-Apr-07, Andres Freund wrote: > On 2020-04-07 16:36:54 -0400, Alvaro Herrera wrote: > > Pushed, with some additional changes. > > This triggers a new warning for me (gcc-10): > /home/andres/src/postgresql/src/backend/executor/nodeLimit.c: In function > ‘ExecLimit’: > /home/andres/s

Re: ERROR: invalid input syntax for type circle

2020-04-07 Thread Tom Lane
David Zhang writes: > Generated a new patch v2 (attached) following your suggestion and > performed the same test again. The test results looks good including the > "make check". Pushed, with some work on the regression tests so this doesn't get busted again. regards, t

Re: FETCH FIRST clause WITH TIES option

2020-04-07 Thread Andres Freund
Hi, On 2020-04-07 16:36:54 -0400, Alvaro Herrera wrote: > Pushed, with some additional changes. This triggers a new warning for me (gcc-10): /home/andres/src/postgresql/src/backend/executor/nodeLimit.c: In function ‘ExecLimit’: /home/andres/src/postgresql/src/backend/executor/nodeLimit.c:136:7:

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-04-07 Thread Tomas Vondra
Hi, I've pushed the second part of this patch series, adding incremental sort to additional places in the planner. As explained in the commit message (and somewhere in this thread) we've decided to only update some of the places that require sorted input (and do create_sort). This might be overly

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-07 Thread Kyotaro Horiguchi
Thank you for committing this. At Tue, 7 Apr 2020 18:45:22 -0400, Alvaro Herrera wrote in > On 2020-Apr-07, Kyotaro Horiguchi wrote: > > > > Mmm. Couldn't we have a new member 'invalidated' in ReplicationSlot? > > > > I did that in the attached. The invalidated is shared-but-not-saved > > mem

Re: Make MemoryContextMemAllocated() more precise

2020-04-07 Thread Jeff Davis
On Mon, 2020-03-16 at 11:45 -0700, Jeff Davis wrote: > AllocSet allocates memory for itself in blocks, which double in size > up > to maxBlockSize. So, the current block (the last one malloc'd) may > represent half of the total memory allocated for the context itself. Narrower approach that doesn'

Re: 2pc leaks fds

2020-04-07 Thread Andres Freund
Hi, I pushed a fix. While it might not be the best medium/long term fix, it unbreaks 2PC. Perhaps we should add an open item to track whether we want to fix this differently? On 2020-04-06 09:12:32 +0200, Antonin Houska wrote: > Andres Freund wrote: > It should have allowed users to have diffe

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-04-07 Thread James Coleman
On Tue, Apr 7, 2020 at 7:58 PM Tomas Vondra wrote: > > On Tue, Apr 07, 2020 at 07:50:26PM -0400, James Coleman wrote: > >On Tue, Apr 7, 2020 at 7:02 PM Tomas Vondra > > wrote: > >> > >> On Mon, Apr 06, 2020 at 11:25:21PM -0500, Justin Pryzby wrote: > >> >On Mon, Apr 06, 2020 at 09:57:22PM +0200, T

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-04-07 Thread Tomas Vondra
On Tue, Apr 07, 2020 at 07:50:26PM -0400, James Coleman wrote: On Tue, Apr 7, 2020 at 7:02 PM Tomas Vondra wrote: On Mon, Apr 06, 2020 at 11:25:21PM -0500, Justin Pryzby wrote: >On Mon, Apr 06, 2020 at 09:57:22PM +0200, Tomas Vondra wrote: >> I've pushed the fist part of this patch series - I'

Re: [HACKERS] make async slave to wait for lsn to be replayed

2020-04-07 Thread Alexander Korotkov
On Wed, Apr 8, 2020 at 2:14 AM Kartyshov Ivan wrote: > On 2020-04-08 00:27, Tom Lane wrote: > > Alexander Korotkov writes: > » WAIT FOR LSN lsn [ TIMEOUT timeout ] > > > > This seems like a really carelessly chosen syntax —- *three* new > > keywords, when you probably didn't need any. Are you

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-04-07 Thread James Coleman
On Tue, Apr 7, 2020 at 7:02 PM Tomas Vondra wrote: > > On Mon, Apr 06, 2020 at 11:25:21PM -0500, Justin Pryzby wrote: > >On Mon, Apr 06, 2020 at 09:57:22PM +0200, Tomas Vondra wrote: > >> I've pushed the fist part of this patch series - I've reorganized it a > > > >I scanned through this again pos

Re: pgsql: Allow users to limit storage reserved by replication slots

2020-04-07 Thread Alvaro Herrera
On 2020-Apr-07, Alvaro Herrera wrote: > src/test/recovery/t/019_replslot_limit.pl | 217 + I fixed the perlcritic complaint from buildfarm member crake, but there's a new one in francolin: # Failed test 'check that the slot state changes to "reserved"' # at t/019_

Re: [HACKERS] make async slave to wait for lsn to be replayed

2020-04-07 Thread Kartyshov Ivan
On 2020-04-08 00:27, Tom Lane wrote: Alexander Korotkov writes: » WAIT FOR LSN lsn [ TIMEOUT timeout ] This seems like a really carelessly chosen syntax —- *three* new keywords, when you probably didn't need any. Are you not aware that there is distributed overhead in the grammar for every

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-04-07 Thread Tomas Vondra
On Mon, Apr 06, 2020 at 11:25:21PM -0500, Justin Pryzby wrote: On Mon, Apr 06, 2020 at 09:57:22PM +0200, Tomas Vondra wrote: I've pushed the fist part of this patch series - I've reorganized it a I scanned through this again post-commit. Find attached some suggestions. Thanks. The typo fix

Re: Using the rr debugging tool to debug Postgres

2020-04-07 Thread Peter Geoghegan
On Tue, Apr 7, 2020 at 3:36 AM Jehan-Guillaume de Rorthais wrote: > Thank you Peter! No problem! I'm just glad that we have a straightforward workflow for this now. -- Peter Geoghegan

Re: WAL usage calculation patch

2020-04-07 Thread Justin Pryzby
On Tue, Apr 07, 2020 at 12:00:29PM +0200, Peter Eisentraut wrote: > We also have existing cases for the other way: > > actual time=0.050..0.052 > Buffers: shared hit=3 dirtied=1 > > The cases mentioned by Justin are not formatted in a key=value format, so > it's not quite the same, but it

Re: Internal key management system

2020-04-07 Thread Cary Huang
Hello Thanks a lot for the patch, I think in terms of functionality, the patch provides very straightforward functionalities regarding key management. In terms of documentation, I think the patch is still lacking some pieces of information that kind of prevent people from fully understanding

Re: [HACKERS] Restricting maximum keep segments by repslots

2020-04-07 Thread Alvaro Herrera
On 2020-Apr-07, Kyotaro Horiguchi wrote: > > Mmm. Couldn't we have a new member 'invalidated' in ReplicationSlot? > > I did that in the attached. The invalidated is shared-but-not-saved > member of a slot and initialized to false then irreversibly changed to > true when the slot loses required se

Re: Default setting for enable_hashagg_disk

2020-04-07 Thread Justin Pryzby
On Tue, Apr 07, 2020 at 11:20:46AM -0700, Jeff Davis wrote: > The enable_hashagg_disk GUC, if set to true, chooses HashAgg based on > costing. If false, it only generates a HashAgg path if it thinks it will fit > in work_mem, similar to the old behavior (though it wlil now spill to disk if > the pl

Re: proposal \gcsv

2020-04-07 Thread Tom Lane
Pavel Stehule writes: > út 7. 4. 2020 v 19:27 odesílatel Tom Lane napsal: >> Considering this is the last day before v13 feature freeze, should >> I push this, or sit on it till v14? I feel reasonably good that we >> have a nice feature definition here, but it's awfully late in the >> cycle to b

Re: implicit declaration of datumIsEqual in parse_coerce.c

2020-04-07 Thread Tom Lane
Tomas Vondra writes: > Not sure what changed, but I'm seeing this failure: > parse_coerce.c: In function ‘coerce_type’: > parse_coerce.c:345:9: warning: implicit declaration of function > ‘datumIsEqual’ [-Wimplicit-function-declaration] >345 |if (!datumIsEqual(newcon->constvalue, val2, f

Re: [HACKERS] make async slave to wait for lsn to be replayed

2020-04-07 Thread Alexander Korotkov
On Tue, Apr 7, 2020 at 10:58 PM Anna Akenteva wrote: > Thank you for your review! > Ivan and I have worked on the patch and tried to address your comments: I've pushed this. I promise to do careful post-commit review and resolve any issues arising. -- Alexander Korotkov Postgres Professiona

implicit declaration of datumIsEqual in parse_coerce.c

2020-04-07 Thread Tomas Vondra
Hi, Not sure what changed, but I'm seeing this failure: parse_coerce.c: In function ‘coerce_type’: parse_coerce.c:345:9: warning: implicit declaration of function ‘datumIsEqual’ [-Wimplicit-function-declaration] 345 |if (!datumIsEqual(newcon->constvalue, val2, false, newcon->constlen))

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-04-07 Thread Justin Pryzby
On Tue, Apr 07, 2020 at 03:40:18PM +0300, Alexey Kondratov wrote: > On 2020-04-06 21:44, Justin Pryzby wrote: > > On Mon, Apr 06, 2020 at 08:43:46PM +0300, Alexey Kondratov wrote: > > > > > > +/* XXX: reusing reindex_option_list */ > > > + | CLUSTER opt_verbose '(' reindex_option_l

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Andres Freund
Hi, On 2020-04-07 16:13:07 -0400, Robert Haas wrote: > On Tue, Apr 7, 2020 at 3:24 PM Andres Freund wrote: > > > + ProcGlobal->xids[pgxactoff] = InvalidTransactionId; > > > > > > Apparently this array is not dense in the sense that it excludes > > > unused slots, but comments elsewhere don't seem

Re: A bug when use get_bit() function for a long bytea string

2020-04-07 Thread Tom Lane
I wrote: > It would be easier to get this done if you had addressed any of the > objections to the patch as given. Integer-overflow handling is still > missing, and you still are assuming that it's okay to change catalog > entries in released branches. Since we are hard upon the feature freeze de

Re: FETCH FIRST clause WITH TIES option

2020-04-07 Thread Alvaro Herrera
Pushed, with some additional changes. So *of course* when I add tests to verify that ruleutils, I find a case that does not work properly -- meaning, you get a view that pg_dump emits in a way that won't be accepted: CREATE VIEW limit_thousand_v_3 AS SELECT thousand FROM onek WHERE thousand < 995

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Andres Freund
Hi, On 2020-04-07 15:26:36 -0400, Robert Haas wrote: > 0008 - > > Here again, I greatly dislike putting Copy in the name. It makes > little sense to pretend that either is the original and the other is > the copy. You just have the same data in two places. If one of them is > more authoritative,

RE: Index Skip Scan

2020-04-07 Thread Floris Van Nee
> > * Suspicious performance difference between different type of workload, > mentioned by Tomas (unfortunately I had no chance yet to investigate). > His benchmark results indeed most likely point to multiple comparisons being done. Since the most likely place where these occur is _bt_readpa

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Robert Haas
On Tue, Apr 7, 2020 at 3:24 PM Andres Freund wrote: > > 0007 - > > > > + TransactionId xidCopy; /* this backend's xid, a copy of this proc's > > +ProcGlobal->xids[] entry. */ > > > > Can we please NOT put Copy into the name like that? Pretty please? > > Do you have a suggested naming scheme? S

Re: BUG #16346: pg_upgrade fails on a trigger with a comment

2020-04-07 Thread Hamid Akhtar
As you have mentioned, I have verified that indeed commit 4c40b27b broke this. In this particular commit moves restoration of materialized views and event triggers to the last phase. Perhaps, comments should also be moved to this phase as there may comments on either of these types of objects. At

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Robert Haas
On Tue, Apr 7, 2020 at 3:31 PM Andres Freund wrote: > Well, it *is* only a vague test :). It shouldn't ever have a false > positive, but there's plenty chance for false negatives (if wrapped > around far enough). Sure, but I think you get my point. Asserting that something "might be" true isn't m

Re: [HACKERS] make async slave to wait for lsn to be replayed

2020-04-07 Thread Anna Akenteva
On 2020-04-07 12:58, Amit Kapila wrote: Review comments: 1. +static void +DeleteEvent(void) I don't see how this is implemented or called to handle any errors. 2. + if (InterruptPending) + { + DeleteEvent(); + ProcessInterrupts(); + } We generally do this type of handling via CHECK_FOR_INTERRUP

Re: Binary support for pgoutput plugin

2020-04-07 Thread Dave Cramer
On Fri, 3 Apr 2020 at 16:44, Dave Cramer wrote: > > > On Fri, 3 Apr 2020 at 03:43, Petr Jelinek wrote: > >> Hi, >> >> On 08/03/2020 00:18, Dave Cramer wrote: >> > On Fri, 6 Mar 2020 at 08:54, Petr Jelinek > > > wrote: >> > >> > Hi Dave, >> > >> > On 29/02/202

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Andres Freund
Hi, On 2020-04-07 15:03:46 -0400, Robert Haas wrote: > On Tue, Apr 7, 2020 at 1:51 PM Andres Freund wrote: > > > ComputedHorizons seems like a fairly generic name. I think there's > > > some relationship between InvisibleToEveryoneState and > > > ComputedHorizons that should be brought out more c

Re: Index Skip Scan

2020-04-07 Thread Dmitry Dolgov
> On Mon, Apr 06, 2020 at 06:31:08PM +, Floris Van Nee wrote: > > > Hm, I wasn't aware about this one, thanks for bringing this up. Btw, > > Floris, I > > would appreciate if in the future you can make it more visible that changes > > you > > suggest contain some fixes. E.g. it wasn't clear f

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Andres Freund
Hi, On 2020-04-07 14:51:52 -0400, Robert Haas wrote: > On Tue, Apr 7, 2020 at 2:28 PM Andres Freund wrote: > > Does that make some sense? Do you have a better suggestion for a name? > > I think it makes sense. I have two basic problems with the name. The > first is that "on disk" doesn't seem to

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Robert Haas
0008 - Here again, I greatly dislike putting Copy in the name. It makes little sense to pretend that either is the original and the other is the copy. You just have the same data in two places. If one of them is more authoritative, the place to explain that is in the comments, not by elongating th

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Andres Freund
Hi, On 2020-04-07 14:28:09 -0400, Robert Haas wrote: > More review, since it sounds like you like it: > > 0006 - Boring. But I'd probably make this move both xmin and xid back, > with related comment changes; see also next comment. > > 0007 - > > + TransactionId xidCopy; /* this backend's xid, a c

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Robert Haas
On Tue, Apr 7, 2020 at 1:51 PM Andres Freund wrote: > > ComputedHorizons seems like a fairly generic name. I think there's > > some relationship between InvisibleToEveryoneState and > > ComputedHorizons that should be brought out more clearly by the naming > > and the comments. > > I don't like th

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Robert Haas
On Tue, Apr 7, 2020 at 2:28 PM Andres Freund wrote: > Does that make some sense? Do you have a better suggestion for a name? I think it makes sense. I have two basic problems with the name. The first is that "on disk" doesn't seem to be a very clear way of describing what you're actually checking

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Peter Geoghegan
On Tue, Apr 7, 2020 at 11:28 AM Andres Freund wrote: > There is a lot of code that is pretty unsafe around wraparounds... They > are getting easier and easier to hit on a regular schedule in production > (plenty of databases that hit wraparounds multiple times a week). And I > don't think we as PG

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Andres Freund
Hi, On 2020-04-07 10:51:12 -0700, Andres Freund wrote: > > +void AssertTransactionIdMayBeOnDisk(TransactionId xid) > > > > Formatting. > > > > + * Assert that xid is one that we could actually see on disk. > > > > I don't know what this means. The whole purpose of this routine is > > very uncle

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Robert Haas
More review, since it sounds like you like it: 0006 - Boring. But I'd probably make this move both xmin and xid back, with related comment changes; see also next comment. 0007 - + TransactionId xidCopy; /* this backend's xid, a copy of this proc's +ProcGlobal->xids[] entry. */ Can we please

Default setting for enable_hashagg_disk

2020-04-07 Thread Jeff Davis
This is just a placeholder thread for an open item that I'm adding to the Open Items list. We can make a decision later. Now that we have Disk-based Hash Aggregation, there are a lot more situations where the planner can choose HashAgg. The enable_hashagg_disk GUC, if set to true, chooses HashAgg

Re: SyncRepLock acquired exclusively in default configuration

2020-04-07 Thread Ashwin Agrawal
On Mon, Apr 6, 2020 at 2:14 PM Andres Freund wrote: > > How about we change it to this ? > > Hm. Better. But I think it might need at least a compiler barrier / > volatile memory load? Unlikely here, but otherwise the compiler could > theoretically just stash the variable somewhere locally (it's

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Andres Freund
Hi, Thanks for the review! On 2020-04-07 12:41:07 -0400, Robert Haas wrote: > In 0002, the comments in SnapshotSet() are virtually incomprehensible. > There's no commit message so the reasons for the changes are unclear. > But mostly looks unproblematic. I was planning to drop that patch pre-co

Re: WIP/PoC for parallel backup

2020-04-07 Thread Robert Haas
On Tue, Apr 7, 2020 at 1:25 PM Asif Rehman wrote: > I will, however parallel backup is already quite a large patch. So I think we > should first > agree on the current work before adding a backup manifest and > progress-reporting support. It's going to be needed for commit, but it may make sens

Re: WIP/PoC for parallel backup

2020-04-07 Thread Robert Haas
On Fri, Apr 3, 2020 at 4:46 AM Asif Rehman wrote: > Non-parallel backup already does the early error checking. I only intended > to make parallel behave the same as non-parallel here. So, I agree with > you that the behavior of parallel backup should be consistent with the > non-parallel one. Ple

Re: proposal \gcsv

2020-04-07 Thread Pavel Stehule
út 7. 4. 2020 v 19:27 odesílatel Tom Lane napsal: > Here's a more fully fleshed-out patch, with documentation and some > test cases. (0001 patch is identical to last time.) > > Considering this is the last day before v13 feature freeze, should > I push this, or sit on it till v14? I feel reason

Re: SLRU statistics

2020-04-07 Thread Tomas Vondra
On Tue, Apr 07, 2020 at 05:01:37PM +0530, Kuntal Ghosh wrote: Hello Tomas, On Thu, Apr 2, 2020 at 5:59 PM Tomas Vondra wrote: Thank you for the patch, pushed. In SimpleLruReadPage_ReadOnly, we first try to find the SLRU page in shared buffer under shared lock, then conditionally visit Simple

Re: proposal \gcsv

2020-04-07 Thread Tom Lane
Here's a more fully fleshed-out patch, with documentation and some test cases. (0001 patch is identical to last time.) Considering this is the last day before v13 feature freeze, should I push this, or sit on it till v14? I feel reasonably good that we have a nice feature definition here, but it

Re: WIP/PoC for parallel backup

2020-04-07 Thread Asif Rehman
On Tue, Apr 7, 2020 at 10:03 PM Jeevan Chalke < jeevan.cha...@enterprisedb.com> wrote: > > > On Tue, Apr 7, 2020 at 10:14 PM Asif Rehman > wrote: > >> Hi, >> >> Thanks, Kashif and Rajkumar. I have fixed the reported issues. >> >> I have added the shared state as previously described. The new gram

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2020-04-07 Thread Etsuro Fujita
Hi Tomas, On Wed, Apr 8, 2020 at 12:15 AM Tomas Vondra wrote: > On Mon, Apr 06, 2020 at 05:28:52PM +0900, Etsuro Fujita wrote: > >On Sat, Apr 4, 2020 at 12:15 AM Etsuro Fujita > >wrote: > >> Attached is the original patch (0001) and one patch (0002) with > >> changes including those by Tomas an

Re: pgsql: Generate backup manifests for base backups, and validate them.

2020-04-07 Thread David Steele
On 4/7/20 12:44 PM, Robert Haas wrote: On Tue, Apr 7, 2020 at 5:51 AM Peter Eisentraut wrote: On 2020-04-03 21:07, Robert Haas wrote: A new tool called pg_validatebackup can validate a backup against the manifest. In software engineering, "verify" and "validate" have standardized distinct me

Re: WIP/PoC for parallel backup

2020-04-07 Thread Jeevan Chalke
On Tue, Apr 7, 2020 at 10:14 PM Asif Rehman wrote: > Hi, > > Thanks, Kashif and Rajkumar. I have fixed the reported issues. > > I have added the shared state as previously described. The new grammar > changes > are as follows: > > START_BACKUP [LABEL ''] [FAST] [MAX_RATE %d] > - This will gen

Re: Don't try fetching future segment of a TLI.

2020-04-07 Thread Fujii Masao
On 2020/04/07 20:21, David Steele wrote: On 4/7/20 3:48 AM, Kyotaro Horiguchi wrote: At Tue, 7 Apr 2020 12:15:00 +0900, Fujii Masao wrote in This doesn't seem a bug, so I'm thinking to merge this to next *major* version release, i.e., v13. Not a bug, perhaps, but I think we do consider b

Re: pgsql: Generate backup manifests for base backups, and validate them.

2020-04-07 Thread Robert Haas
On Tue, Apr 7, 2020 at 5:51 AM Peter Eisentraut wrote: > On 2020-04-03 21:07, Robert Haas wrote: > > A new tool called pg_validatebackup can validate a backup against the > > manifest. > > In software engineering, "verify" and "validate" have standardized > distinct meanings. I'm not going to try

Re: WIP/PoC for parallel backup

2020-04-07 Thread Asif Rehman
Hi, Thanks, Kashif and Rajkumar. I have fixed the reported issues. I have added the shared state as previously described. The new grammar changes are as follows: START_BACKUP [LABEL ''] [FAST] [MAX_RATE %d] - This will generate a unique backupid using pg_strong_random(16) and hex-encoded

Re: Improving connection scalability: GetSnapshotData()

2020-04-07 Thread Robert Haas
Comments: In 0002, the comments in SnapshotSet() are virtually incomprehensible. There's no commit message so the reasons for the changes are unclear. But mostly looks unproblematic. 0003 looks like a fairly unrelated bug fix that deserves to be discussed on the thread related to the original pat

Re: adding partitioned tables to publications

2020-04-07 Thread Amit Langote
Thanks for the review. On Tue, Apr 7, 2020 at 6:01 PM Peter Eisentraut wrote: > On 2020-04-07 08:44, Amit Langote wrote: > > I updated the patch to make the following changes: > > > > * Rewrote the tests to match in style with those committed yesterday > > * Renamed all variables that had pubasro

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-04-07 Thread Justin Pryzby
On Tue, Apr 07, 2020 at 08:40:30AM -0400, James Coleman wrote: > On Tue, Apr 7, 2020 at 12:25 AM Justin Pryzby wrote: > > On Mon, Apr 06, 2020 at 09:57:22PM +0200, Tomas Vondra wrote: > > > I've pushed the fist part of this patch series - I've reorganized it a > > > > I scanned through this again

Re: [PATCH] Incremental sort (was: PoC: Partial sort)

2020-04-07 Thread Tomas Vondra
On Tue, Apr 07, 2020 at 08:40:30AM -0400, James Coleman wrote: On Tue, Apr 7, 2020 at 12:25 AM Justin Pryzby wrote: On Mon, Apr 06, 2020 at 09:57:22PM +0200, Tomas Vondra wrote: > I've pushed the fist part of this patch series - I've reorganized it a I scanned through this again post-commit.

Re: [HACKERS] advanced partition matching algorithm for partition-wise join

2020-04-07 Thread Tomas Vondra
On Mon, Apr 06, 2020 at 05:28:52PM +0900, Etsuro Fujita wrote: On Sat, Apr 4, 2020 at 12:15 AM Etsuro Fujita wrote: Attached is the original patch (0001) and one patch (0002) with changes including those by Tomas and Ashutosh. I merged the patches into one and rebased it against HEAD. Attach

Re: A bug when use get_bit() function for a long bytea string

2020-04-07 Thread Tom Lane
"movead...@highgo.ca" writes: > After several patch change by hacker's proposal, I think it's ready to > commit, can we commit it before doing the code freeze for pg-13? It would be easier to get this done if you had addressed any of the objections to the patch as given. Integer-overflow handlin

  1   2   >