Re: Questions regarding distinct operation implementation

2022-12-02 Thread Ankit Kumar Pandey
On 02/12/22 03:21, David G. Johnston wrote:  The main concern, I suspect, isn't implementation ability, it is speed and memory consumption. Hi David, Shouldn't this be an acceptable tradeoff if someone wants to perform extra operation in plain old aggregates? Although I am not sure how

Re: Questions regarding distinct operation implementation

2022-12-02 Thread Ankit Kumar Pandey
On 02/12/22 03:07, David Rowley wrote: On Fri, 2 Dec 2022 at 08:10, Ankit Kumar Pandey wrote: select avg(distinct id) over (partition by name) from mytable (in oracle db) yields: 2 2 2 2 10 From this, it is seen distinct is taken across the all rows in the partition. Due to the lack of

Re: Transaction timeout

2022-12-02 Thread Nikolay Samokhvalov
On Fri, Dec 2, 2022 at 9:18 PM Andrey Borodin wrote: > Hello, > > We have statement_timeout, idle_in_transaction_timeout, > idle_session_timeout and many more! But we have no > transaction_timeout. I've skimmed thread [0,1] about existing timeouts > and found no contraindications to implement

docs: add missing id elements for developer GUCs

2022-12-02 Thread Ian Lawrence Barwick
Hi A few of the developer option GUCs were missing the "id" attribute in their markup, making it impossible to link to them directly. Specifically the entries from "trace_locks" to "log_btree_build_stats" here: https://www.postgresql.org/docs/current/runtime-config-developer.html Patch

Transaction timeout

2022-12-02 Thread Andrey Borodin
Hello, We have statement_timeout, idle_in_transaction_timeout, idle_session_timeout and many more! But we have no transaction_timeout. I've skimmed thread [0,1] about existing timeouts and found no contraindications to implement transaction_timeout. Nikolay asked me if I can prototype the

Re: Avoid streaming the transaction which are skipped (in corner cases)

2022-12-02 Thread Amit Kapila
On Fri, Dec 2, 2022 at 4:58 PM Ashutosh Bapat wrote: > > Hi Dilip, > > On Tue, Nov 29, 2022 at 9:38 AM Dilip Kumar wrote: > > > > > > > > You are right we need this in ReorderBufferProcessPartialChange() as > > > well. I will fix this in the next version. > > > > Fixed this in the attached

Re: Think-o in foreign key comments

2022-12-02 Thread Ian Lawrence Barwick
2022年12月3日(土) 7:19 Paul Jungwirth : > > Hello, > > I noticed a few places in the new foreign key code where a comment says > "the ON DELETE SET NULL/DELETE clause". I believe it should say "ON > DELETE SET NULL/DEFAULT". > > These comments were added in d6f96ed94e7, "Allow specifying column list >

Re: Temporary tables versus wraparound... again

2022-12-02 Thread Greg Stark
On Thu, 1 Dec 2022 at 14:18, Andres Freund wrote: > > Hi, > > On 2022-12-01 11:13:01 -0500, Greg Stark wrote: > > On Sat, 5 Nov 2022 at 11:34, Tom Lane wrote: > > > > > * I find 0001 a bit scary, specifically that it's decided it's > > > okay to apply extract_autovac_opts,

Re: pg_basebackup: add test about zstd compress option

2022-12-02 Thread Ian Lawrence Barwick
Hi I was looking at the commitfest entry for this patch [1] as it's been dormant for quite a while, with the intent of returning it with feedback. [1] https://commitfest.postgresql.org/40/3835/ 2022年8月25日(木) 16:52 Dong Wook Lee : > > On Tue, Aug 23, 2022 at 11:37 AM Michael Paquier wrote: > >

Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-12-02 Thread Bharath Rupireddy
On Fri, Dec 2, 2022 at 12:50 PM Michael Paquier wrote: > > On Thu, Nov 17, 2022 at 11:53:23AM +0530, Bharath Rupireddy wrote: > > Please do, if you feel so. Thanks for your review. > > I don't really mind the addition of the LSN when operating on a given > record where we are reading a location,

Re: Failed Assert in pgstat_assoc_relation

