Re: RFC: Logging plan of the running query

2024-02-25 Thread Julien Rouhaud
On Mon, Feb 26, 2024 at 12:19:42PM +0530, Ashutosh Bapat wrote: > On Sun, Feb 25, 2024 at 5:00 PM Julien Rouhaud wrote: > > > > > > On Fri, Feb 23, 2024 at 7:50 PM Julien Rouhaud > > > > wrote: > > > > > > > > > > But it doesn't have to be all or nothing right? I mean each call > > > > >

Re: "type with xxxx does not exist" when doing ExecMemoize()

2024-02-25 Thread Andrei Lepikhov
On 26/2/2024 12:44, Tender Wang wrote: Andrei Lepikhov > 于2024年2月26日周一 10:57写道: On 25/2/2024 20:32, Tender Wang wrote: > I think in prepare_probe_slot(), should called datumCopy as the attached > patch does. > > Any thoughts?

Re: Synchronizing slots from primary to standby

2024-02-25 Thread Bertrand Drouvot
Hi, On Mon, Feb 26, 2024 at 10:48:38AM +0530, Amit Kapila wrote: > On Fri, Feb 23, 2024 at 4:45 PM Bertrand Drouvot > wrote: > > > > On Fri, Feb 23, 2024 at 09:46:00AM +, Zhijie Hou (Fujitsu) wrote: > > > > > > Besides, I'd like to clarify and discuss the behavior of > > >

Allow non-superuser to cancel superuser tasks.

2024-02-25 Thread Kirill Reshke
Hi hackers! In our Cloud we have a patch, which allows non-superuser role ('mdb_admin') to do some superuser things. In particular, we have a patch that allows mdb admin to cancel the autovacuum process and some other processes (processes with application_name = 'MDB'), see the attachment. This

Re: Synchronizing slots from primary to standby

2024-02-25 Thread Bertrand Drouvot
Hi, On Mon, Feb 26, 2024 at 09:13:05AM +0530, shveta malik wrote: > On Fri, Feb 23, 2024 at 7:41 PM Bertrand Drouvot > wrote: > > > > Hi, > > > I think to set secure search path for remote connection, the standard > > > approach > > > could be to extend the code in libpqrcv_connect[1], so that

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-02-25 Thread Etsuro Fujita
On Mon, Feb 26, 2024 at 8:37 AM Michael Paquier wrote: > I don't see how that's directly your fault as this is a thinko in the > set of commits 481d7d1c01, 555276f859 and 501cfd07da that have hit > 14~16, ignoring entirely the TRY/CATCH block. The set of commits is actually a fix for resource

Re: Synchronizing slots from primary to standby

