Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment

2025-03-25 Thread Andrei Lepikhov
On 3/24/25 23:45, Tom Lane wrote: Lukas Fittl writes: The main argument I had initially when proposing this, is that Memoize is different from other plan nodes, in that it makes the child node costs "cheaper". Clearly seeing the expected cache hit/ratio (that drives that costing modification) h

Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning

2025-03-25 Thread Ashutosh Bapat
On Tue, Mar 25, 2025 at 12:58 PM Amit Langote wrote: > > -/* Updates ec1's ec_derives_list and ec_derives_hash if present. */ > +/* > + * Appends ec2's derived clauses to ec1->ec_derives_list and adds > + * them to ec1->ec_derives_hash if present. > + */ WF

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Shubham Khanna
On Tue, Mar 25, 2025 at 4:31 PM Ashutosh Bapat wrote: > > On Tue, Mar 25, 2025 at 4:28 PM Shubham Khanna > wrote: > > > > > The attached patches contain the suggested changes. > > [1] - > > https://www.postgresql.org/message-id/CAA4eK1KUDEO0t6i16_CcEpg33sgcgEddHcdVC_q8j4tVUb5FWw%40mail.gmail.com

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Ashutosh Bapat
On Tue, Mar 25, 2025 at 4:28 PM Shubham Khanna wrote: > > The attached patches contain the suggested changes. > [1] - > https://www.postgresql.org/message-id/CAA4eK1KUDEO0t6i16_CcEpg33sgcgEddHcdVC_q8j4tVUb5FWw%40mail.gmail.com Forgot to attach patches? -- Best Wishes, Ashutosh Bapat

[PATCH] Split varlena.c into varlena.c and bytea.c

2025-03-25 Thread Aleksander Alekseev
Hi, The proposed patch extracts the code dealing with bytea from varlena.c into a separate file, as proposed previously [1]. It merely changes the location of the existing functions. There are no other changes. [1]: http://postgr.es/m/Zy2UqcZS2XAXBibq%40paquier.xyz -- Best regards, Aleksander A

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Ashutosh Bapat
On Tue, Mar 25, 2025 at 5:15 PM Amit Kapila wrote: > > On Tue, Mar 25, 2025 at 5:08 PM Ashutosh Bapat > wrote: > > > > This looks mostly ready except the test changes. I believe when > > committing, we are going to squash all three into a single commit. Is > > that correct? > > > > I would not pr

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-03-25 Thread Alvaro Herrera
Hello On 2025-Mar-25, Peter Eisentraut wrote: > A patch in the NOT ENFORCED constraints patch series proposes to refactor > some of the code added by this patch series ([0] patch v18-0001). I noticed > that the code paths from this patch series do not call > InvokeObjectPostAlterHook() or CacheI

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Amit Kapila
On Tue, Mar 25, 2025 at 5:08 PM Ashutosh Bapat wrote: > > This looks mostly ready except the test changes. I believe when > committing, we are going to squash all three into a single commit. Is > that correct? > I would not prefer to commit 0003 as it is primarily because of test +# run pg_create

Re: Add semi-join pushdown to postgres_fdw

2025-03-25 Thread Alexander Korotkov
On Mon, Mar 24, 2025 at 6:56 PM Alexander Pyhalov wrote: > Alexander Korotkov писал(а) 2025-03-24 11:49: > > On Mon, Mar 24, 2025 at 9:07 AM Alexander Pyhalov > > wrote: > >> Alexander Korotkov писал(а) 2025-03-24 04:21: > >> > Hi, Alexander! > >> > > >> > On Tue, Mar 18, 2025 at 6:04 PM Alexande

Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning

2025-03-25 Thread Amit Langote
On Tue, Mar 25, 2025 at 6:36 PM Ashutosh Bapat wrote: > On Tue, Mar 25, 2025 at 12:58 PM Amit Langote wrote: > > Btw, about ec_clear_derived_clauses(): > > > > @@ -749,7 +749,7 @@ remove_rel_from_eclass(EquivalenceClass *ec, > > SpecialJoinInfo *sjinfo, > > * drop them. (At this point, any

Re: CREATE DATABASE with filesystem cloning

2025-03-25 Thread Nazir Bilal Yavuz
Hi, Rebased version of the patch is attached. -- Regards, Nazir Bilal Yavuz Microsoft From d2eb46fb18258931f65e2b01ac6b406255f3c575 Mon Sep 17 00:00:00 2001 From: Nazir Bilal Yavuz Date: Thu, 8 Aug 2024 15:01:48 +0300 Subject: [PATCH v10] Introduce file_copy_method GUC This GUC can be set to ei

Re: Expanding HOT updates for expression and partial indexes

2025-03-25 Thread Burd, Greg
Matthias, Rebased patch attached. Changes in v14: * UpdateContext now the location I've stored estate, resultRelInfo, etc. * Reuse the result from the predicate on the partial index. -greg > On Mar 7, 2025, at 5:47 PM, Matthias van de Meent > wrote: > > On Thu, 6 Mar 2025 at 13:40, Burd,

RE: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Hayato Kuroda (Fujitsu)
Dear Ashutosh, > The new description doesn't mention the link between the source and > target database. Yes, I intentionally removed. > And I think it's incorrect. Not all databases on the > target server will receive a subscription. Only those which have the > same name as a database on the sou

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Ashutosh Bapat
On Thu, Mar 20, 2025 at 5:54 PM Amit Kapila wrote: > > * > + > + pg_createsubscriber > + option > + > + > + -a > + --all > + > + > + -D > + --pgdata > + > +datadir > + > + -P > + --publisher-server > + > +connstr > > Most of this

Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET

2025-03-25 Thread David Rowley
On Tue, 25 Mar 2025 at 21:14, Bykov Ivan wrote: > As I can see, your patch has the same idea as my > v2-0001-Query-ID-Calculation-Fix-Variant-B.patch from [1]. > I think it would be better to extract the jumble buffer update with hash > calculation into a function > (CompressJumble in my patch).

RE: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET

2025-03-25 Thread Bykov Ivan
Hello, David! As I can see, your patch has the same idea as my v2-0001-Query-ID-Calculation-Fix-Variant-B.patch from [1]. I think it would be better to extract the jumble buffer update with hash calculation into a function (CompressJumble in my patch). This will result in fewer changes to the s

RE: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Hayato Kuroda (Fujitsu)
Dear Shubham, > The attached patches contain the suggested changes. Thanks for updating the patch. I reviewed only 0001 because they would be committed separately. Few comments: 01. ``` + For every non-template database on the source server, create one + subscription on the target s

Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning

2025-03-25 Thread Amit Langote
On Tue, Mar 25, 2025 at 3:17 PM Ashutosh Bapat wrote: > On Mon, Mar 24, 2025 at 7:23 PM Amit Langote wrote: > > > > Ok, thanks for that analysis. I don't think there's anything about > > the patch that makes it particularly less suitable for pwj=on. > > > > I agree. > > > I read patch 0002 in de

Re: Proposal - Allow extensions to set a Plan Identifier

2025-03-25 Thread Lukas Fittl
On Tue, Mar 25, 2025 at 12:13 AM Michael Paquier wrote: > On Mon, Mar 24, 2025 at 06:47:59PM -0500, Sami Imseih wrote: > > I know it was mentioned above by both Michael and Andrei that > > AppendJumble should not be exposed. I am not sure I agree with > > that. I think it should be exposed, along

Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw

2025-03-25 Thread Etsuro Fujita
On Mon, Mar 3, 2025 at 4:49 PM Tom Lane wrote: > Ashutosh Bapat writes: > > On Sun, Mar 2, 2025 at 5:14 PM Etsuro Fujita > > wrote: > >> To avoid that, I would like to propose a server option, > >> inherit_read_only, to open the remote transactions in read-only mode > >> if the local transactio

Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw

2025-03-25 Thread Etsuro Fujita
On Mon, Mar 3, 2025 at 1:51 PM Ashutosh Bapat wrote: > On Sun, Mar 2, 2025 at 5:14 PM Etsuro Fujita wrote: > > postgres_fdw opens remote transactions in read/write mode in a local > > transaction even if the local transaction is read-only. I noticed > > that this leads to surprising behavior lik

Re: AIO v2.5

2025-03-25 Thread Thomas Munro
On Tue, Mar 25, 2025 at 2:18 PM Andres Freund wrote: > Attached v2.12, with the following changes: Here's a tiny fixup to make io_concurrency=0 turn on READ_BUFFERS_SYNCHRONOUSLY as mooted in a FIXME. Without this, AIO will still run at level 1 even if you asked for 0. Feel free to squash, or i

Re: Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2025-03-25 Thread Peter Eisentraut
On 05.03.25 13:56, Alvaro Herrera wrote: On 2025-Mar-03, Suraj Kharage wrote: Thanks Alvaro for the review and fixup patch. I agree with your changes and merged that into the main patch along with a couple of other changes. Please find attached v6 for further review. Thanks, I have pushed t

Re: Fix 035_standby_logical_decoding.pl race conditions

2025-03-25 Thread Amit Kapila
On Fri, Mar 21, 2025 at 9:48 PM Bertrand Drouvot wrote: > > So, I'm not sure I like the idea that much, but thinking out loud: I wonder if > we could bypass the "active" slot checks in 16 and 17 and use injection > points as > proposed as of 18 (as we need the injection points changes proposed in

Re: Proposal - Allow extensions to set a Plan Identifier

2025-03-25 Thread Sami Imseih
> On 3/25/25 00:47, Sami Imseih wrote: > > I know it was mentioned above by both Michael and Andrei that > > AppendJumble should not be exposed. I am not sure I agree with > > that. I think it should be exposed, along with > > JUMBLE_FIELD, JUMBLE_FIELD_SINGLE and JUMBLE_STRING > > and _jumbleList.

Re: Squash constant lists in query jumbling by default

2025-03-25 Thread Laurenz Albe
On Tue, 2025-03-25 at 17:28 +0100, Christoph Berg wrote: > The "jumble names of temp tables" thread was briefly touching this [1], > I'm starting a new thread since the others are already very long. > > [1] > https://www.postgresql.org/message-id/flat/CAA5RZ0uNofEXfEfNw3uRN3D3oXkFPQ_s%2BhuLLHMKR_

Re: Allow default \watch interval in psql to be configured

2025-03-25 Thread Daniel Gustafsson
> On 24 Mar 2025, at 13:42, Ashutosh Bapat wrote: > LGTM. I think this is RFC. Updated CF entry. Thanks all for review, committed. -- Daniel Gustafsson

Re: AIO v2.5

2025-03-25 Thread Andres Freund
Hi, On 2025-03-25 08:58:08 -0700, Noah Misch wrote: > While having nagging thoughts that we might be releasing FDs before io_uring > gets them into kernel custody, I tried this hack to maximize FD turnover: > > static void > ReleaseLruFiles(void) > { > #if 0 > while (nfile + numAllocatedDes

Re: Statistics Import and Export

2025-03-25 Thread Corey Huinker
> > At this point, I feel I've demonstrated the limit of what can be made into > WARNINGs, giving us a range of options for now and into the beta. I'll > rebase and move the 0002 patch to be in last position so as to tee up > 0003-0004 for consideration. > And here's the rebase (after bde2fb797aae

Re: SQL function which allows to distinguish a server being in point in time recovery mode and an ordinary replica

2025-03-25 Thread m . litsarev
Hi! I felt you might have missed attaching the test patches added at [1]. Well, the tests were written for the initial proposal which (after Michael's review and advices) has been fixed and updated. The original tests became not relevant actually. That is why I dropped them. This change is

Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET

2025-03-25 Thread David Rowley
On Wed, 26 Mar 2025 at 01:11, David Rowley wrote: > I'm happy to proceed with the v7 version. I'm also happy to credit you > as the primary author of it, given that you came up with the v2b > patch. It might be best to extract the performance stuff that's in v7 > and apply that separately from th

Re: Cannot find a working 64-bit integer type on Illumos

2025-03-25 Thread Tom Lane
Thomas Munro writes: > On Wed, Mar 26, 2025 at 10:34 AM Nathan Bossart > wrote: >> In file included from pg_regress.c:34: >> /usr/local/include/libpq-fe.h:623:8: error: unknown type name 'pg_int64' > Looks like it's mixing up /usr/local/include and our source tree... Yeah. That's because the c

Re: query_id: jumble names of temp tables for better pg_stat_statement UX

2025-03-25 Thread Sami Imseih
> If I get the difference right, semantically would apply to concepts > related to linguistics, but that's not what we have here, so you are > using a more general term. FWIW, the pg_stat_statements docs in a few places refer to queries that may look different but have the same meaning as “sem

Re: Query ID Calculation Fix for DISTINCT / ORDER BY and LIMIT / OFFSET

2025-03-25 Thread Michael Paquier
On Wed, Mar 26, 2025 at 11:56:50AM +1300, David Rowley wrote: > Here is the v8 version with the bug fix and performance stuff > separated out. Why not. I assume that you would merge these together? > I also added the Assert code to ensure we always add > something to the jumble buffer when jumbl

Re: AIO v2.5

2025-03-25 Thread Noah Misch
On Tue, Mar 25, 2025 at 08:17:17PM -0400, Andres Freund wrote: > On 2025-03-25 09:15:43 -0700, Noah Misch wrote: > > On Tue, Mar 25, 2025 at 11:57:58AM -0400, Andres Freund wrote: > > > FWIW, I prototyped this, it's not hard. > > > > > > But it can't replace the current WARNING with 100% fidelity:

Re: AIO v2.5

2025-03-25 Thread Noah Misch
On Mon, Mar 24, 2025 at 09:18:06PM -0400, Andres Freund wrote: > Attached v2.12, with the following changes: > TODO: > Wonder if it's worth adding some coverage for when checksums are disabled? > Probably not necessary? Probably not necessary, agreed. Orthogonal to AIO, it's likely worth a

Re: query_id: jumble names of temp tables for better pg_stat_statement UX

2025-03-25 Thread Michael Paquier
On Tue, Mar 25, 2025 at 07:24:20PM -0400, Tom Lane wrote: > fails to honor $query_jumble_ignore as the other if-branches do. > Perhaps it's unlikely that a node would have both query_jumble_custom > and query_jumble_ignore annotations, but still, the script would emit > completely incorrect code if

Re: Proposal: Progressive explain

2025-03-25 Thread Rafael Thofehrn Castro
Hello Robert, Fixed most of the recommendations. Going over one at a time. > The documentation for the progressive_explain = { off | explain | > analyze } option seems like it should go into more detail about how > the "explain" and "analyze" values are different. I'm not 100% sure I > know the a

Squash constant lists in query jumbling by default

2025-03-25 Thread Christoph Berg
Re: Álvaro Herrera > Introduce squashing of constant lists in query jumbling > > pg_stat_statements produces multiple entries for queries like > SELECT something FROM table WHERE col IN (1, 2, 3, ...) > > depending on the number of parameters, because every element of > ArrayExpr is individua

Re: Squash constant lists in query jumbling by default

2025-03-25 Thread Sami Imseih
> > If this GUC sticks around, it should be at least PGC_SUSET (on > > the analogy of compute_query_id) to make it harder to break > > pg_stat_statements that way. > > I have no problem making it superuser-only, and I can see making "on" be > the default. I am not opposed to removing it completely

Re: Statistics Import and Export

2025-03-25 Thread Corey Huinker
> > The original reason we wanted to issue warnings was to allow ourselves > a chance to change the meaning of parameters, add new parameters, or > even remove parameters without causing restore failures. If there are > any ERRORs that might limit our flexibility I think we should downgrade > those

Re: optimize file transfer in pg_upgrade

2025-03-25 Thread Nathan Bossart
On Thu, Mar 20, 2025 at 03:23:13PM -0500, Nathan Bossart wrote: > I'm still aiming to commit this sometime early next week. Committed. Thanks to everyone who chimed in on this thread. While writing the attributions, I noticed that nobody seems to have commented specifically on 0001. The closest

Re: Squash constant lists in query jumbling by default

2025-03-25 Thread Dmitry Dolgov
> > >> On Tue, Mar 25, 2025, 6:28 PM Álvaro Herrera wrote: On 2025-Mar-25, Tom Lane wrote: > If this GUC sticks around, it should be at least PGC_SUSET (on > the analogy of compute_query_id) to make it harder to break > pg_stat_statements that way. I have no problem making it superuser-only,

Re: Statistics Import and Export

2025-03-25 Thread Jeff Davis
On Tue, 2025-03-25 at 10:53 -0400, Corey Huinker wrote: > > So this patch swings the pendulum a bit back towards accepting some > things as errors. Not exactly. I see patch 0001 as a change to the function signatures from regclass to schemaname/relname, both for usability as well as control over

Re: AIO v2.5

2025-03-25 Thread Andres Freund
Hi, On 2025-03-25 13:18:50 -0700, Noah Misch wrote: > On Tue, Mar 25, 2025 at 04:07:35PM -0400, Andres Freund wrote: > > On 2025-03-25 12:39:56 -0700, Noah Misch wrote: > > > On Tue, Mar 25, 2025 at 02:58:37PM -0400, Andres Freund wrote: > > > > There are 2 1/2 ways around this: > > > > > > > > 1

Re: Cannot find a working 64-bit integer type on Illumos

2025-03-25 Thread Thomas Munro
On Wed, Mar 26, 2025 at 10:34 AM Nathan Bossart wrote: > anaconda seems to be upset about this one [0]. I've spent all of 30 > seconds looking at it so far, but it appears to be using an old version of > the header file. > > In file included from pg_regress.c:34: > /usr/local/include/libpq-fe.h:6

Re: Squash constant lists in query jumbling by default

2025-03-25 Thread Dmitry Dolgov
On Tue, Mar 25, 2025, 7:40 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > >>> On Tue, Mar 25, 2025, 6:28 PM Álvaro Herrera > wrote: > > On 2025-Mar-25, Tom Lane wrote: > > > If this GUC sticks around, it should be at least PGC_SUSET (on > > > the analogy of compute_query_id) to make it harder

Re: Cannot find a working 64-bit integer type on Illumos

2025-03-25 Thread Daniel Gustafsson
> On 26 Mar 2025, at 00:01, Tom Lane wrote: > How did that work before? Perhaps somebody just now added a libpq > dependency to pg_regress.c? I believe the libpq dependency came in 66d6086cbcbfc8 which wasn't all that recent. -- Daniel Gustafsson

Re: query_id: jumble names of temp tables for better pg_stat_statement UX

2025-03-25 Thread Michael Paquier
On Tue, Mar 25, 2025 at 11:58:21AM -0500, Sami Imseih wrote: > "Since the queryid hash value is computed on the post-parse-analysis > representation of the queries, the opposite is also possible: queries with > identical texts might appear as separate entries, if they have different > meanings as a

Re: query_id: jumble names of temp tables for better pg_stat_statement UX

2025-03-25 Thread Tom Lane
Michael Paquier writes: > [ v6-0001-Add-custom-query-jumble-function-for-RangeTblEntr.patch ] Couple of minor review comments ... * In 5ac462e2b, this bit: # node type - if (($t =~ /^(\w+)\*$/ or $t =~ /^struct\s+(\w+)\*$/) + if ($query_jumble_custom) + { + #

Re: Advanced Patch Feedback Session / pgconf.dev 2025

2025-03-25 Thread Tomas Vondra
Hi, I'd like to remind people planning to attend pgconf.dev the registration for Advanced Patch Feedback Session closes on Friday (in ~2 days). If you're interested in participating (as a contributor or a committer), please sign up using the forms linked in the announcement. kind regards Tomas O

Re: AIO v2.5

2025-03-25 Thread Noah Misch
On Tue, Mar 25, 2025 at 02:58:37PM -0400, Andres Freund wrote: > On 2025-03-25 08:58:08 -0700, Noah Misch wrote: > > While having nagging thoughts that we might be releasing FDs before io_uring > > gets them into kernel custody, I tried this hack to maximize FD turnover: > > > > static void > > Re

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Euler Taveira
On Tue, Mar 25, 2025, at 8:07 AM, Shubham Khanna wrote: > Apologies for the oversight. I have attached the patches now. Please > find them included here. I started looking at this patch. When I started reading the commit message, I didn't understand why the options that provide names to objects ar

Re: why there is not VACUUM FULL CONCURRENTLY?

2025-03-25 Thread Robert Haas
On Sat, Mar 22, 2025 at 5:43 AM Antonin Houska wrote: > Can you please give me an example? I don't recall seeing a lock upgrade in the > tree. That's the reason I tried rather hard to avoid that. VACUUM has to upgrade the lock in order to truncate away pages at the end of the table. Or just: BEG

Re: [fixed] Trigger test

2025-03-25 Thread Lilian Ontowhee
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: not tested Spec compliant: not tested Documentation:not tested Hi Dmitrii, Paul Jungwirth and I reviewed this patch, and here are our comme

Re: Squash constant lists in query jumbling by default

2025-03-25 Thread Sami Imseih
> At the same time the proposal to do squashing by default > does not seem to be strictly dependent on that, so maybe they could be > considered as isolated ideas. Here is a patch to remove the GUC, if we settle on doing so. -- Sami Imseih Amazon Web Services (AWS) v1-0001-Remove-the-query_id_s

Re: AIO v2.5

2025-03-25 Thread Noah Misch
On Tue, Mar 25, 2025 at 04:07:35PM -0400, Andres Freund wrote: > On 2025-03-25 12:39:56 -0700, Noah Misch wrote: > > On Tue, Mar 25, 2025 at 02:58:37PM -0400, Andres Freund wrote: > > > There are 2 1/2 ways around this: > > > > > > 1) Stop using IOSQE_ASYNC heuristic > > > 2a) Wait for all in-flig

Re: Cannot find a working 64-bit integer type on Illumos

2025-03-25 Thread Nathan Bossart
On Tue, Mar 25, 2025 at 09:41:21PM +1300, Thomas Munro wrote: > On Wed, Mar 5, 2025 at 6:00 AM Peter Eisentraut wrote: >> I agree with your patch 0001-Deprecate-pg_int64.patch. I don't see a >> reason to keep the current arrangement around pg_int64. > > Thanks for looking! Pushed. anaconda see

Re: AIO v2.5

2025-03-25 Thread Noah Misch
On Tue, Mar 25, 2025 at 04:56:53PM -0400, Andres Freund wrote: > The repeated-iteration approach taken in pgaio_closing_fd() isn't the > prettiest, but it's hard to to imagine that ever being a noticeable. Yep. I've reviewed the fixup code, and it looks all good. > This survives a testrun where

Re: Improve CRC32C performance on SSE4.2

2025-03-25 Thread John Naylor
On Mon, Mar 24, 2025 at 6:37 PM John Naylor wrote: > > I'll take a look at the configure > checks soon, since I had some questions there. One other thing I forgot to mention: The previous test function had local constants that the compiler was able to fold, resulting in no actual vector instructi

Re: Improve CRC32C performance on SSE4.2

2025-03-25 Thread John Naylor
On Mon, Mar 24, 2025 at 6:37 PM John Naylor wrote: > I'll take a look at the configure > checks soon, since I had some questions there. I'm leaning towards a length limit for v15-0001 so that inlined instructions are likely to be unrolled. Aside from lack of commit message, I think that one is re

Re: Expanding HOT updates for expression and partial indexes

2025-03-25 Thread Burd, Greg
Apologies for the noise, I overlooked a compiler warning. fixed. -greg > On Mar 25, 2025, at 7:47 AM, Burd, Greg wrote: > > Matthias, > > Rebased patch attached. > > Changes in v14: > * UpdateContext now the location I've stored estate, resultRelInfo, etc. > * Reuse the result from the p

Re: a pool for parallel worker

2025-03-25 Thread Kirill Reshke
On Tue, 11 Mar 2025 at 17:38, Andy Fan wrote: > > > > Hi, > Hi! > Currently when a query needs some parallel workers, postmaster spawns > some backend for this query and when the work is done, the backend > exit. there are some wastage here, e.g. syscache, relcache, smgr cache, > vfd cache and

Re: [Patch] remove duplicated smgrclose

2025-03-25 Thread Masahiko Sawada
On Thu, Mar 13, 2025 at 1:37 AM Steven Niu wrote: > > > > 在 2025/3/12 6:31, Masahiko Sawada 写道: > > On Mon, Mar 10, 2025 at 3:08 AM Steven Niu wrote: > >> > >> > >> > >> Hi, Masahiko > >> > >> Thanks for your comments! I understand your concern as you stated. > >> However, my initial patch was

Re: Proposal - Allow extensions to set a Plan Identifier

2025-03-25 Thread Sami Imseih
> > So this comes down to forking the Postgres code to do the job. What I > had in mind was a slightly different flow, where we would be able to > push custom node attributes between the header parsing and the > generation of the extension code. If we do that, there would be no > need to fork the

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread vignesh C
On Wed, 26 Mar 2025 at 02:05, Euler Taveira wrote: > > On Tue, Mar 25, 2025, at 8:07 AM, Shubham Khanna wrote: > > The following code is not accurate. If I specify --all, --database and > --subscription, it will report only --database. The user will remove it and > run > again. At this time, --su

Re: UUID v7

2025-03-25 Thread Masahiko Sawada
On Sun, Feb 9, 2025 at 9:07 AM Andrey Borodin wrote: > > I've took into account note from Sergey that "offset" is better name for > uuidv7() argument than "shift". > > > On 5 Feb 2025, at 03:02, Masahiko Sawada wrote: > > > >> > >> I was thinking about incorporating test like this. > >> > W

Re: AIO v2.5

2025-03-25 Thread Andres Freund
Hi, On 2025-03-25 09:15:43 -0700, Noah Misch wrote: > On Tue, Mar 25, 2025 at 11:57:58AM -0400, Andres Freund wrote: > > FWIW, I prototyped this, it's not hard. > > > > But it can't replace the current WARNING with 100% fidelity: If we read 60 > > blocks in a single smgrreadv, we today would woul

Re: a pool for parallel worker

2025-03-25 Thread Andy Fan
Hi, >> The boring thing for the pool is it is [dbid + userId] based, which >> I mean if the dbid or userId is different with the connection in pool, >> they can't be reused. To reduce the effect of UserId, I think if we can >> start the pool with a superuser and then switch the user information

Re: Cannot find a working 64-bit integer type on Illumos

2025-03-25 Thread Tom Lane
Daniel Gustafsson writes: >> On 26 Mar 2025, at 00:01, Tom Lane wrote: >> How did that work before? Perhaps somebody just now added a libpq >> dependency to pg_regress.c? > I believe the libpq dependency came in 66d6086cbcbfc8 which wasn't all that > recent. It looks like this has been broken

Doc: Add Table of Contents to psql Reference Page

2025-03-25 Thread David G. Johnston
Hi! IMO, the psql reference has too many non-standard subsections (and too much material in each) to strictly conform to our guidelines for application documentation. It needs a Table of Contents of its own to improve usability. Attached. David J. From c419cd7d32f0b60671cfa652c312c889875031bc M

Possibly hard-to-read message

2025-03-25 Thread Kyotaro Horiguchi
Hello, I came across the following help message added in commit 1a759c83278: + HELP0(" WATCH_INTERVAL\n" + "number of seconds \\watch by default waits between executing the query buffer\n"); It took me a little while to understand it. I read "executing the query buffe

Re: Possibly hard-to-read message

2025-03-25 Thread David G. Johnston
On Tue, Mar 25, 2025 at 8:07 PM Kyotaro Horiguchi wrote: > Hello, > > I came across the following help message added in commit 1a759c83278: > > + HELP0(" WATCH_INTERVAL\n" > + "number of seconds \\watch by default waits between > executing the query buffer\n"); > > It t

Re: a pool for parallel worker

2025-03-25 Thread Andy Fan
Andy Fan writes: > Hi, >>> The boring thing for the pool is it is [dbid + userId] based, which >>> I mean if the dbid or userId is different with the connection in pool, >>> they can't be reused. To reduce the effect of UserId, I think if we can >>> start the pool with a superuser and then swit

Re: query_id: jumble names of temp tables for better pg_stat_statement UX

2025-03-25 Thread Michael Paquier
On Tue, Mar 25, 2025 at 07:56:29PM -0500, Sami Imseih wrote: > FWIW, the pg_stat_statements docs in a few places refer to > queries that may look different but have the same meaning > as “semantically equivalent”, this is why I used the same > terminology here. But, I have no issue with the sim

Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-03-25 Thread Richard Guo
On Wed, Mar 26, 2025 at 3:06 PM Tender Wang wrote: > The comment about notnullattnums in struct RangeTblEntry says that: > * notnullattnums is zero-based set containing attnums of NOT NULL > * columns. > > But in get_relation_notnullatts(): > rte->notnullattnums = bms_add_member(rte->notnullattnu

Re: NOT ENFORCED constraint feature

2025-03-25 Thread Álvaro Herrera
On 2025-Mar-26, Amul Sul wrote: > The reason for the change is to revert to the behavior before commit > #80d7f990496b1c, where recursion occurred regardless of the > changed flags. This is also described in the header comment for > ATExecAlterConstrDeferrability() (earlier it was for > ATExecAlte

Re: Proposal - Allow extensions to set a Plan Identifier

2025-03-25 Thread Michael Paquier
On Tue, Mar 25, 2025 at 04:23:15PM -0500, Sami Imseih wrote: > On 3/25/25 00:47, Sami Imseih wrote: >> 1. Check out the upstream Postgres source for the given version I'm >> generating jumble code for >> 2. Modify the headers as needed to have the node attributes I want >> 3. Call the gen_node_sup

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Amit Kapila
On Wed, Mar 26, 2025 at 2:05 AM Euler Taveira wrote: > > On Tue, Mar 25, 2025, at 8:07 AM, Shubham Khanna wrote: > > Apologies for the oversight. I have attached the patches now. Please > find them included here. > > > I started looking at this patch. When I started reading the commit message, I >

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Amit Kapila
On Tue, Mar 25, 2025 at 5:30 PM Ashutosh Bapat wrote: > > On Thu, Mar 20, 2025 at 5:54 PM Amit Kapila wrote: > > > > * > > + > > + pg_createsubscriber > > + option > > + > > + > > + -a > > + --all > > + > > + > > + -D > > + --pgdata > > + > > +datad

Re: Update LDAP Protocol in fe-connect.c to v3

2025-03-25 Thread Peter Eisentraut
On 23.03.25 04:05, Andrew Jackson wrote: > This is the first complaint I can recall hearing about that, so exactly which ones are "many"? I've tested a 2 before figuring out about the v3 issue. lldap[0] and the docker image osixia/docker-openldap[1]. - lldap  gives the following error message

Re: AIO v2.5

2025-03-25 Thread Andres Freund
Hi, On 2025-03-22 19:09:55 -0700, Noah Misch wrote: > On Thu, Mar 20, 2025 at 09:58:37PM -0400, Andres Freund wrote: > > Attached v2.11 > > > Subject: [PATCH v2.11 05/27] aio: Add io_method=io_uring > > Apart from some isolated cosmetic points, this is ready to commit: > > > + er

Re: pg_recvlogical requires -d but not described on the documentation

2025-03-25 Thread Fujii Masao
On 2025/03/21 10:12, Hayato Kuroda (Fujitsu) wrote: Dear Fujii-san, Thanks for the patch! It looks good to me. I'm considering whether to back-patch these changes to older versions. Since pg_recvlogical --drop-slot worked without --dbname in 9.4 but started failing unintentionally in 9.5, it

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2025-03-25 Thread Michael Paquier
On Mon, Mar 17, 2025 at 10:22:47AM -0700, Jacob Champion wrote: > I looked into switching over to pgstat_report_activity(), but that > wasn't designed to be called in the middle of backend initialization. > It would take more work to make those calls safe/sane when `st_state > == STATE_STARTING`. I

Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-03-25 Thread Richard Guo
On Sun, Mar 23, 2025 at 6:25 PM Richard Guo wrote: > On Sat, Mar 22, 2025 at 2:21 AM Tom Lane wrote: > > The way to make this work is what I said before: move the planner's > > collection of relation information to somewhere a bit earlier in > > the planner. But not to outside the planner. > I'

Re: Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-03-25 Thread Amit Kapila
On Tue, Mar 25, 2025 at 5:24 PM Ashutosh Bapat wrote: > > On Tue, Mar 25, 2025 at 5:15 PM Amit Kapila wrote: > > > > On Tue, Mar 25, 2025 at 5:08 PM Ashutosh Bapat > > wrote: > > > > > > This looks mostly ready except the test changes. I believe when > > > committing, we are going to squash all

Re: NOT ENFORCED constraint feature

2025-03-25 Thread Amul Sul
On Tue, Mar 25, 2025 at 10:18 PM Peter Eisentraut wrote: > > On 21.03.25 06:58, Amul Sul wrote: > > > > [] > > Attached is the updated version, where the commit messages for patch > > 0005 and 0006 have been slightly corrected. Additionally, a few code > > comments have been updated to consist

ALTER COLUMN SET DATA TYPE does not change the generation expression's collation

2025-03-25 Thread jian he
hi. ATPrepAlterColumnType forbids us to ALTER COLUMN SET DATA TYPE USING (expr) for generated columns. however we can still change the generated column type from non-text to text or text type from one collation to another collation. In ATExecAlterColumnType, we also need to set the generation exp

RE: BUG #18815: Logical replication worker Segmentation fault

2025-03-25 Thread Zhijie Hou (Fujitsu)
On Wed, Feb 19, 2025 at 4:38 AM Tom Lane wrote: Hi, > > Here's a completed set of patches for bug #18815 [1] (which, briefly, > is that the logrep worker opens/closes indexes multiple times and > thereby breaks brininsertcleanup). > > 0001 adds a subscriber-side BRIN index to 013_partition.pl

Re: AIO v2.5

2025-03-25 Thread Andres Freund
Hi, On 2025-03-25 12:39:56 -0700, Noah Misch wrote: > On Tue, Mar 25, 2025 at 02:58:37PM -0400, Andres Freund wrote: > > I don't know if that's an intentional or unintentional behavioral > > difference. > > > > There are 2 1/2 ways around this: > > > > 1) Stop using IOSQE_ASYNC heuristic > > 2a

Re: vacuum_truncate configuration parameter and isset_offset

2025-03-25 Thread Nikolay Shaplov
В письме от вторник, 25 марта 2025 г. 17:57:46 MSK пользователь Nathan Bossart написал: > In any case, AFAICT the votes are somewhat evenly divided at the moment, so > I do not intend to proceed with this patch for now. Counting votes does not lead anywhere, as I can ask friends and colleagues t

Re: vacuum_truncate configuration parameter and isset_offset

2025-03-25 Thread Nathan Bossart
On Mon, Mar 24, 2025 at 08:57:27PM -0700, David G. Johnston wrote: > On Mon, Mar 24, 2025 at 11:45 AM Nathan Bossart > wrote: >> * I don't think this matches the parse_bool() behavior exactly. For >> example, parse_bool() appears to accept inputs like "t" to mean "true". >> This is also proba

Re: Add missing PQclear for StreamLogicalLog function

2025-03-25 Thread Daniel Gustafsson
> On 19 Mar 2025, at 11:03, Daniel Gustafsson wrote: > >> On 19 Mar 2025, at 06:38, Steven Niu wrote: > >> During browsing the code, I found one missing PQclear in function >> StreamLogicalLog(). It's a very small problem as it only happens in error >> condition. However since another similar

Re: Squash constant lists in query jumbling by default

2025-03-25 Thread Tom Lane
Christoph Berg writes: > For 2), Tom said that configurability is 1) often much less useful > than originally planned, and 2) tools have to cope with both settings > anyway, making implementing them harder. Plus, switching at run-time > makes the result even less predictable. To clarify that last

Re: NOT ENFORCED constraint feature

2025-03-25 Thread Peter Eisentraut
On 21.03.25 06:58, Amul Sul wrote: I think the next step here is that you work to fix Álvaro's concerns about the recursion structure. Yes, I worked on that in the attached version. I refactored ATExecAlterConstraintInternal() and moved the code that updates the pg_constraint entry into a separ

Re: query_id: jumble names of temp tables for better pg_stat_statement UX

2025-03-25 Thread Sami Imseih
> > Attached is the second one, with more tests coverage with attribute > > aliases (these being ignored exists in stable branches, but why not > > while on it) and table aliases, and the fixes for the issues pointed > > out by Christoph. I'll double-check all that again tomorrow. Please > > find

Re: query_id: jumble names of temp tables for better pg_stat_statement UX

2025-03-25 Thread Christoph Berg
Re: Michael Paquier > Attached is the second one, with more tests coverage with attribute > aliases (these being ignored exists in stable branches, but why not > while on it) and table aliases, and the fixes for the issues pointed > out by Christoph. I'll double-check all that again tomorrow. Plea

Re: AIO v2.5

2025-03-25 Thread Andres Freund
Hi, On 2025-03-25 17:10:19 +1300, Thomas Munro wrote: > On Tue, Mar 25, 2025 at 2:18 PM Andres Freund wrote: > > Attached v2.12, with the following changes: > > Here's a tiny fixup to make io_concurrency=0 turn on > READ_BUFFERS_SYNCHRONOUSLY as mooted in a FIXME. Without this, AIO > will still

Re: AIO v2.5

2025-03-25 Thread Noah Misch
On Tue, Mar 25, 2025 at 11:57:58AM -0400, Andres Freund wrote: > On 2025-03-25 07:11:20 -0700, Noah Misch wrote: > > On Mon, Mar 24, 2025 at 10:52:19PM -0400, Andres Freund wrote: > > > If we want to implement it, I think we could introduce PGAIO_RS_WARN, > > > which > > > then could tell the stag

Re: AIO v2.5

2025-03-25 Thread Andres Freund
Hi, On 2025-03-25 06:33:21 -0700, Noah Misch wrote: > On Mon, Mar 24, 2025 at 10:30:27PM -0400, Andres Freund wrote: > > On 2025-03-24 17:45:37 -0700, Noah Misch wrote: > > > (We may be due for a test mode that does smgrreleaseall() at every > > > CHECK_FOR_INTERRUPTS()?) > > > > I suspect we are.

  1   2   >