2022-12-02 Thread Andres Freund
Hi, On 2022-12-02 09:51:39 -0800, Andres Freund wrote: > On 2022-12-02 12:15:37 -0500, Tom Lane wrote: > > I wrote: > > > I guess that means that the table-to-view removal has to go in > > > first. I should be able to take care of that tomorrow, or if > > > you're in a hurry I don't mind if you

RE: Add semi-join pushdown to postgres_fdw

2022-12-02 Thread fujii.y...@df.mitsubishielectric.co.jp
Hi Mr.Pyhalov. Thank you for work on this useful patch. I'm starting to review v2 patch. I have cheked we can apply v2 patch to commit ec386948948c1708c0c28c48ef08b9c4dd9d47cc (Date:Thu Dec 1 12:56:21 2022 +0100). I briefly looked at this whole thing and did step execute this by running simple

Re: Add LZ4 compression in pg_dump

2022-12-02 Thread Michael Paquier
On Fri, Dec 02, 2022 at 04:15:10PM +, gkokola...@pm.me wrote: > You are very correct. However one can glob after the fact. Please find > 0001 of the attached v14 which attempts to implement it. + if ($pgdump_runs{$run}->{glob_pattern}) + { + my $glob_pattern =

Re: Generate pg_stat_get_* functions with Macros

2022-12-02 Thread Nathan Bossart
Overall, this change looks straightforward, and it saves a couple hundred lines. On Tue, Nov 22, 2022 at 08:09:22AM +0100, Drouvot, Bertrand wrote: > +/* pg_stat_get_numscans */ > +PGSTAT_DEFINE_REL_INT64_FIELD_ACCESSOR(pg_stat_get_, numscans); > + > +/* pg_stat_get_tuples_returned */ >

Re: WAL Insertion Lock Improvements (was: Re: Avoid LWLockWaitForVar() for currently held WAL insertion lock in WaitXLogInsertionsToFinish())

2022-12-02 Thread Nathan Bossart
On Fri, Dec 02, 2022 at 04:32:38PM +0530, Bharath Rupireddy wrote: > On Fri, Dec 2, 2022 at 6:10 AM Andres Freund wrote: >> I'm not sure this is quite right - don't we need a memory barrier. But I >> don't >> see a reason to not just leave this code as-is. I think this should be >> optimized

Re: Patch: Global Unique Index

2022-12-02 Thread David Zhang
On 2022-11-29 6:16 p.m., Tom Lane wrote: Assuming that you are inserting into index X, and you've checked index Y to find that it has no conflicts, what prevents another backend from inserting a conflict into index Y just after you look? AIUI the idea is to prevent that by continuing to hold an

Re: Patch: Global Unique Index

2022-12-02 Thread David Zhang
Thanks a lot for all the comments. On 2022-11-29 3:13 p.m., Tom Lane wrote: ... not to mention creating a high probability of deadlocks between concurrent insertions to different partitions. If they each ex-lock their own partition's index before starting to look into other partitions'

Think-o in foreign key comments

2022-12-02 Thread Paul Jungwirth
Hello, I noticed a few places in the new foreign key code where a comment says "the ON DELETE SET NULL/DELETE clause". I believe it should say "ON DELETE SET NULL/DEFAULT". These comments were added in d6f96ed94e7, "Allow specifying column list for foreign key ON DELETE SET actions." Here

Re: Bogus rte->relkind for EXCLUDED pseudo-relation

2022-12-02 Thread Tom Lane
Andres Freund writes: > On 2022-12-02 12:34:36 -0500, Tom Lane wrote: >> I find that >> (1) ON CONFLICT's EXCLUDED pseudo-relation is assigned >> rte->relkind = RELKIND_COMPOSITE, a rather horrid hack >> installed by commit ad2278379. > Is it that horrid? It's pretty bad IMO. You didn't even

Fwd: Perform streaming logical transactions by background workers and parallel apply

2022-12-02 Thread Peter Smith
-- Forwarded message - From: Peter Smith Date: Sat, Dec 3, 2022 at 8:03 AM Subject: Re: Perform streaming logical transactions by background workers and parallel apply To: Amit Kapila On Fri, Dec 2, 2022 at 8:57 PM Amit Kapila wrote: > > On Fri, Dec 2, 2022 at 2:29 PM Peter

Re: Using WaitEventSet in the postmaster

2022-12-02 Thread Thomas Munro
On Fri, Dec 2, 2022 at 3:36 PM Thomas Munro wrote: > On Fri, Dec 2, 2022 at 2:40 PM Andres Freund wrote: > > It doesn't seem trivial (but not impossible either) to make SetLatch() > > robust > > against arbitrary corruption. So it seems easier to me to just put the latch > > in process local

Re: Error-safe user functions

2022-12-02 Thread Tom Lane
Robert Haas writes: > On Fri, Dec 2, 2022 at 1:46 PM Tom Lane wrote: >> The main objection I can see to this approach is that we only support >> one context value per call, so you could not easily combine this >> functionality with existing use-cases for the context field. > I kind of wonder

Re: Error-safe user functions

2022-12-02 Thread Robert Haas
On Fri, Dec 2, 2022 at 1:46 PM Tom Lane wrote: > The main objection I can see to this approach is that we only support > one context value per call, so you could not easily combine this > functionality with existing use-cases for the context field. A quick > census of InitFunctionCallInfoData

Re: Removing another gen_node_support.pl special case

2022-12-02 Thread Tom Lane
Peter Eisentraut writes: > On 29.11.22 22:34, Tom Lane wrote: >> Concretely, it seems like something like the attached could be >> useful, independently of the other change. > Yes, right now you can easily declare things that don't make sense. > Cross-checks like these look useful. Checking my

Re: Questions regarding distinct operation implementation

2022-12-02 Thread Ankit Kumar Pandey
On 02/12/22 00:40, Ankit Kumar Pandey wrote: On 25/11/22 11:00, Ankit Kumar Pandey wrote: On 25/11/22 02:14, David Rowley wrote: On Fri, 25 Nov 2022 at 06:57, Ankit Kumar Pandey wrote: Please let me know any opinions on this. I think if you're planning on working on this then step 1

suppressing useless wakeups in logical/worker.c

2022-12-02 Thread Nathan Bossart
Hi hackers, I've attached an attempt at porting a similar change to 05a7be9 [0] to logical/worker.c. The bulk of the patch is lifted from the walreceiver patch, but I did need to add a hack for waking up after wal_retrieve_retry_interval to start sync workers. This hack involves a new wakeup

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-02 Thread Nathan Bossart
On Thu, Dec 01, 2022 at 04:21:30PM -0800, Nathan Bossart wrote: > Okay, here is a new version of the patch. This seems to clear up > everything that I could find via the tests. I cleaned up the patch a bit. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From

Re: O(n) tasks cause lengthy startups and checkpoints

2022-12-02 Thread Nathan Bossart
On Fri, Dec 02, 2022 at 12:11:35PM +0530, Bharath Rupireddy wrote: > On Fri, Dec 2, 2022 at 3:10 AM Nathan Bossart > wrote: >> The test appears to reliably create snapshot and mapping files, so if the >> directories are empty at some point after the checkpoint at the end, we can >> be reasonably

Re: Error-safe user functions

2022-12-02 Thread Corey Huinker
On Fri, Dec 2, 2022 at 1:46 PM Tom Lane wrote: > Corey Huinker writes: > > I'm still working on organizing my patch, but it grew out of a desire to > do > > this: > > CAST(value AS TypeName DEFAULT expr) > > This is a thing that exists in other forms in other databases and while > it > > may

Re: Error-safe user functions

2022-12-02 Thread Tom Lane
Corey Huinker writes: > I'm still working on organizing my patch, but it grew out of a desire to do > this: > CAST(value AS TypeName DEFAULT expr) > This is a thing that exists in other forms in other databases and while it > may look unrelated, it is essentially the SQL/JSON casts within a

Re: Error-safe user functions

2022-12-02 Thread Corey Huinker
On Fri, Dec 2, 2022 at 9:34 AM Andrew Dunstan wrote: > > On 2022-12-02 Fr 09:12, Tom Lane wrote: > > Robert Haas writes: > >> I think the design is evolving in your head as you think about this > >> more, which is totally understandable and actually very good. However, > >> this is also why I

Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert

2022-12-02 Thread Jacob Champion
On Thu, Dec 1, 2022 at 9:26 PM Michael Paquier wrote: > On Mon, Nov 07, 2022 at 05:04:14PM -0800, Jacob Champion wrote: > > The macOS/OpenSSL 3.0.0 failure is still unfixed. > > Err, could you look at that? I am switching the patch as waiting on > author. Thanks for the nudge -- running with

Re: Error-safe user functions

2022-12-02 Thread Corey Huinker
On Fri, Dec 2, 2022 at 9:12 AM Tom Lane wrote: > Robert Haas writes: > > I think the design is evolving in your head as you think about this > > more, which is totally understandable and actually very good. However, > > this is also why I think that you should produce the patch you > > actually

Re: Failed Assert in pgstat_assoc_relation

2022-12-02 Thread Andres Freund
Hi, On 2022-12-02 12:15:37 -0500, Tom Lane wrote: > I wrote: > > I guess that means that the table-to-view removal has to go in > > first. I should be able to take care of that tomorrow, or if > > you're in a hurry I don't mind if you commit it for me. > > Done now, feel free to deal with the

Re: Bogus rte->relkind for EXCLUDED pseudo-relation

2022-12-02 Thread Andres Freund
Hi, On 2022-12-02 12:34:36 -0500, Tom Lane wrote: > In the wake of b23cd185f (pushed just now), I tried adding Asserts > to rewriteHandler.c that relkinds in RTEs don't change, as attached. > This blew up the regression tests immediately. On investigation, > I find that > > (1) ON CONFLICT's

Re: [RFC] building postgres with meson - v13

2022-12-02 Thread Andres Freund
Hi, On 2022-09-22 04:29:15 -0400, Andrew Dunstan wrote: > Now I'll start on buildfarm support. Given my current commitments, this will > take me a while, but I hope to have a working client by about the beginning > of November. Just checking: Any progress on this? Anything I can help with? I'd

Re: pg_dump: Remove "blob" terminology

2022-12-02 Thread Tom Lane
Andrew Dunstan writes: > On 2022-12-02 Fr 09:18, Tom Lane wrote: >> The scheme I've vaguely thought about, but not got round to writing, >> is to merge all blobs with the same owner and ACL into one TOC entry. >> One would hope that would get it down to a reasonable number of >> TOC entries in

Bogus rte->relkind for EXCLUDED pseudo-relation

2022-12-02 Thread Tom Lane
In the wake of b23cd185f (pushed just now), I tried adding Asserts to rewriteHandler.c that relkinds in RTEs don't change, as attached. This blew up the regression tests immediately. On investigation, I find that (1) ON CONFLICT's EXCLUDED pseudo-relation is assigned rte->relkind =

Re: refactor ExecGrant_*() functions

2022-12-02 Thread Andres Freund
Hi, On 2022-12-02 08:30:55 +0100, Peter Eisentraut wrote: > From 200879e5edfc1ce93b7af3cbfafc1f618626cbe9 Mon Sep 17 00:00:00 2001 > From: Peter Eisentraut > Date: Fri, 2 Dec 2022 08:16:53 +0100 > Subject: [PATCH] Refactor ExecGrant_*() functions > > Instead of half a dozen of mostly-duplicate

Re: pg_dump: Remove "blob" terminology

2022-12-02 Thread Andrew Dunstan
On 2022-12-02 Fr 09:18, Tom Lane wrote: > we really need to do something about situations with $BIGNUM > large objects. Currently those tend to run pg_dump or pg_restore > out of memory because of TOC bloat, and we've seen multiple field > reports of that actually happening. > > The scheme I've

Re: Add tracking of backend memory allocated to pg_stat_activity

2022-12-02 Thread Andres Freund
Hi, On 2022-12-02 11:09:30 -0500, Reid Thompson wrote: > It appears to me that Postmaster populates the local variable that > *my_allocated_bytes points to. That allocation is passed to forked > children, and if not zeroed out, will be double counted as part of > the child allocation. Is this

Re: Failed Assert in pgstat_assoc_relation

2022-12-02 Thread Tom Lane
I wrote: > I guess that means that the table-to-view removal has to go in > first. I should be able to take care of that tomorrow, or if > you're in a hurry I don't mind if you commit it for me. Done now, feel free to deal with the pgstat problem. regards, tom lane

Re: Non-replayable WAL records through overflows and >MaxAllocSize lengths

2022-12-02 Thread Andres Freund
Hi, On 2022-07-26 18:58:02 +0200, Matthias van de Meent wrote: > - updated the MaxXLogRecordSize and XLogRecordLengthIsValid(len) > macros (now in xlogrecord.h), with a max length of the somewhat > arbitrary 1020MiB. > This leaves room for approx. 4MiB of per-record allocation overhead > before

Re: Non-replayable WAL records through overflows and >MaxAllocSize lengths

2022-12-02 Thread Andres Freund
Hi, On 2022-12-02 14:22:55 +0900, Michael Paquier wrote: > On Fri, Nov 04, 2022 at 09:52:39AM +0900, Ian Lawrence Barwick wrote: > > CommitFest 2022-11 is currently underway, so if you are interested > > in moving this patch forward, now would be a good time to update it. > > No replies after 4

Re: Failed Assert in pgstat_assoc_relation

2022-12-02 Thread Andres Freund
Hi, On 2022-12-02 01:03:35 -0500, Tom Lane wrote: > Andres Freund writes: > > On December 1, 2022 9:48:48 PM PST, Tom Lane wrote: > >> I'd suggest putting in an assertion that the relkind isn't changing, > >> instead. > > > Sounds like a plan. Will you do that when you remove the table-to-view

Re: Add tracking of backend memory allocated to pg_stat_activity

2022-12-02 Thread Reid Thompson
On Mon, 2022-11-28 at 10:59 -0800, Andres Freund wrote: > On 2022-11-26 22:10:06 -0500, Reid Thompson wrote: > >    - zero allocated bytes after fork to avoid double counting > > postmaster allocations > > I still don't understand this - postmaster shouldn't be counted at > all. It > doesn't have

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-02 Thread Tom Lane
Ashutosh Bapat writes: > On Fri, Dec 2, 2022 at 8:25 AM Tom Lane wrote: >> Unfortunately, I don't have an example that produces such a >> failure against HEAD. It seems certain to me that such cases >> exist, though, so I'd like to apply and back-patch the attached. > From this comment, that I

Re: [PATCH] Check snapshot argument of index_beginscan and family

2022-12-02 Thread Alexander Korotkov
Hi! On Mon, Nov 28, 2022 at 1:30 PM Aleksander Alekseev wrote: > Thanks for the feedback! > > > I think it's a nice catch and worth fixing. The one thing I don't > > agree with is using asserts for handling the error that can appear > > because most probably the server is built with assertions

Re: Is this an oversight in reparameterizing Memoize path?

2022-12-02 Thread Tom Lane
Richard Guo writes: > When reviewing other patch I noticed there might be an oversight for > MemoizePath in reparameterize_path. In reparameterize_path we are > supposed to increase the path's parameterization to required_outer. > However, AFAICS for MemoizePath we just re-create the same path

Re: [PATCH] Allow specification of custom slot for custom nodes

2022-12-02 Thread Alexander Korotkov
On Sat, Nov 26, 2022 at 2:05 PM Ian Lawrence Barwick wrote: > 2022年11月22日(火) 5:50 Alexander Korotkov : > > > > On Mon, Nov 21, 2022 at 4:34 PM Pavel Borisov > > wrote: > > > The following review has been posted through the commitfest application: > > > make installcheck-world: tested, passed >

Re: pg_dump: Remove "blob" terminology

2022-12-02 Thread Daniel Gustafsson
> On 2 Dec 2022, at 15:18, Tom Lane wrote: > I'm not asking you to make that happen as part of this patch, but > please don't refactor things in a way that will make it harder. I have that on my TODO as well since 7da8823d83a2b66bdd917aa6cb2c5c2619d86011.ca...@credativ.de, and having read this

Re: fixing CREATEROLE

2022-12-02 Thread Robert Haas
On Mon, Nov 28, 2022 at 8:33 PM Robert Haas wrote: > Hmm, that's an interesting alternative to what I actually implemented. > Some people might like it better, because it puts the behavior fully > under the control of the CREATEROLE user, which a number of you seem > to favor. Here's an updated

Re: Error-safe user functions

2022-12-02 Thread Andrew Dunstan
On 2022-12-02 Fr 09:12, Tom Lane wrote: > Robert Haas writes: >> I think the design is evolving in your head as you think about this >> more, which is totally understandable and actually very good. However, >> this is also why I think that you should produce the patch you >> actually want

Is this an oversight in reparameterizing Memoize path?

2022-12-02 Thread Richard Guo
When reviewing other patch I noticed there might be an oversight for MemoizePath in reparameterize_path. In reparameterize_path we are supposed to increase the path's parameterization to required_outer. However, AFAICS for MemoizePath we just re-create the same path thus its parameterization does

Re: pg_dump: Remove "blob" terminology

2022-12-02 Thread Tom Lane
Peter Eisentraut writes: > On 30.11.22 09:07, Daniel Gustafsson wrote: >> Should BLOB be changed to BLOBS here (and in similar comments) to make it >> clearer that it refers to the archive entry and the concept of a binary large >> object in general? > I changed this one and went through it

Re: Error-safe user functions

2022-12-02 Thread Tom Lane
Robert Haas writes: > I think the design is evolving in your head as you think about this > more, which is totally understandable and actually very good. However, > this is also why I think that you should produce the patch you > actually want instead of letting other people repeatedly submit >

Re: Add support for DEFAULT specification in COPY FROM

2022-12-02 Thread Israel Barth Rubio
Hello all, I'm submitting a new version of the patch. Instead of changing signature of several functions in order to use the defaults parameter, it is now storing that in the cstate structure, which is already passed to all functions that were previously modified. Best regards, Israel. Em sex.,

Re: initdb: Refactor PG_CMD_PUTS loops

2022-12-02 Thread Andrew Dunstan
On 2022-12-01 Th 05:02, Peter Eisentraut wrote: > Keeping the SQL commands that initdb runs in string arrays before > feeding them to PG_CMD_PUTS() seems unnecessarily verbose and > inflexible.  In some cases, the array only has one member.  In other > cases, one might want to use

Re: Optimizing Node Files Support

2022-12-02 Thread Ranier Vilela
Hi, thanks for reviewing this. Em sex., 2 de dez. de 2022 às 09:24, John Naylor < john.nay...@enterprisedb.com> escreveu: > > On Thu, Dec 1, 2022 at 8:02 PM Ranier Vilela wrote: > > > > Hi, > > > > I believe that has room for improving generation node files. > > > > The patch attached reduced

Re: Optimize common expressions in projection evaluation

2022-12-02 Thread David G. Johnston
On Fri, Dec 2, 2022 at 12:52 AM Peifeng Qiu wrote: > Hi hackers. > > When a star(*) expands into multiple fields, our current > implementation is to generate multiple copies of the expression > and do FieldSelects. This is very inefficient because the same > expression get evaluated multiple

Re: Error-safe user functions

2022-12-02 Thread Robert Haas
On Thu, Dec 1, 2022 at 5:33 PM Tom Lane wrote: > Robert Haas writes: > > It sounds to me like we're crafting something that is specific to and > > can only be used with type input and output functions, so the name > > probably should reflect that rather than being something totally > > generic

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-02 Thread Richard Guo
On Fri, Dec 2, 2022 at 8:49 PM Richard Guo wrote: > BTW, the code changes I'm using: > > --- a/src/backend/optimizer/util/pathnode.c > +++ b/src/backend/optimizer/util/pathnode.c > @@ -3979,6 +3979,17 @@ reparameterize_path(PlannerInfo *root, Path *path, >

Re: Removing another gen_node_support.pl special case

2022-12-02 Thread Peter Eisentraut
On 29.11.22 22:34, Tom Lane wrote: I wrote: I notice that EquivalenceClass is already marked as no_copy_equal, which means that gen_node_support.pl can know that emitting a recursive node-copy or node-compare request is a bad idea. What do you think of using the patch as it stands, plus a

Re: Fix gin index cost estimation

2022-12-02 Thread Ronan Dunklau
Le vendredi 2 décembre 2022, 12:33:33 CET Alexander Korotkov a écrit : > Hi, Ronan! > Thank you for your patch. Couple of quick questions. > 1) What magic number 50.0 stands for? I think we at least should make > it a macro. This is what is used in other tree-descending estimation functions,

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-02 Thread Richard Guo
On Fri, Dec 2, 2022 at 7:21 PM Ashutosh Bapat wrote: > > I'm suspicious now that reparameterize_path() should be > > extended likewise, but I don't really have any hard > > evidence for that. > > I think we need it there since the scope of paths under appendrel has > certainly expanded a lot

