Re: pg_basebackup: Always return valid temporary slot names

2023-09-05 Thread Nishant Sharma
On Tue, Sep 5, 2023 at 4:40 PM Jelte Fennema wrote: > I modified the PgBouncer PR to always set the sign bit to 0. But I > still I think it makes sense to also address this in pg_basebackup. Sounds good to me. Thank you! On Tue, Sep 5, 2023 at 5:36 PM Daniel Gustafsson wrote: > Since the

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-05 Thread Zhijie Hou (Fujitsu)
On Wednesday, September 6, 2023 11:18 AM Zhijie Hou (Fujitsu) wrote: > > On Tuesday, September 5, 2023 3:35 PM Kuroda, Hayato/黒田 隼人 > wrote: > > 4. > + * XXX: As mentioned in comments atop get_output_plugins(), we may > not > + * have to consider the uniqueness of entries. If so, we

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-05 Thread Peter Smith
On Tue, Sep 5, 2023 at 7:34 PM Hayato Kuroda (Fujitsu) wrote: > > Also, for simplifying codes, only a first-met invalidated slot is output in > the > check_old_cluster_for_valid_slots(). Warning messages int the function were > removed. I think it may be enough because

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-05 Thread Peter Smith
Hi, here are some comments for patch v31-0002. == src/bin/pg_upgrade/controldata.c 1. get_control_data + if (GET_MAJOR_VERSION(cluster->major_version) >= 1700) + { + bool have_error = false; + + p = strchr(p, ':'); + + if (p == NULL || strlen(p) <= 1) + pg_fatal("%d: controldata retrieval

[Regression] Incorrect filename in test case comment

2023-09-05 Thread Suraj Kharage
Hi, While browsing the test cases, found that the incorrect filename was there in the test case comment. The below commit added the custom hash opclass in insert.sql, -- *commit fafec4cce814b9b15991b62520dc5e5e84655a8aAuthor: Alvaro

Re: Eager page freeze criteria clarification

2023-09-05 Thread Andres Freund
Hi, On 2023-08-28 12:26:01 -0400, Robert Haas wrote: > On Mon, Aug 28, 2023 at 10:00 AM Melanie Plageman > wrote: > > For the second goal, I've relied on past data to predict future > > behavior, so I tried several criteria to estimate the likelihood that a > > page will not be imminently

Re: Autogenerate some wait events code and documentation

2023-09-05 Thread Drouvot, Bertrand
Hi, On 9/6/23 5:44 AM, Michael Paquier wrote: On Wed, Sep 06, 2023 at 04:20:23AM +0200, Erik Wienhold wrote: FYI: https://en.wikipedia.org/wiki/Sentence_spacing That was an interesting read. Thanks. +1, thanks! Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source

Re: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread Dilip Kumar
On Wed, Sep 6, 2023 at 9:47 AM Amit Kapila wrote: > > On Tue, Sep 5, 2023 at 6:00 PM Dilip Kumar wrote: > > Right, it can change and in that case, the check related to > confirm_flush LSN will fail during the upgrade. However, the point is > that if we don't take spinlock, we need to properly

Re: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread Amit Kapila
On Tue, Sep 5, 2023 at 6:00 PM Dilip Kumar wrote: > > On Tue, Sep 5, 2023 at 5:04 PM Zhijie Hou (Fujitsu) > wrote: > > > > > > Can't we just have code like this? I mean we will have to make > > > ReplicationSlotMarkDirty take slot as an argument or have another version > > > which takes slot as

Re: document the need to analyze partitioned tables

2023-09-05 Thread Laurenz Albe
Sorry for dropping the ball on this; I'll add it to the next commitfest. On Wed, 2023-01-25 at 21:43 +1300, David Rowley wrote: > > I think your first sentence it a bit clumsy and might be streamlined to > > > >   Partitioned tables do not directly store tuples and consequently do not > >  

Re: Autogenerate some wait events code and documentation

2023-09-05 Thread Michael Paquier
On Wed, Sep 06, 2023 at 04:20:23AM +0200, Erik Wienhold wrote: > FYI: https://en.wikipedia.org/wiki/Sentence_spacing That was an interesting read. Thanks. -- Michael signature.asc Description: PGP signature

Re: Autogenerate some wait events code and documentation

2023-09-05 Thread Michael Paquier
On Tue, Sep 05, 2023 at 11:06:36AM +0200, Drouvot, Bertrand wrote: > Also, v5 needs a rebase due to f691f5b80a. > > Attaching v6 taking care of the 2 points mentioned above. Thanks. This time I have correctly checked the consistency of the data produced across all these commits using

Re: information_schema and not-null constraints

2023-09-05 Thread Tom Lane
Vik Fearing writes: > On 9/6/23 02:53, Tom Lane wrote: >> What solution do you propose? Starting to enforce the spec's rather >> arbitrary requirement that constraint names be unique per-schema is >> a complete nonstarter. Changing the set of columns in a spec-defined >> view is also a

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-05 Thread Zhijie Hou (Fujitsu)
On Tuesday, September 5, 2023 3:35 PM Kuroda, Hayato/黒田 隼人 wrote: > > Dear Hou-san, > > > Based on this, it’s possible that the slots we get each time when > > checking wal_status are different, because they may get changed in between > these checks. > > This may not cause serious problems for

Re: Disabling Heap-Only Tuples

2023-09-05 Thread Laurenz Albe
On Wed, 2023-08-30 at 09:31 -0400, Robert Haas wrote: > On Wed, Aug 30, 2023 at 9:01 AM Matthias van de Meent > wrote: > > I've reworked the patch a bit to remove the "excessive bloat with low > > fillfactors when local space is available" issue that this parameter > > could cause - local updates

Re: Improve heapgetpage() performance, overhead from serializable

2023-09-05 Thread John Naylor
On Wed, Sep 6, 2023 at 1:38 AM Andres Freund wrote: > > > I think that makes it less likely that the compiler actually generates a > > > constant-folded version for each of the branches. Perhaps worth some > > > experimentation. > > > > Combining this way doesn't do so for me. > > Are you saying

Re: psql - pager support - using invisible chars for signalling end of report

2023-09-05 Thread Thomas Munro
On Sat, Apr 25, 2020 at 3:53 PM Pavel Stehule wrote: > so 25. 4. 2020 v 2:12 odesílatel Tom Lane napsal: >> Pavel Stehule writes: >> > pá 24. 4. 2020 v 21:33 odesílatel Tom Lane napsal: >> >> And what will happen when those characters are in the data? >> >> > It will be used on pager side as

Re: information_schema and not-null constraints

2023-09-05 Thread Vik Fearing
On 9/6/23 02:53, Tom Lane wrote: Vik Fearing writes: On 9/6/23 00:14, David G. Johnston wrote: I'm not all that for either A or B since the status quo seems workable. Pray tell, how is it workable? The view does not identify a specific constraint because we don't obey the rules on one

Re: Autogenerate some wait events code and documentation

2023-09-05 Thread Erik Wienhold
On 05/09/2023 13:50 CEST Michael Paquier wrote: > On Tue, Sep 05, 2023 at 11:06:36AM +0200, Drouvot, Bertrand wrote: > > Oh ok, out of curiosity, why are 2 whitespaces intentional? > > That depends on the individual who write the code, but I recall that > this is some old-school style from the

Re: RFC: Logging plan of the running query

2023-09-05 Thread James Coleman
On Tue, Sep 5, 2023 at 9:59 AM torikoshia wrote: > > On 2023-08-28 22:47, James Coleman wrote: > > On Mon, Aug 28, 2023 at 3:01 AM torikoshia > > wrote: > >> > >> On 2023-08-26 21:03, James Coleman wrote: > >> > On Fri, Aug 25, 2023 at 7:43 AM James Coleman wrote: > >> >> > >> >> On Thu, Aug

Re: information_schema and not-null constraints

2023-09-05 Thread Tom Lane
Vik Fearing writes: > On 9/6/23 00:14, David G. Johnston wrote: >> I'm not all that for either A or B since the status quo seems workable. > Pray tell, how is it workable? The view does not identify a specific > constraint because we don't obey the rules on one side and we do obey > the rules

Re: should frontend tools use syncfs() ?

2023-09-05 Thread Nathan Bossart
I've committed 0001 for now. I plan to commit the rest in the next couple of days. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Replace known_assigned_xids_lck by memory barrier

2023-09-05 Thread Michail Nikolaev
Thanks everyone for help!

Re: information_schema and not-null constraints

2023-09-05 Thread Vik Fearing
On 9/6/23 00:14, David G. Johnston wrote: I'm not all that for either A or B since the status quo seems workable. Pray tell, how is it workable? The view does not identify a specific constraint because we don't obey the rules on one side and we do obey the rules on the other side. It is

Re: sandboxing untrusted code

2023-09-05 Thread Jeff Davis
On Tue, 2023-09-05 at 12:25 -0400, Robert Haas wrote: > I think I've more or less answered this already -- fully sandboxed > code can't make reference to external data sources, from which it > follows that it can't exercise SELECT (and most other privileges). By what principle are we allowing

Re: information_schema and not-null constraints

2023-09-05 Thread David G. Johnston
On Tue, Sep 5, 2023 at 2:50 PM Vik Fearing wrote: > On 9/5/23 19:15, Alvaro Herrera wrote: > > On 2023-Sep-05, Alvaro Herrera wrote: > > > > Looking now at what to do for CHECK_CONSTRAINTS with domain constraints, > > I admit I'm completely confused about what this view is supposed to > > show.

Re: information_schema and not-null constraints

2023-09-05 Thread Vik Fearing
On 9/5/23 19:15, Alvaro Herrera wrote: On 2023-Sep-05, Alvaro Herrera wrote: Looking now at what to do for CHECK_CONSTRAINTS with domain constraints, I admit I'm completely confused about what this view is supposed to show. Currently, we show the constraint name and a definition like "CHECK

Re: Add 'worker_type' to pg_stat_subscription

2023-09-05 Thread Nathan Bossart
On Wed, Sep 06, 2023 at 09:02:21AM +1200, Peter Smith wrote: > On Sat, Sep 2, 2023 at 7:41 AM Nathan Bossart > wrote: >> I see that the table refers to "leader apply workers". Would those show up >> as parallel apply workers in the view? Can we add another worker type for >> those? > >

Re: Initdb-time block size specification

2023-09-05 Thread Hannu Krosing
Sure, I was just hoping that somebody already knew without needing to specifically check :) And as I see in David's response, the tests are actually broken for other sizes. I'll see if I can (convince somebody to) set this up . Cheers Hannu On Tue, Sep 5, 2023 at 10:23 PM Andres Freund wrote:

Re: Replace known_assigned_xids_lck by memory barrier

2023-09-05 Thread Nathan Bossart
On Fri, Sep 01, 2023 at 03:53:54PM -0400, Robert Haas wrote: > I'm not an expert on this code but I looked at this patch briefly and > it seems OK to me. Thanks for taking a look. Committed. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Add 'worker_type' to pg_stat_subscription

2023-09-05 Thread Peter Smith
On Sat, Sep 2, 2023 at 7:41 AM Nathan Bossart wrote: Thanks for your interest in this patch. > Is there any reason not to spell out the names? I think that would match > the other system views better (e.g., backend_type in pg_stat_activity). I had thought it might be simpler in case someone

Re: Initdb-time block size specification

2023-09-05 Thread David Christensen
On Tue, Sep 5, 2023 at 2:52 PM Hannu Krosing wrote: > > Something I also asked at this years Unconference - Do we currently > have Build Farm animals testing with different page sizes ? > > I'd say that testing all sizes from 4KB up (so 4, 8, 16, 32) should be > done at least before each release

Fix some wording in WAL docs

2023-09-05 Thread Tristan Partin
I was reading through the page and noticed this portion which didn't sound quite right. I am hoping that I captured the original intent correctly. Please let me know if something should be changed and/or reflowed, since I am not sure what best practices are when editing the docs. I did notice

Re: Initdb-time block size specification

2023-09-05 Thread Andres Freund
Hi, On 2023-09-05 21:52:18 +0200, Hannu Krosing wrote: > Something I also asked at this years Unconference - Do we currently > have Build Farm animals testing with different page sizes ? You can check that yourself as easily as anybody else. Greetings, Andres Freund

Re: pg_upgrade fails with in-place tablespace[

2023-09-05 Thread Robert Haas
On Mon, Sep 4, 2023 at 11:29 PM Rui Zhao wrote: > Thank you for your response. It is evident that there is a need > for this features in our system. > Firstly, our customers express their desire to utilize tablespaces > for table management, without necessarily being concerned about > the

Re: Initdb-time block size specification

2023-09-05 Thread Hannu Krosing
Something I also asked at this years Unconference - Do we currently have Build Farm animals testing with different page sizes ? I'd say that testing all sizes from 4KB up (so 4, 8, 16, 32) should be done at least before each release if not continuously. -- Cheers Hannu On Tue, Sep 5, 2023 at

Re: [17] CREATE SUBSCRIPTION ... SERVER

2023-09-05 Thread Jeff Davis
On Mon, 2023-09-04 at 18:01 +0530, Ashutosh Bapat wrote: > Why do we need to re-check parameters constantly? We will need to > restart subscriptions which are using the user mapping of FDW when > user mapping or server options change. "Constantly" was an exaggeration, but the point is that it's a

Re: Improve heapgetpage() performance, overhead from serializable

2023-09-05 Thread Andres Freund
Hi, On 2023-09-05 14:42:57 +0700, John Naylor wrote: > On Mon, Jul 17, 2023 at 9:58 PM Andres Freund wrote: > > > FWIW, there's more we can do, with some hacky changes I got the time down > to > > 273.261, but the tradeoffs start to be a bit more complicated. And > 397->320ms > > for something

Re: How to add a new pg oid?

2023-09-05 Thread David G. Johnston
On Tue, Sep 5, 2023, 11:17 jacktby jacktby wrote: > > > 2023年9月5日 22:29,jacktby jacktby 写道: > > > I’m trying to add a new data type for my pg. How to do that? Can you give > me more details or an example > Use create type and let the system deal with it. Otherwise, no, I don't have that

Re: Unlogged relation copy is not fsync'd

2023-09-05 Thread Robert Haas
On Fri, Aug 25, 2023 at 8:47 AM Heikki Linnakangas wrote: > 1. Create an unlogged table > 2. ALTER TABLE unlogged_tbl SET TABLESPACE ... -- This calls > RelationCopyStorage > 3. a checkpoint happens while the command is running > 4. After the ALTER TABLE has finished, shut down postgres cleanly.

Re: How to add a new pg oid?

2023-09-05 Thread David G. Johnston
OIDs don't exist independently of the data they are associated with. Give more context if you want a better answer. Or just go look at the source code commits for when the last time something needing an OID got added to the core catalog. David J.

Re: missing privilege check after not-null constraint rework

2023-09-05 Thread Alvaro Herrera
On 2023-Sep-05, Alvaro Herrera wrote: > Here's a fix to move the privilege check on constraint dropping from > ATExecDropConstraint to dropconstraint_internal. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "No renuncies a nada. No te aferres a nada." >From

missing privilege check after not-null constraint rework

2023-09-05 Thread Alvaro Herrera
Here's a fix to move the privilege check on constraint dropping from ATExecDropConstraint to dropconstraint_internal. The former doesn't recurse anymore, so there's no point in doing that or in fact even having the 'recursing' argument anymore. This fixes the following test case CREATE ROLE

Re: Opportunistically pruning page before update

2023-09-05 Thread Melanie Plageman
On Wed, Jun 21, 2023 at 8:51 AM James Coleman wrote: > While at PGCon I was chatting with Andres (and I think Peter G. and a > few others who I can't remember at the moment, apologies) and Andres > noted that while we opportunistically prune a page when inserting a > tuple (before deciding we

Re: Create shorthand for including all extra tests

2023-09-05 Thread Nazir Bilal Yavuz
Hi, Thanks for the feedback! I updated the patch, 'needs-private-lo' option enables kerberos, ldap, load_balance and ssl extra tests now. > On Mon, Sep 04, 2023 at 04:30:31PM -0400, Tom Lane wrote: > > Yeah, I could live with something like that from the security standpoint. > > Not sure if it

Re: information_schema and not-null constraints

2023-09-05 Thread Alvaro Herrera
On 2023-Sep-05, Alvaro Herrera wrote: > After looking at what happens for domain constraints in older versions > (I tested 15, but I suppose this applies everywhere), I notice that we > don't seem to handle them anywhere that I can see. My quick exercise is > just > > create domain nnint as int

Re: A minor adjustment to get_cheapest_path_for_pathkeys

2023-09-05 Thread Robert Haas
On Tue, Sep 5, 2023 at 12:05 PM Aleksander Alekseev wrote: > Now when we continue reviewing the patch, could you please elaborate a > bit on why you think it's worth committing? Well, why not? The test he's proposing to move earlier doesn't involve calling a function, so it should be cheaper

Re: PATCH: document for regression test forgets libpq test

2023-09-05 Thread Bruce Momjian
On Fri, Sep 1, 2023 at 08:01:47AM +, Ryo Matsumura (Fujitsu) wrote: > Hi, > > I found a small mistake in document in 33.1.3. Additional Test Suites. > > > The additional tests that can be invoked this way include: > The list doesn't include interface/libpq/test. > > I attached patch. Yes,

Re: How to add a new pg oid?

2023-09-05 Thread Matthias van de Meent
On Tue, 5 Sept 2023 at 18:13, jacktby jacktby wrote: > > I’m trying to add a new data type for my pg. How to do that? Can you give me > more details or an example? You could get started by looking at the documentation on custom SQL types with

Re: sandboxing untrusted code

2023-09-05 Thread Robert Haas
On Fri, Sep 1, 2023 at 5:27 PM Jeff Davis wrote: > Which privileges are available in a sandboxed environment, exactly? Is > it kind of like masking away all privileges except EXECUTE, or are > other privileges available, like SELECT? I think I've more or less answered this already -- fully

Re: information_schema and not-null constraints

2023-09-05 Thread Alvaro Herrera
On 2023-Sep-05, Peter Eisentraut wrote: > The following information schema views are affected by the not-null > constraint catalog entries: > > 1. CHECK_CONSTRAINTS > 2. CONSTRAINT_COLUMN_USAGE > 3. DOMAIN_CONSTRAINTS > 4. TABLE_CONSTRAINTS > > Note that 1 and 3 also contain domain constraints.

Re: A minor adjustment to get_cheapest_path_for_pathkeys

2023-09-05 Thread Aleksander Alekseev
Hi, > > I think this patch is a good idea and should be committed. > > No problem, changing status back to "Needs review". Now when we continue reviewing the patch, could you please elaborate a bit on why you think it's worth committing? -- Best regards, Aleksander Alekseev

Re: A minor adjustment to get_cheapest_path_for_pathkeys

2023-09-05 Thread Aleksander Alekseev
Hi Robert, > I don't think that's the correct conclusion. You said here that you > didn't think the patch was valuable. Then you said the same thing over > there. You agreeing with yourself is not a consensus. The word "consensus" was a poor choice for sure. The fact that I suggested to reject

Re: Make psql's qeury canceling test simple by using signal() routine of IPC::Run

2023-09-05 Thread Yugo NAGATA
On Mon, 14 Aug 2023 23:37:25 +0900 Yugo NAGATA wrote: > On Mon, 14 Aug 2023 08:29:25 +0900 > Michael Paquier wrote: > > > On Sun, Aug 13, 2023 at 11:22:33AM +0200, Fabien COELHO wrote: > > > Test run is ok on my Ubuntu laptop. > > > > I have a few comments about this patch. > > > > On HEAD

Re: cataloguing NOT NULL constraints

2023-09-05 Thread Alvaro Herrera
On 2023-Sep-05, Peter Eisentraut wrote: > The following information schema views are affected by the not-null > constraint catalog entries: > > 1. CHECK_CONSTRAINTS > 2. CONSTRAINT_COLUMN_USAGE > 3. DOMAIN_CONSTRAINTS > 4. TABLE_CONSTRAINTS > > Note that 1 and 3 also contain domain constraints.

Re: GUC for temporarily disabling event triggers

2023-09-05 Thread Robert Haas
On Tue, Sep 5, 2023 at 8:12 AM Daniel Gustafsson wrote: > > On 6 Apr 2023, at 00:06, Michael Paquier wrote: > > If there is no strong > > case for more than a boolean for now, simpler is better. > > The attached version of the patch replaces it with a boolean flag for turning > off all event

Re: SLRUs in the main buffer pool - Page Header definitions

2023-09-05 Thread Robert Haas
On Thu, Aug 24, 2023 at 3:28 PM Stephen Frost wrote: > Agreed that we'd certainly want to make sure it's all correct and to do > performance testing but in terms of how many buffers... isn't much of > the point of this that we have data in memory because it's being used > and if it's not then we

Re: A minor adjustment to get_cheapest_path_for_pathkeys

2023-09-05 Thread Robert Haas
On Mon, Sep 4, 2023 at 10:17 AM Aleksander Alekseev wrote: > During the triage of the patches submitted for the September CF a > consensus was reached [1] to mark this patch as Rejected. I don't think that's the correct conclusion. You said here that you didn't think the patch was valuable. Then

Re: How to add a new pg oid?

2023-09-05 Thread jacktby jacktby
> 2023年9月5日 22:29,jacktby jacktby 写道: > I’m trying to add a new data type for my pg. How to do that? Can you give me more details or an example?

Re: trying again to get incremental backup

2023-09-05 Thread Robert Haas
On Mon, Sep 4, 2023 at 8:42 AM Dilip Kumar wrote: > Can't we think of comparing at the block level, like we can compare > each block but ignore the content of the hole? We could do that, but I don't think that's a full solution. I think I'd end up having to reimplement the equivalent of

Re: generic plans and "initial" pruning

2023-09-05 Thread Robert Haas
On Tue, Sep 5, 2023 at 3:13 AM Amit Langote wrote: > Attached 0001 removes unnecessary cleanup calls from ExecEnd*() routines. It also adds a few random Assert()s to verify that unrelated pointers are not NULL. I suggest that it shouldn't do that. The commit message doesn't mention the removal

Re: [RFC] Add jit deform_counter

2023-09-05 Thread Daniel Gustafsson
> On 14 Aug 2023, at 16:36, Dmitry Dolgov <9erthali...@gmail.com> wrote: > And here is it. The json version of EXPLAIN now looks like this: > > "JIT": { > [...] > "Timing": { > "Generation": { > "Deform": 0.000, > "Total": 0.205 > }, >

Re: Initdb-time block size specification

2023-09-05 Thread David Christensen
On Tue, Sep 5, 2023 at 9:04 AM Robert Haas wrote: > > On Sat, Sep 2, 2023 at 3:09 PM Tomas Vondra > wrote: > > Except that no one is forcing you to actually go 130mph or 32mph, right? > > You make it seem like this patch forces people to use some other page > > size, but that's clearly not what

How to add a new pg oid?

2023-09-05 Thread jacktby jacktby

Re: Initdb-time block size specification

2023-09-05 Thread Robert Haas
On Sat, Sep 2, 2023 at 3:09 PM Tomas Vondra wrote: > Except that no one is forcing you to actually go 130mph or 32mph, right? > You make it seem like this patch forces people to use some other page > size, but that's clearly not what it's doing - it gives you the option > to use smaller or larger

Re: RFC: Logging plan of the running query

2023-09-05 Thread torikoshia
On 2023-08-28 22:47, James Coleman wrote: On Mon, Aug 28, 2023 at 3:01 AM torikoshia wrote: On 2023-08-26 21:03, James Coleman wrote: > On Fri, Aug 25, 2023 at 7:43 AM James Coleman wrote: >> >> On Thu, Aug 17, 2023 at 10:02 AM torikoshia >> wrote: >> > >> > On 2023-06-16 01:34, James

Re: XLog size reductions: smaller XLRec block header for PG17

2023-09-05 Thread Aleksander Alekseev
Hi, I noticed that the patch needs review and decided to take a look. > No meaningful savings in the pgbench workload, mostly due to xlog > record length MAXALIGNs currently not being favorable in the pgbench > workload. But, record sizes have dropped by 1 or 2 bytes in several > cases, as can

Re: Extract numeric filed in JSONB more effectively

2023-09-05 Thread jian he
On Mon, Sep 4, 2023 at 10:35 PM Andy Fan wrote: > > Hi, > > v13 attached. Changes includes: > > 1. fix the bug Jian provides. > 2. reduce more code duplication without DirectFunctionCall. > 3. add the overlooked jsonb_path_query and jsonb_path_query_first as > candidates > > > -- > Best

Re: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread Dilip Kumar
On Tue, Sep 5, 2023 at 5:04 PM Zhijie Hou (Fujitsu) wrote: > > > Can't we just have code like this? I mean we will have to make > > ReplicationSlotMarkDirty take slot as an argument or have another version > > which takes slot as an argument and that would be called by us as well as by > >

Re: GUC for temporarily disabling event triggers

2023-09-05 Thread Daniel Gustafsson
> On 6 Apr 2023, at 00:06, Michael Paquier wrote: > If there is no strong > case for more than a boolean for now, simpler is better. The attached version of the patch replaces it with a boolean flag for turning off all event triggers, and I also renamed it to the debug_xxx "GUC namespace" which

Re: pg_basebackup: Always return valid temporary slot names

2023-09-05 Thread Daniel Gustafsson
> On 5 Sep 2023, at 12:21, Jelte Fennema wrote: > > On Tue, 5 Sept 2023 at 11:39, Daniel Gustafsson wrote: >> >>> On 5 Sep 2023, at 09:09, Nishant Sharma >>> wrote: >> >>> With this, I was thinking, isn't this a problem of pgbouncer filling >>> be_pid with random bits? Maybe it should have

Re: Commitfest 2023-09 starts soon

2023-09-05 Thread Aleksander Alekseev
Hi, > I think it would be better to just remove the "consensus" part of your > mail, and just put down the real reason why each patch is being RfC-ed > or rejected. That is, don't imply that there are hackers that OK-ed it > when there are none, and inform patch authors directly about the >

Re: Autogenerate some wait events code and documentation

2023-09-05 Thread Michael Paquier
On Tue, Sep 05, 2023 at 11:06:36AM +0200, Drouvot, Bertrand wrote: > Oh ok, out of curiosity, why are 2 whitespaces intentional? That depends on the individual who write the code, but I recall that this is some old-school style from the 70's and/or the 80's when typing machines were still

RE: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread Zhijie Hou (Fujitsu)
On Tuesday, September 5, 2023 4:15 PM Dilip Kumar wrote: Hi, > > On Tue, Sep 5, 2023 at 10:12 AM Amit Kapila > wrote: > > > > On Tue, Sep 5, 2023 at 7:54 AM Zhijie Hou (Fujitsu) > > wrote: > > > > > > On Monday, September 4, 2023 6:15 PM vignesh C > wrote: > > > > > > > > On Mon, 4 Sept

Re: cataloguing NOT NULL constraints

2023-09-05 Thread Peter Eisentraut
On 31.08.23 12:02, Alvaro Herrera wrote: In constraint_column_usage, you're adding a relkind to the catalog scan that goes through pg_depend for CHECK constraints. Here we can rely on a simple conkey[1] check and a separate UNION ALL arm[q5]; this is also faster when there are many tables. The

Re: proposal: psql: show current user in prompt

2023-09-05 Thread Jelte Fennema
On Tue, 5 Sept 2023 at 05:50, Pavel Stehule wrote: > I prefer to introduce a new function - it is ten lines of code. The form is > not important - it can be a full number or minor number. It doesn't matter I > think. But my opinion in this area is not strong, and I like to see feedback > from

Re: pg_basebackup: Always return valid temporary slot names

2023-09-05 Thread Jelte Fennema
I modified the PgBouncer PR to always set the sign bit to 0. But I still I think it makes sense to also address this in pg_basebackup. On Tue, 5 Sept 2023 at 12:21, Jelte Fennema wrote: > > On Tue, 5 Sept 2023 at 11:39, Daniel Gustafsson wrote: > > > > > On 5 Sep 2023, at 09:09, Nishant Sharma

Re: Should consider materializing the cheapest inner path in consider_parallel_nestloop()

2023-09-05 Thread Richard Guo
On Tue, Sep 5, 2023 at 4:52 PM tender wang wrote: >I recently run benchmark[1] on master, but I found performance problem > as below: > ... > > I debug the code and find consider_parallel_nestloop() doesn't consider > materialized form of the cheapest inner path. > Yeah, this seems an

Re: Improving the heapgetpage function improves performance in common scenarios

2023-09-05 Thread John Naylor
On Tue, Sep 5, 2023 at 4:27 PM Quan Zongliang wrote: > Here's how I test it > EXPLAIN ANALYZE SELECT * FROM orders; Note that EXPLAIN ANALYZE has quite a bit of overhead, so it's not good for these kinds of tests. > I'll also try Andres Freund's test method next. Commit f691f5b80a85 from

whether to unlink the existing state.tmp file in SaveSlotToPath

2023-09-05 Thread Sergei Kornilov
Hello I encountered a very lucky logical decoding error on the publisher: 2023-09-05 09:58:38.955 UTC 28316 melkij@postgres from [local] [vxid:3/0 txid:0] [START_REPLICATION] LOG: starting logical decoding for slot "pubsub" 2023-09-05 09:58:38.955 UTC 28316 melkij@postgres from [local]

Remove unnecessary 'always:' from CompilerWarnings task

2023-09-05 Thread Nazir Bilal Yavuz
Hi, There are multiple 'always:' keywords under the CompilerWarnings task. Instead of that, we can use one 'always:' and move the instructions under this. So, I removed unnecessary ones and rearranged indents according to that change. Any kind of feedback would be appreciated. Regards, Nazir

Re: pg_basebackup: Always return valid temporary slot names

2023-09-05 Thread Jelte Fennema
On Tue, 5 Sept 2023 at 11:39, Daniel Gustafsson wrote: > > > On 5 Sep 2023, at 09:09, Nishant Sharma > > wrote: > > > With this, I was thinking, isn't this a problem of pgbouncer filling > > be_pid with random bits? Maybe it should have filled the be_pid > > with a random positive integer

Re: Should consider materializing the cheapest inner path in consider_parallel_nestloop()

2023-09-05 Thread tender wang
After using patch, the result as below : QUERY PLAN Limit (cost=1078.00..26630101.20

Re: Optionally using a better backtrace library?

2023-09-05 Thread Alvaro Herrera
On 2023-Sep-04, Noah Misch wrote: > On Mon, Jul 03, 2023 at 11:58:25AM +0200, Alvaro Herrera wrote: > > Agreed, these backtraces are pretty close to useless. Not completely, > > but I haven't found a practical way to use them for actual debugging > > of production problems. > > For what it's

Re: pg_basebackup: Always return valid temporary slot names

2023-09-05 Thread Daniel Gustafsson
> On 5 Sep 2023, at 09:09, Nishant Sharma > wrote: > With this, I was thinking, isn't this a problem of pgbouncer filling > be_pid with random bits? Maybe it should have filled the be_pid > with a random positive integer instead of any integer as it > represents a pid? I'm inclined to agree

Re: logfmt and application_context

2023-09-05 Thread Daniel Gustafsson
> On 30 Aug 2023, at 14:36, Étienne BERSAC wrote: > ..what do you think of having logfmt output along json and CSV ? logfmt is widely supported by log ingestion and analysis tools, and have been for a long enoug time (IMHO) to be called mature, which is good. Less ideal is that there is no

Re: Improving the heapgetpage function improves performance in common scenarios

2023-09-05 Thread Quan Zongliang
On 2023/9/5 16:15, John Naylor wrote: On Thu, Aug 24, 2023 at 5:55 PM Quan Zongliang > wrote: > In the function heapgetpage. If a table is not updated very frequently. > Many actions in tuple loops are superfluous. For all_visible pages, > loctup does not

Re: Autogenerate some wait events code and documentation

2023-09-05 Thread Drouvot, Bertrand
Hi, On 9/5/23 7:44 AM, Michael Paquier wrote: On Mon, Sep 04, 2023 at 02:14:58PM +0200, Drouvot, Bertrand wrote: # Build the descriptions. There are in camel-case. # LWLock and Lock classes do not need any modifications. Nit: 2 whitespaces before "There are in camel" The

Should consider materializing the cheapest inner path in consider_parallel_nestloop()

2023-09-05 Thread tender wang
Hi all, I recently run benchmark[1] on master, but I found performance problem as below: explain analyze select subq_0.c0 as c0, subq_0.c1 as c1, subq_0.c2 as c2 from (select ref_0.l_shipmode as c0, sample_0.l_orderkey as c1, sample_0.l_quantity as c2,

Re: Improving the heapgetpage function improves performance in common scenarios

2023-09-05 Thread John Naylor
On Thu, Aug 24, 2023 at 5:55 PM Quan Zongliang wrote: > In the function heapgetpage. If a table is not updated very frequently. > Many actions in tuple loops are superfluous. For all_visible pages, > loctup does not need to be assigned, nor does the "valid" variable. >

Re: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread Dilip Kumar
On Tue, Sep 5, 2023 at 10:12 AM Amit Kapila wrote: > > On Tue, Sep 5, 2023 at 7:54 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Monday, September 4, 2023 6:15 PM vignesh C wrote: > > > > > > On Mon, 4 Sept 2023 at 15:20, Amit Kapila wrote: > > > > > > > > On Fri, Sep 1, 2023 at 10:50 AM vignesh

Re: old_snapshot_threshold bottleneck on replica

2023-09-05 Thread Thomas Munro
On Wed, Jun 14, 2023 at 3:56 PM Thomas Munro wrote: > On Tue, Feb 14, 2023 at 9:45 AM Andres Freund wrote: > > Indeed. There's a lot of things wrong with it. We have reproducers for > > creating wrong query results. Nobody has shown interest in fixing the > > problems, for several years by now.

Re: Improve heapgetpage() performance, overhead from serializable

2023-09-05 Thread John Naylor
On Mon, Jul 17, 2023 at 9:58 PM Andres Freund wrote: > FWIW, there's more we can do, with some hacky changes I got the time down to > 273.261, but the tradeoffs start to be a bit more complicated. And 397->320ms > for something as core as this, is imo worth considering on its own. Nice! > On

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-05 Thread Hayato Kuroda (Fujitsu)
Dear Hou-san, > Based on this, it’s possible that the slots we get each time when checking > wal_status are different, because they may get changed in between these > checks. > This may not cause serious problems for now, because we will either copy all > the slots including ones invalidated

Re: pg_basebackup: Always return valid temporary slot names

2023-09-05 Thread Nishant Sharma
Hi Jelte, Please find my reviews below:- *1)* With what I have understood from above, the pgbouncer fills up be_pid (int, 32 bits) with random bits as it does not have an associated server connection yet. With this, I was thinking, isn't this a problem of pgbouncer filling be_pid with random

Re: persist logical slots to disk during shutdown checkpoint

2023-09-05 Thread vignesh C
On Tue, 5 Sept 2023 at 09:10, Dilip Kumar wrote: > > On Fri, Sep 1, 2023 at 12:16 PM vignesh C wrote: > > > > On Fri, 1 Sept 2023 at 10:06, Amit Kapila wrote: > > > > > > On Thu, Aug 31, 2023 at 6:12 PM Ashutosh Bapat > > > wrote: > > > > > > > > On Thu, Aug 31, 2023 at 2:52 PM Amit Kapila >

Re: Impact of checkpointer during pg_upgrade

2023-09-05 Thread Dilip Kumar
On Tue, Sep 5, 2023 at 10:55 AM Amit Kapila wrote: > > > Earlier I was thinking that ERRORing out is better so that the user > > can take necessary action for the invalidated slots and then retry > > upgrade. But thinking again I could not find what are the advantages > > of this because if we