2024-02-25 Thread Bertrand Drouvot
Hi, On Mon, Feb 26, 2024 at 02:18:58AM +, Zhijie Hou (Fujitsu) wrote: > On Friday, February 23, 2024 6:12 PM Bertrand Drouvot > wrote: > > + if (!ok) > > + GUC_check_errdetail("List syntax is invalid."); > > + > > + /* > > +* If there is a syntax error in

Re: [PATCH] Add --syntax to postgres for SQL syntax checking

2024-02-25 Thread Jelte Fennema-Nio
On Sun, 25 Feb 2024 at 23:34, Josef Šimánek wrote: > Exposing parser to frontend tools makes no sense to me Not everyone seems to agree with that, it's actually already done by Lukas from pganalyze: https://github.com/pganalyze/libpg_query

RE: speed up a logical replica setup

2024-02-25 Thread Hayato Kuroda (Fujitsu)
Dear Vignesh, I forgot to reply one of the suggestion. > 2) There is a CheckDataVersion function which does exactly this, will > we be able to use this: > + /* Check standby server version */ > + if ((ver_fd = fopen(versionfile, "r")) == NULL) > + pg_fatal("could not

Re: Shared detoast Datum proposal

2024-02-25 Thread Nikita Malakhov
Hi! I see this to be a very promising initiative, but some issues come into my mind. When we store and detoast large values, say, 1Gb - that's a very likely scenario, we have such cases from prod systems - we would end up in using a lot of shared memory to keep these values alive, only to discard

Re: Add publisher and subscriber to glossary documentation.

2024-02-25 Thread Peter Smith
Hi, the patch v4 LGTM. == Kind Regards, Peter Smith. Fujitsu Australia

Re: Improve eviction algorithm in ReorderBuffer

2024-02-25 Thread Masahiko Sawada
On Fri, Feb 23, 2024 at 6:24 PM vignesh C wrote: > > On Fri, 9 Feb 2024 at 20:51, Masahiko Sawada wrote: > > > > > > I think this performance regression is not acceptable. In this > > workload, one transaction has 10k subtransactions and the logical > > decoding becomes quite slow if

Re: Add publisher and subscriber to glossary documentation.

2024-02-25 Thread Shlok Kyal
> 1. > + > + Publication node > + > + > + A node where a > + linkend="glossary-publication">publication is defined > + for logical > replication. > + > + > + > + > > I felt the word "node" here should link to the glossary term "Node", > instead of directly to the

Re: RFC: Logging plan of the running query

2024-02-25 Thread Ashutosh Bapat
On Sun, Feb 25, 2024 at 5:00 PM Julien Rouhaud wrote: > > On Sat, Feb 24, 2024 at 08:56:41AM -0500, James Coleman wrote: > > On Fri, Feb 23, 2024 at 10:23 AM Robert Haas wrote: > > > > > > On Fri, Feb 23, 2024 at 7:50 PM Julien Rouhaud wrote: > > > > > > > > But it doesn't have to be all or

Re: Improve eviction algorithm in ReorderBuffer

2024-02-25 Thread Masahiko Sawada
On Sat, Feb 24, 2024 at 1:29 AM Tomas Vondra wrote: > > Hi, > > I did a basic review and testing of this patch today. Overall I think > the patch is in very good shape - I agree with the tradeoffs it makes, > and I like the approach in general. I do have a couple minor comments > about the code,

Re: SQL Property Graph Queries (SQL/PGQ)

2024-02-25 Thread Ashutosh Bapat
On Fri, Feb 23, 2024 at 11:08 PM Tomas Vondra wrote: > > On 2/23/24 17:15, Peter Eisentraut wrote: > > On 16.02.24 20:23, Andres Freund wrote: > >> One aspect that I m concerned with structurally is that the > >> transformation, > >> from property graph queries to something postgres understands,

Re: "type with xxxx does not exist" when doing ExecMemoize()

2024-02-25 Thread Andrei Lepikhov
On 26/2/2024 09:52, Andrei Lepikhov wrote: On 25/2/2024 20:32, Tender Wang wrote: I think in prepare_probe_slot(), should called datumCopy as the attached patch does. Any thoughts? Thanks. Thanks for the report. I think it is better to invent a Runtime Memory Context; likewise, it is

Re: Speeding up COPY TO for uuids and arrays

2024-02-25 Thread Michael Paquier
On Thu, Feb 22, 2024 at 04:42:37PM -0300, Ranier Vilela wrote: > Can you share exactly script used to create a table? Stressing the internals of array_out() for the area of the patch is not that difficult, as we want to quote each element that's returned in output. The trick is to have the

Re: Can we include capturing logs of pgdata/pg_upgrade_output.d/*/log in buildfarm

2024-02-25 Thread Andrew Dunstan
On 2024-02-25 Su 11:18, vignesh C wrote: On Thu, 15 Feb 2024 at 08:36, vignesh C wrote: On Thu, 15 Feb 2024 at 07:24, Michael Paquier wrote: On Wed, Feb 14, 2024 at 03:51:08PM +0530, vignesh C wrote: First regex is the testname_clusterinstance_data, second regex is the timestamp used for

Re: Synchronizing slots from primary to standby

2024-02-25 Thread Amit Kapila
On Fri, Feb 23, 2024 at 4:45 PM Bertrand Drouvot wrote: > > On Fri, Feb 23, 2024 at 09:46:00AM +, Zhijie Hou (Fujitsu) wrote: > > > > Besides, I'd like to clarify and discuss the behavior of standby_slot_names > > once. > > > > As it stands in the patch, If the slots specified in

Re: Preserve subscription OIDs during pg_upgrade

2024-02-25 Thread Robert Haas
On Mon, Feb 26, 2024 at 6:07 AM Michael Paquier wrote: > I think that the idea behind that it that it would then become > possible to relax the restrictions related to the states of the > relations stored in pg_subscription_rel, which can now be only a > "ready" or "init" state (see

Re: Relation bulk write facility

2024-02-25 Thread Michael Paquier
On Mon, Feb 26, 2024 at 09:42:03AM +0530, Robert Haas wrote: > On Mon, Feb 26, 2024 at 1:21 AM Tom Lane wrote: >> So, we now need to strip the remnants of AIX support from the code and >> docs? I don't see that much of it, but it's misleading to leave it >> there. >> >> (BTW, I still want to

Re: Relation bulk write facility

2024-02-25 Thread Robert Haas
On Mon, Feb 26, 2024 at 1:21 AM Tom Lane wrote: > So, we now need to strip the remnants of AIX support from the code and > docs? I don't see that much of it, but it's misleading to leave it > there. > > (BTW, I still want to nuke the remaining snippets of HPPA support. > I don't think it does

Re: POC, WIP: OR-clause support for indexes

2024-02-25 Thread Alena Rybakina
On 24.02.2024 14:28, jian he wrote: Hi. I wrote the first draft patch of the documentation. it's under the section: Planner Method Configuration (runtime-config-query.html) but this feature's main meat is in src/backend/parser/parse_expr.c so it may be slightly inconsistent, as mentioned by

Re: Injection points: some tools to wait and wake

2024-02-25 Thread Michael Paquier
On Thu, Feb 22, 2024 at 08:00:24AM +, Bertrand Drouvot wrote: > +/* Maximum number of wait usable in injection points at once */ > > s/Maximum number of wait/Maximum number of waits/ ? Thanks. I've edited a few more places while scanning the whole. > > 2 === > > +# Check the logs that

Re: Synchronizing slots from primary to standby

2024-02-25 Thread shveta malik
On Fri, Feb 23, 2024 at 7:41 PM Bertrand Drouvot wrote: > > Hi, > > I think to set secure search path for remote connection, the standard > > approach > > could be to extend the code in libpqrcv_connect[1], so that we don't need > > to schema > > qualify all the operators in the queries. > > >

Re: "type with xxxx does not exist" when doing ExecMemoize()

2024-02-25 Thread Andrei Lepikhov
On 25/2/2024 20:32, Tender Wang wrote: I think in prepare_probe_slot(), should called datumCopy as the attached patch does. Any thoughts? Thanks. Thanks for the report. I think it is better to invent a Runtime Memory Context; likewise, it is already designed in IndexScan and derivatives.

RE: Synchronizing slots from primary to standby

2024-02-25 Thread Zhijie Hou (Fujitsu)
On Friday, February 23, 2024 6:12 PM Bertrand Drouvot wrote: > > Here are some random comments: Thanks for the comments! > > 1 === > > Commit message "Allow logical walsenders to wait for the physical" > > s/physical/physical standby/? > > 2 == > > +++

Re: Shared detoast Datum proposal

2024-02-25 Thread Andy Fan
Hi, >> >> Good idea. Either that (a separate README), or a comment in a header of >> some suitable .c/.h file (I prefer that, because that's kinda obvious >> when reading the code, I often not notice a README exists next to it). > > Great, I'd try this from tomorrow. I have made it.

Re: RangeTblEntry jumble omissions

2024-02-25 Thread Michael Paquier
On Fri, Feb 23, 2024 at 06:52:54PM -0500, Tom Lane wrote: > Julien Rouhaud writes: >> On Fri, Feb 23, 2024 at 04:26:53PM +0100, Peter Eisentraut wrote: >>> - funcordinality >>> This was probably just forgotten. It should be included because the WITH >>> ORDINALITY clause changes the query

Re: Preserve subscription OIDs during pg_upgrade

2024-02-25 Thread Michael Paquier
On Sun, Feb 25, 2024 at 11:34:35AM -0500, Tom Lane wrote: > vignesh C writes: >> Recently we have supported upgrade of subscriptions,but currently >> subscription OIDs can be changed when a cluster is upgraded using >> pg_upgrade. It will be better to preserve them as it will be easier to >>

Re: Add publisher and subscriber to glossary documentation.

2024-02-25 Thread Peter Smith
Here are some comments for patch v3: 1. + + Publication node + + + A node where a + publication is defined + for logical replication. + + + + I felt the word "node" here should link to the glossary term "Node", instead of directly to the term "Instance". ~~ 2. +

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-02-25 Thread Michael Paquier
On Sun, Feb 25, 2024 at 06:34:30PM +0900, Etsuro Fujita wrote: > I think this would happen when FDWs configure no events; IIRC I think > while the core allows them to do so, postgres_fdw does not do so, so > this would never happen with it. Anyway, thanks for the report and > patch, Alexander! I

Re: Potential issue in ecpg-informix decimal converting functions

2024-02-25 Thread Daniel Gustafsson
> On 24 Feb 2024, at 02:15, Michael Paquier wrote: > > On Fri, Feb 23, 2024 at 06:03:41PM +0300, a.ima...@postgrespro.ru wrote: >> Thank's for advice, the patch will be registered for the next commitfest. > > The risk looks really minimal to me, but playing with error codes > while the logic of

Re: [PATCH] Add --syntax to postgres for SQL syntax checking

2024-02-25 Thread Josef Šimánek
ne 25. 2. 2024 v 23:24 odesílatel Tomas Vondra napsal: > > > > On 12/15/23 16:38, Josef Šimánek wrote: > > pá 15. 12. 2023 v 16:32 odesílatel David G. Johnston > > napsal: > >> > >> On Fri, Dec 15, 2023 at 8:20 AM Josef Šimánek > >> wrote: > >>> > >>> (parser is not available > >>> in public

Re: Logging parallel worker draught

2024-02-25 Thread Peter Smith
On Mon, Feb 26, 2024 at 6:13 AM Tomas Vondra wrote: > > 1) name of the GUC > > I find the "log_parallel_worker_draught" to be rather unclear :-( Maybe > it's just me and everyone else just immediately understands what this > does / what will happen after it's set to "on", but I find it rather >

Re: [PATCH] Add --syntax to postgres for SQL syntax checking

2024-02-25 Thread Tomas Vondra
On 12/15/23 16:38, Josef Šimánek wrote: > pá 15. 12. 2023 v 16:32 odesílatel David G. Johnston > napsal: >> >> On Fri, Dec 15, 2023 at 8:20 AM Josef Šimánek >> wrote: >>> >>> (parser is not available >>> in public APIs of postgres_fe.h or libpq). >> >> >> What about building "libpg" that

Re: Making the initial and maximum DSA segment sizes configurable

2024-02-25 Thread Tomas Vondra
Hello Masahiko-san, I'm not super-familiar with the DSA/DSM stuff, but I think your proposal makes sense. I agree with your observation that DSA is a bit like AllocSet, so if that allows specifying min/max block size, maybe DSA should allow the same thing for segments ... However, does it

Re: Parallel Query Stats

2024-02-25 Thread Tomas Vondra
Hi Benoit, On 4/5/23 15:00, Benoit Lobréau wrote: > Hi hackers, > > Parallelism has been in core since 9.6, it's a great feature that got > several > upgrades since then. However, it lacks metrics to determine if and how > parallelism is used and help tune parameters related to it. > True. >

Re: Relation bulk write facility

2024-02-25 Thread Tom Lane
Noah Misch writes: > On Sun, Feb 25, 2024 at 04:34:47PM +0200, Heikki Linnakangas wrote: >> I agree with Andres though, that unless someone raises their hand and >> volunteers to properly maintain the AIX support, we should drop it. > There's no way forward in which AIX support stops doing net

Re: Relation bulk write facility

2024-02-25 Thread Noah Misch
On Sun, Feb 25, 2024 at 04:34:47PM +0200, Heikki Linnakangas wrote: > I agree with Andres though, that unless someone raises their hand and > volunteers to properly maintain the AIX support, we should drop it. There's no way forward in which AIX support stops doing net harm. Even if AIX

Re: Logging parallel worker draught

2024-02-25 Thread Tomas Vondra
Hi, I see the thread went a bit quiet, but I think it'd be very useful (and desirable) to have this information in log. So let me share my thoughts about the patch / how it should work. The patch is pretty straightforward, I don't have any comments about the code as is. Obviously, some of the

Re: Transaction timeout

2024-02-25 Thread Alexander Korotkov
Hi, Andrey! On Thu, Feb 22, 2024 at 7:23 PM Andrey M. Borodin wrote: > > On 19 Feb 2024, at 15:17, Japin Li wrote: > > > > > > +1 > > PFA patch set of 4 patches: > 1. remove all potential flaky tests. BTW recently we had a bingo when 3 of > them failed together [0] > 2-3. waiting injection

Re: Patch: Add parse_type Function

2024-02-25 Thread David E. Wheeler
On Feb 24, 2024, at 19:11, Jim Jones wrote: >> What’s the protocol for marking a patch ready for committer? > > I guess after the review of the last assigned reviewer Oh, I didn’t realize someone was assigned. :-) > The fact that a completely invalid type returns NULL .. > > SELECT

Re: libpq: PQfnumber overload for not null-terminated strings

2024-02-25 Thread Tom Lane
Ivan Trofimov writes: > Would you be willing to review a patch that adds an `PQfnumber` overload > that takes a `field_name` size as well? I'm a little skeptical of this idea. If you need counted strings for PQfnumber, wouldn't you need them for every single other string-based API in libpq as

Re: Preserve subscription OIDs during pg_upgrade

2024-02-25 Thread Tom Lane
vignesh C writes: > Recently we have supported upgrade of subscriptions,but currently > subscription OIDs can be changed when a cluster is upgraded using > pg_upgrade. It will be better to preserve them as it will be easier to > compare subscription related objects in pg_subscription and >

Re: Optimize planner memory consumption for huge arrays

2024-02-25 Thread Tom Lane
Tomas Vondra writes: > On 2/25/24 00:07, Tom Lane wrote: >> ... I'm not sure if it'd be worth extending >> the mcxt.c API to provide something like "MemoryContextResetIfBig", >> with some internal rule that would be cheap to apply like "reset >> if we have any non-keeper blocks". > I think

Preserve subscription OIDs during pg_upgrade

2024-02-25 Thread vignesh C
Hi, Recently we have supported upgrade of subscriptions,but currently subscription OIDs can be changed when a cluster is upgraded using pg_upgrade. It will be better to preserve them as it will be easier to compare subscription related objects in pg_subscription and pg_subscription_rel in the old

Re: Running the fdw test from the terminal crashes into the core-dump

2024-02-25 Thread Tom Lane
Alvaro Herrera writes: > On 2024-Feb-22, Tom Lane wrote: >> While I've not done anything about that here, I wonder if we shouldn't >> just write "privilege on the target table" without any special markup. > That would work for me. OK. Will you do the honors, or shall I?

Re: Can we include capturing logs of pgdata/pg_upgrade_output.d/*/log in buildfarm

2024-02-25 Thread vignesh C
On Thu, 15 Feb 2024 at 08:36, vignesh C wrote: > > On Thu, 15 Feb 2024 at 07:24, Michael Paquier wrote: > > > > On Wed, Feb 14, 2024 at 03:51:08PM +0530, vignesh C wrote: > > > First regex is the testname_clusterinstance_data, second regex is the > > > timestamp used for pg_upgrade, third regex

Re: Relation bulk write facility

2024-02-25 Thread Heikki Linnakangas
On 25/02/2024 00:37, Thomas Munro wrote: On Sun, Feb 25, 2024 at 11:16 AM Thomas Munro wrote: On Sun, Feb 25, 2024 at 11:06 AM Heikki Linnakangas wrote: Regarding the issue at hand, perhaps we should define PG_IO_ALIGN_SIZE as 16 on AIX, if that's the best the linker can do on that

Re: Optimize planner memory consumption for huge arrays

2024-02-25 Thread Tomas Vondra
On 2/25/24 00:07, Tom Lane wrote: > I wrote: >> Tomas Vondra writes: >>> On 2/19/24 16:45, Tom Lane wrote: Tomas Vondra writes: > For example, I don't think we expect selectivity functions to allocate > long-lived objects, right? So maybe we could run them in a dedicated >

"type with xxxx does not exist" when doing ExecMemoize()

2024-02-25 Thread Tender Wang
Hi, I met Memoize node failed When I used sqlancer test postgres. database0=# explain select t0.c0 from t0 join t5 on t0.c0 = (t5.c0 - t5.c0); QUERY PLAN -- Nested Loop

Re: RangeTblEntry jumble omissions

2024-02-25 Thread Julien Rouhaud
On Fri, Feb 23, 2024 at 11:00:41PM +0100, Alvaro Herrera wrote: > > Another, similar but not quite: if you do > > SET search_path TO foo; > SELECT * FROM t1; > SET search_path TO bar; > SELECT * FROM t1; > > and you have both foo.t1 and bar.t1, you'll get two identical-looking > queries in

Re: Running the fdw test from the terminal crashes into the core-dump

2024-02-25 Thread Alvaro Herrera
On 2024-Feb-22, Tom Lane wrote: > Alvaro Herrera writes: > > I propose the attached. (Extra context so that the full paragraph can > > be read from the comfort of your email program.) > > This reads awkwardly to me. I think it'd be better to construct it > so that DO NOTHING's requirement is

Re: RangeTblEntry jumble omissions

2024-02-25 Thread Alvaro Herrera
On 2024-Feb-23, Peter Eisentraut wrote: > - alias > > Currently, two queries like > > SELECT * FROM t1 AS foo > SELECT * FROM t1 AS bar > > are counted together by pg_stat_statements -- that might be ok, but they > both get listed under whichever one is run first, so here if you are looking >

libpq: PQfnumber overload for not null-terminated strings

2024-02-25 Thread Ivan Trofimov
Hi! This one comes from C++'s `std::string_view`: being just a `const char*` plus the `size`, it's a very convenient type to use in interfaces which don't need an ownership of the data passed in. Unfortunately, `PQfnumber` expects a null-terminated string, which `std::string_view` can not

Re: RFC: Logging plan of the running query

2024-02-25 Thread Julien Rouhaud
On Sat, Feb 24, 2024 at 08:56:41AM -0500, James Coleman wrote: > On Fri, Feb 23, 2024 at 10:23 AM Robert Haas wrote: > > > > On Fri, Feb 23, 2024 at 7:50 PM Julien Rouhaud wrote: > > > > > > But it doesn't have to be all or nothing right? I mean each call could > > > say > > > what the

Re: ExecAppendAsyncEventWait() in REL_14_STABLE can corrupt PG_exception_stack

2024-02-25 Thread Etsuro Fujita
Hi, On Sat, Feb 24, 2024 at 10:06 AM Michael Paquier wrote: > On Fri, Feb 23, 2024 at 01:21:14PM +0300, Alexander Pyhalov wrote: > > Recent commit 555276f8594087ba15e0d58e38cd2186b9f39f6d introduced final > > cleanup of node->as_eventset in ExecAppendAsyncEventWait(). > > Unfortunately, now this