Re: Using AF_UNIX sockets always for tests on Windows

2022-12-02 Thread Andrew Dunstan
On 2022-12-01 Th 21:10, Andres Freund wrote: > Hi, > > On 2022-12-01 20:56:18 -0500, Tom Lane wrote: >> Andres Freund writes: >>> On 2022-12-01 20:30:36 -0500, Tom Lane wrote: If we remove that, won't we have a whole lot of code that's not tested at all on any platform, ie all the

Re: Report roles in pg_upgrade pg_ prefix check

2022-12-02 Thread Daniel Gustafsson
> On 29 Nov 2022, at 00:24, Michael Paquier wrote: > > On Mon, Nov 28, 2022 at 09:58:46AM +0100, Daniel Gustafsson wrote: >> We are a bit inconsistent in how much details we include in the report >> textfiles, so could do that without breaking any consistency in reporting. >> Looking at other

Re: Optimizing Node Files Support

2022-12-02 Thread John Naylor
On Thu, Dec 1, 2022 at 8:02 PM Ranier Vilela wrote: > > Hi, > > I believe that has room for improving generation node files. > > The patch attached reduced the size of generated files by 27 kbytes. > From 891 kbytes to 864 kbytes. > > About the patch: > 1. Avoid useless attribution when

Re: pg_upgrade: Make testing different transfer modes easier

2022-12-02 Thread Daniel Gustafsson
> On 1 Dec 2022, at 16:18, Peter Eisentraut > wrote: > > I wanted to test the different pg_upgrade transfer modes (--link, --clone), > but that was not that easy, because there is more than one place in the test > script you have to find and manually change. So I wrote a little patch to >

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-02 Thread Amit Kapila
On Fri, Dec 2, 2022 at 4:57 PM Hayato Kuroda (Fujitsu) wrote: > > handle_streamed_transaction() > > ``` > + if (apply_action == TRANS_LEADER_SEND_TO_PARALLEL) > + pa_send_data(winfo, s->len, s->data); > + else > +

Re: Fix gin index cost estimation

2022-12-02 Thread Alexander Korotkov
Hi, Ronan! On Fri, Dec 2, 2022 at 1:19 PM Ronan Dunklau wrote: > Sorry for the delay, but here is an updated patch which changes the costing in > the following way: > > - add a descent cost similar to the btree one is charged for the initial > entry-tree > - additionally, a charge is applied per

Re: Avoid streaming the transaction which are skipped (in corner cases)

2022-12-02 Thread Ashutosh Bapat
Hi Dilip, On Tue, Nov 29, 2022 at 9:38 AM Dilip Kumar wrote: > > > > > You are right we need this in ReorderBufferProcessPartialChange() as > > well. I will fix this in the next version. > > Fixed this in the attached patch. > I focused my attention on SnapBuildXactNeedsSkip() usages and I see

RE: Perform streaming logical transactions by background workers and parallel apply

2022-12-02 Thread Hayato Kuroda (Fujitsu)
Dear Hou, Thanks for making the patch. Followings are my comments for v54-0003 and 0004. 0003 pa_free_worker() + /* Unlink any files that were needed to serialize partial changes. */ + if (winfo->serialize_changes) + stream_cleanup_files(MyLogicalRepWorker->subid,

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-02 Thread Ashutosh Bapat
Hi Tom, On Fri, Dec 2, 2022 at 8:25 AM Tom Lane wrote: > > Whilst fooling with my outer-join-aware-Vars patch, I tripped > across a multi-way join query that failed with > ERROR: could not devise a query plan for the given query > when enable_partitionwise_join is on. > > I traced that to the

Re: [PATCH] Add native windows on arm64 support

2022-12-02 Thread Niyas Sait
Hello, I've attached a new revision of the patch (v5) and includes following changes, 1. Add support for meson build system 2. Extend MSVC scripts to handle ARM64 platform. 3. Add arm64 definition of spin_delay function. 4. Exclude arm_acle.h import with MSVC compiler. V4->V5: * Added

WAL Insertion Lock Improvements (was: Re: Avoid LWLockWaitForVar() for currently held WAL insertion lock in WaitXLogInsertionsToFinish())

2022-12-02 Thread Bharath Rupireddy
On Fri, Dec 2, 2022 at 6:10 AM Andres Freund wrote: > > On 2022-11-25 16:54:19 +0530, Bharath Rupireddy wrote: > > On Fri, Nov 25, 2022 at 12:16 AM Andres Freund wrote: > > > I think we could improve this code more significantly by avoiding the > > > call to > > > LWLockWaitForVar() for all

Re: Logical Replication Custom Column Expression

2022-12-02 Thread Ashutosh Bapat
On Wed, Nov 30, 2022 at 2:09 PM Stavros Koureas wrote: > > > > Στις Τρί 29 Νοε 2022 στις 3:27 μ.μ., ο/η Ashutosh Bapat > έγραψε: > > That would be too restrictive - not necessarily in your application > > but generally. There could be some tables where consolidating rows > > with same PK from

Re: generic plans and "initial" pruning

2022-12-02 Thread Amit Langote
On Thu, Dec 1, 2022 at 9:43 PM Amit Langote wrote: > On Thu, Dec 1, 2022 at 8:21 PM Alvaro Herrera wrote: > > On 2022-Dec-01, Amit Langote wrote: > > > Hmm, how about keeping the [Merge]Append's parent relation's RT index > > > in the PartitionPruneInfo and passing it down to > > >

Re: Fix gin index cost estimation

2022-12-02 Thread Ronan Dunklau
Le mardi 25 octobre 2022, 16:18:57 CET Tom Lane a écrit : > Alexander Korotkov writes: > > I think Tom's point was that it's wrong to add a separate entry-tree CPU > > cost estimation to another estimation, which tries (very inadequately) to > > estimate the whole scan cost. Instead, I propose

Re: ExecRTCheckPerms() and many prunable partitions

2022-12-02 Thread Alvaro Herrera
Hello, On 2022-Dec-02, Amit Langote wrote: > This sounds like a better idea than adding a new AttrMap, so done this > way in the attached 0001. Thanks for doing that! I have pushed it, but I renamed ri_RootToPartitionMap to ri_RootToChildMap and moved it to another spot in ResultRelInfo, which

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-02 Thread Amit Kapila
On Fri, Dec 2, 2022 at 2:29 PM Peter Smith wrote: > > 3. pa_setup_dsm > > +/* > + * Set up a dynamic shared memory segment. > + * > + * We set up a control region that contains a fixed-size worker info > + * (ParallelApplyWorkerShared), a message queue, and an error queue. > + * > + * Returns

Re: [PATCH] Add native windows on arm64 support

2022-12-02 Thread Niyas Sait
On 02/12/2022 05:41, John Naylor wrote: I couldn't find something more official for the sse2neon library part. Not quite sure what this is referring to, but it seems we can just point to the __aarch64__ section in the same file, which uses the same instruction: spin_delay(void) { __asm__

Re: [PATCH] Add native windows on arm64 support

2022-12-02 Thread Niyas Sait
On 02/12/2022 05:02, Michael Paquier wrote: Thanks for the updated version. I have been looking at it closely and it looks like it should be able to do the job (no arm64 machine for Windows here, sigh). I have one tiny comment about this part: - USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK =>

Re: Minimal logical decoding on standbys

2022-12-02 Thread Drouvot, Bertrand
Hi, On 11/25/22 11:26 AM, Drouvot, Bertrand wrote: Hi, On 9/30/22 2:11 PM, Drouvot, Bertrand wrote: Hi, On 7/6/22 3:30 PM, Drouvot, Bertrand wrote: Hi, On 10/28/21 11:07 PM, Andres Freund wrote: Hi, On 2021-10-28 16:24:22 -0400, Robert Haas wrote: On Wed, Oct 27, 2021 at 2:56 AM

Re: pg_dump: Remove "blob" terminology

2022-12-02 Thread Daniel Gustafsson
> On 2 Dec 2022, at 08:09, Peter Eisentraut > wrote: > fixed +1 on this version of the patch, LGTM. > I also put back the old long options forms in the documentation and help but > marked them deprecated. + --blobs (deprecated) While not in scope for this patch, I wonder if we should