Re: Purpose of wal_init_zero

2025-01-17 Thread Andres Freund
Hi, On 2025-01-16 14:50:57 +0530, Ritu Bhandari wrote: > Adding to Andy Fan's point above: > > If we increase WAL segment size from 16MB to 64MB, initializing the 64MB > WAL segment inline can cause several seconds of freeze on all write > transactions when it happens. Writing out a newly zero-fil

Re: Unicode full case mapping: PG_UNICODE_FAST, and standard-compliant UCS_BASIC

2025-01-17 Thread Jeff Davis
On Wed, 2025-01-15 at 13:21 -0800, Jeff Davis wrote: > I plan to commit 0001 and 0002 soon. Committed 0001 and 0002. Upon reviewing the discussion threads, I removed the Unicode "adjust to Cased" behavior when titlecasing. As Peter pointed out[1], it doesn't match the documentation or expectation

Re: [PATCH] Add roman support for to_number function

2025-01-17 Thread Tom Lane
Hunaid Sohail writes: > I’ve attached a new patch that addresses comments 2, 3, and 4 from Tomas. I'm still quite unhappy that this doesn't tolerate trailing whitespace. That's not how other format patterns work, and it makes it impossible to round-trip the output of to_char(..., 'RN'). I think

Re: create subscription with (origin = none, copy_data = on)

2025-01-17 Thread vignesh C
On Fri, 17 Jan 2025 at 21:30, vignesh C wrote: > > On Fri, 17 Jan 2025 at 14:00, Sergey Tatarintsev > wrote: > > > > Hi, hackers! > > > > I am looking at subscription creation command: > > > > CREATE SUBSCRIPTION sub CONNECTION '...' PUBLICATION pub WITH (origin = > > none, copy_data = on); > > >

Re: create subscription with (origin = none, copy_data = on)

2025-01-17 Thread Sergey Tatarintsev
17.01.2025 23:00, vignesh C пишет: On Fri, 17 Jan 2025 at 14:00, Sergey Tatarintsev wrote: Hi, hackers! I am looking at subscription creation command: CREATE SUBSCRIPTION sub CONNECTION '...' PUBLICATION pub WITH (origin = none, copy_data = on); For now we log a warning if the publisher ha

Re: rename es_epq_active to es_epqstate

2025-01-17 Thread Junwang Zhao
On Sat, Jan 18, 2025 at 9:43 AM Tom Lane wrote: > > Junwang Zhao writes: > > ISTM Andres tend to use *es_epq_active* in a boolean way, > > like `if (es_epq_active) then`, but in the code base, all its usages > > follow pattern `if (es_epq_active == NULL) then`, so I propose to > > change es_epq_a

Re: Old BufferDesc refcount in PrintBufferDescs and PrintPinnedBufs

2025-01-17 Thread Tom Lane
Jacob Brazeal writes: > In bufmgr.c we have the debugging functions PrintBufferDescs > and PrintPinnedBufs, which are typically hidden behind the flag > #ifdef NOT_USED. These functions reference the old buf->refcount and > buf->flags fields, and so they no longer compile. I attached a patch to >

Re: Collation & ctype method table, and extension hooks

2025-01-17 Thread Jeff Davis
On Wed, 2025-01-15 at 12:42 -0800, Jeff Davis wrote: > > Here's v12 after committing a few of the earlier patches. And here's v14, just a rebase. > I collected some performance numbers for a worst case on UTF8. I'm still inlined to think the method table is a good thing to do: (a) The performan

Re: Old BufferDesc refcount in PrintBufferDescs and PrintPinnedBufs

2025-01-17 Thread Jacob Brazeal
On Fri, Jan 17, 2025 at 9:53 PM Tom Lane wrote: > Jacob Brazeal writes: > > In bufmgr.c we have the debugging functions PrintBufferDescs > > and PrintPinnedBufs, which are typically hidden behind the flag > > #ifdef NOT_USED. These functions reference the old buf->refcount and > > buf->flags fie

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Gilles Darold
Le 17/01/2025 à 19:01, Bruce Momjian a écrit : On Fri, Jan 17, 2025 at 04:55:07PM +0100, Pavel Stehule wrote: pá 17. 1. 2025 v 16:35 odesílatel Bruce Momjian napsal: So this feature would be like global GUC variables, with permission control? + types and domain type check - holds da

Re: pg_trgm comparison bug on cross-architecture replication due to different char implementation

2025-01-17 Thread Masahiko Sawada
Hi, I apologize for the late response. I completely missed tracking updates on this thread. On Tue, Nov 19, 2024 at 5:28 PM Noah Misch wrote: > > On Thu, Oct 03, 2024 at 06:55:47AM -0700, Masahiko Sawada wrote: > > I've attached PoC patches for the idea Noah proposed. Newly created > > clusters

Re: Unicode full case mapping: PG_UNICODE_FAST, and standard-compliant UCS_BASIC

2025-01-17 Thread Jeff Davis
On Fri, 2025-01-17 at 16:06 -0800, Jeff Davis wrote: > Upon reviewing the discussion threads, I removed the Unicode "adjust > to > Cased" behavior when titlecasing. As Peter pointed out[1], it doesn't > match the documentation or expectations for INITCAP(). Forgot to add a link to the discussion.

rename es_epq_active to es_epqstate

2025-01-17 Thread Junwang Zhao
Hi hackers, While reviewing the ExecSeqScan optimizations patch[1], I found that es_epq_active might not be well named, my intuition told me that this is a boolean field because of the "active" suffix. es_epq_active was introduced in 27cc7cd, in the original discussion[2], Tom and Andres discusse

Re: Set AUTOCOMMIT to on in script output by pg_dump

2025-01-17 Thread Tom Lane
Robert Treat writes: > suggested diffs attached, let me know if you would like a consolidated patch Sadly, the cfbot is now confused since it doesn't understand the idea of an incremental patch. Somebody please post a consolidated patch. For myself, I'd suggest writing the examples with -X not

Re: [PATCH] Add some documentation on how to call internal functions

2025-01-17 Thread Tom Lane
Pavel Stehule writes: > pá 18. 10. 2024 v 22:23 odesílatel Tom Lane napsal: >> The problem here is that we failed to pass through the result of >> PG_GET_COLLATION() to text_starts_with. We could do that, certainly, >> for a couple more lines of code. But it feels like this is getting >> into d

Re: Bug in detaching a partition with a foreign key.

2025-01-17 Thread Sami Imseih
This is a bug indeed. I tried your patch, but it ends up in a seg fault. I also see this was raised in another thread [0]. It can be reproduced in a slightly simplified case, using only a single level partition. """ CREATE TABLE bar(id int PRIMARY KEY) PARTITION BY RANGE(id); CREATE TABLE bar_p0

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Marcos Pegoraro
> > > pá 17. 1. 2025 v 16:35 odesílatel Bruce Momjian > napsal: > > Okay, good summary. Now, can people give feedback that they would want > this committed to PostgreSQL? > I would love to have this functionality as soon as possible. I already mentioned to Pavel that he did something very big, a

Re: Remove XLogRecGetFullXid() in xlogreader.c?

2025-01-17 Thread Michael Paquier
On Fri, Jan 17, 2025 at 10:45:28AM -0500, Andres Freund wrote: > I think it is sensible infrastructure and we'll eventually end up using > it. The cost of having it fairly low. If it were a legacy thing that we > shouldn't introduce new users for it'd be a different story, but it's the > opposite.

Re: Limit length of queryies in pg_stat_statement extension

2025-01-17 Thread Michael Paquier
On Fri, Jan 17, 2025 at 03:24:34PM +0800, Julien Rouhaud wrote: > The real solution is probably to rely on the new > pluggable statistic architecture rather than using the hash table / query text > file. My own plan was to propose exactly that in the v19 cycle, leaving one release with this infras

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Wolfgang Walther
Bruce Momjian: Now, can people give feedback that they would want this committed to PostgreSQL? From a user's perspective: Yes! I've been waiting for this for a long time and I really hope this can go through, eventually. Best, Wolfgang

Old BufferDesc refcount in PrintBufferDescs and PrintPinnedBufs

2025-01-17 Thread Jacob Brazeal
Hi, In bufmgr.c we have the debugging functions PrintBufferDescs and PrintPinnedBufs, which are typically hidden behind the flag #ifdef NOT_USED. These functions reference the old buf->refcount and buf->flags fields, and so they no longer compile. I attached a patch to use BUF_STATE_GET_REFCOUNT i

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Marcos Pegoraro
Em sex., 17 de jan. de 2025 às 13:01, Bruce Momjian escreveu: > Okay, good summary. Now, can people give feedback that they would want > this committed to PostgreSQL? I would love to have this functionality as soon as possible. I already mentioned to Pavel that he did something very big, and c

Re: Eager aggregation, take 3

2025-01-17 Thread Robert Haas
On Thu, Jan 16, 2025 at 3:18 AM Richard Guo wrote: > If this t1/t2 join is part of a larger SELECT query, I think the cost > estimates for the upper join nodes would likely be quite inaccurate. That's definitely true. However, the question is not whether the planner has problems today (it definit

Re: Psql meta-command conninfo+

2025-01-17 Thread Sami Imseih
> Wait a second, why do we have these here? Aren't they already in > \dconfig? \dconfig is generated by querying pg_settings and this requires a halthy connection. The parameters being proposed with \conninfo+ are set in libpq by the server [1] and can be retrieved even if the connection breaks.

Re: rename es_epq_active to es_epqstate

2025-01-17 Thread Tom Lane
Junwang Zhao writes: > ISTM Andres tend to use *es_epq_active* in a boolean way, > like `if (es_epq_active) then`, but in the code base, all its usages > follow pattern `if (es_epq_active == NULL) then`, so I propose to > change es_epq_active to es_epqstate. While I didn't especially love "es_epq

Re: Old BufferDesc refcount in PrintBufferDescs and PrintPinnedBufs

2025-01-17 Thread Jacob Brazeal
Since this patch takes out a lock to read the BufferDesc state, I also need to release the lock, which I've added to this patch. On Fri, Jan 17, 2025 at 2:11 PM Jacob Brazeal wrote: > Hi, > > In bufmgr.c we have the debugging functions PrintBufferDescs > and PrintPinnedBufs, which are typically

create subscription with (origin = none, copy_data = on)

2025-01-17 Thread Sergey Tatarintsev
Hi, hackers! I am looking at subscription creation command: CREATE SUBSCRIPTION sub CONNECTION '...' PUBLICATION pub WITH (origin = none, copy_data = on); For now we log a warning if the publisher has subscribed to the same table from some other publisher. However, in case of publication wit

Re: ecpg command does not warn COPY ... FROM STDIN;

2025-01-17 Thread Ryo Kanbayashi
On Wed, Jan 15, 2025 at 1:34 AM Fujii Masao wrote: > > > > On 2025/01/12 18:27, Ryo Kanbayashi wrote: > > Thank you for reviewing patch :) > > The commit log matches with my recognition and has no problem. > > Pushed. Thanks! > > >>> check_patches.sh -> utility script for testing above two patches

Re: Fix misuse use of pg_b64_encode function (contrib/postgres_fdw/connection.c)

2025-01-17 Thread Ranier Vilela
Em sex., 17 de jan. de 2025 às 05:11, Peter Eisentraut escreveu: > On 16.01.25 11:23, Ranier Vilela wrote: > > > > > > Em qui., 16 de jan. de 2025 às 05:07, Peter Eisentraut > > mailto:pe...@eisentraut.org>> escreveu: > > > > On 16.01.25 02:12, Ranier Vilela wrote: > > > Per Coverity. >

Add a property to automatically suspend portals as they produce given number of bytes

2025-01-17 Thread Vladimir Sitnikov
Hi, Applications often face an "out of memory" condition as they try to fetch "N rows" from the database. If N is small, then the execution becomes inefficient due to many roundtrips. If N is high, there's a risk that many rows would overflow the client's memory. Note: the client can't stop readi

Re: Bypassing cursors in postgres_fdw to enable parallel plans

2025-01-17 Thread Rafia Sabih
On Tue, 14 Jan 2025 at 18:33, Robert Haas wrote: > On Mon, Jan 6, 2025 at 3:52 AM Rafia Sabih > wrote: > > Now, to overcome this limitation, I have worked on this idea (suggested > by my colleague Bernd Helmle) of bypassing the cursors. The way it works is > as follows, > > there is a new GUC in

Re: Eager aggregation, take 3

2025-01-17 Thread Richard Guo
On Fri, Jan 17, 2025 at 6:40 AM Tom Lane wrote: > * The README addition, and the basically identical text in the > commit message, don't even provide a reason to believe that the > transformation is correct let alone that it will result in faster > execution. I don't understand why it's so hard t

Re: Add a property to automatically suspend portals as they produce given number of bytes

2025-01-17 Thread Vladimir Sitnikov
Kirill, cursor does not provide a way to limit the fetch size based on the memory consumption. Imagine a table like (id int8, value jsonb). If we use "fetch 1000", then it might require 1GiB on the client if every row contains 1MiB json. If the client plays defensively and goes for "fetch 10", it

Re: [PATCH] New predefined role pg_manage_extensions

2025-01-17 Thread Laurenz Albe
On Thu, 2024-10-31 at 22:47 +0100, Michael Banck wrote: > Even though there has not been a lot of discussion on this, here is a > rebased patch.  I have also added it to the upcoming commitfest. I had a look at the patch. > --- a/doc/src/sgml/user-manag.sgml > +++ b/doc/src/sgml/user-manag.sgml >

Re: Re: proposal: schema variables

2025-01-17 Thread Bruce Momjian
On Fri, Jan 17, 2025 at 08:18:20AM +0100, Pavel Stehule wrote: > Hi > > fix oid collision What is the purpose of continually posting this patch to the email lists? -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Do not let ur

Re: POC: track vacuum/analyze cumulative time per relation

2025-01-17 Thread Bertrand Drouvot
Hi, On Wed, Jan 15, 2025 at 11:09:00AM -0600, Sami Imseih wrote: > > Appart from the above that LGTM. > > thanks! I took care of your comments. Thanks! > I was not sure > about the need to cast "double" but as you mention this > is consistent with other parts of pgstatfuncs.c Yup. > v4 attach

Re: Introduce XID age and inactive timeout based replication slot invalidation

2025-01-17 Thread Shlok Kyal
On Thu, 16 Jan 2025 at 12:35, Nisha Moond wrote: > > On Wed, Jan 15, 2025 at 11:37 AM Shlok Kyal wrote: > > > > On Thu, 2 Jan 2025 at 15:57, Nisha Moond wrote: > > > > > > On Thu, Jan 2, 2025 at 8:16 AM Peter Smith wrote: > > > > > > > > Hi Nisha, > > > > > > > > Here are some minor review comm

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-17 Thread Zhou, Zhiguo
On 1/16/2025 10:00 PM, Yura Sokolov wrote: Good day, Zhiguo. Excuse me, I feel sneaky a bit, but I've started another thread just about increase of NUM_XLOGINSERT_LOCK, because I can measure its effect even on my working notebook (it is another one: Ryzen 5825U limited to @2GHz). http:/

Re: ecpg command does not warn COPY ... FROM STDIN;

2025-01-17 Thread Fujii Masao
On 2025/01/17 17:46, Ryo Kanbayashi wrote: So, will you give creating the patch a try? Yes. I try to write the patch for regression test of ecpg command warning and error notice :) Thanks! BTW, How should we handle commit fest entry below? "ecpg command does not warn COPY ... FROM STDIN

Re: Re: proposal: schema variables

2025-01-17 Thread Bruce Momjian
On Fri, Jan 17, 2025 at 02:48:29PM +0100, Pavel Stehule wrote: > Hi > > pá 17. 1. 2025 v 14:41 odesílatel Bruce Momjian napsal: > > On Fri, Jan 17, 2025 at 08:18:20AM +0100, Pavel Stehule wrote: > > Hi > > > > fix oid collision > > What is the purpose of continually posting

Re: Re: proposal: schema variables

2025-01-17 Thread Pavel Stehule
Hi pá 17. 1. 2025 v 14:41 odesílatel Bruce Momjian napsal: > On Fri, Jan 17, 2025 at 08:18:20AM +0100, Pavel Stehule wrote: > > Hi > > > > fix oid collision > > What is the purpose of continually posting this patch to the email > lists? > The people still do a review, so I am fixing this patch.

Re: Statistics Import and Export

2025-01-17 Thread jian he
hi. SELECT * FROM pg_catalog.pg_restore_relation_stats( 'relation', 'public.tenk1_hundred'::regclass, 'version', '18'::integer, 'relpages', '11'::integer, 'reltuples', '1'::real, 'relallvisible', '0'::integer ); dump and execute the above query generated a warning WARNI

Fwd: Re: proposal: schema variables

2025-01-17 Thread Pavel Stehule
Hi pá 17. 1. 2025 v 15:39 odesílatel Bruce Momjian napsal: > On Fri, Jan 17, 2025 at 03:28:55PM +0100, Pavel Stehule wrote: > > Dne pá 17. 1. 2025 15:16 uživatel Bruce Momjian > napsal: > > Is this really something we are considering applying, since it has > been > > around for years?

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Bruce Momjian
On Fri, Jan 17, 2025 at 04:32:07PM +0100, Pavel Stehule wrote: > This discussion was around 2017 when I wrote a proposal and I hadn't a feeling 2017 is seven years ago so it would be good to get current feedback on the desirability of this feature. > There is one stronger argument for session var

Re: ecpg command does not warn COPY ... FROM STDIN;

2025-01-17 Thread Ryo Kanbayashi
{ "emoji": "🙏", "version": 1 }

Re: pure parsers and reentrant scanners

2025-01-17 Thread Peter Eisentraut
On 09.01.25 15:53, Tom Lane wrote: Peter Eisentraut writes: The second patch contemplates raising the minimum required flex version, but what to? Meh, let's just rip out the version check. It's no longer very relevant. Nobody is going to be using anything older than 2.5.35. While 2.5.35 pro

Re: Remove XLogRecGetFullXid() in xlogreader.c?

2025-01-17 Thread Nathan Bossart
(I've added Thomas Munro to the thread.) On Fri, Jan 17, 2025 at 02:00:49PM +0900, Michael Paquier wrote: > XLogRecGetFullXid() has been introduced in 67b9b3ca3283 back in 2019, > but as far as I can see this has never been used in the code and this > is used nowhere in the core code. > > I have

Re: POC: track vacuum/analyze cumulative time per relation

2025-01-17 Thread Sami Imseih
> One comment: > > + PG_RETURN_FLOAT8(result);\ > > The "\" indentation looks wrong for this line (was ok in v3). > > Regards, > Indeed. Corrected in v5 Thanks! Sami v5-0001-Track-per-relation-cumulative-time-spent-in-vacuu.patch Description: Binar

Re: Remove XLogRecGetFullXid() in xlogreader.c?

2025-01-17 Thread Andres Freund
Hi, On 2025-01-17 14:00:49 +0900, Michael Paquier wrote: > XLogRecGetFullXid() has been introduced in 67b9b3ca3283 back in 2019, > but as far as I can see this has never been used in the code and this > is used nowhere in the core code. > > I have looked at Debian's codesearch and also looked at t

Re: Set AUTOCOMMIT to on in script output by pg_dump

2025-01-17 Thread Robert Treat
On Thu, Oct 10, 2024 at 1:56 AM Shinya Kato wrote: > Thank you all for the comments! > While adding to the documentation is sufficient if users use it > correctly, users often behave unexpectedly. My intention was to > implement it in a way that works without issues even if misused. > However, si

Re: pure parsers and reentrant scanners

2025-01-17 Thread Peter Eisentraut
Here are some more patches. This should cover the last sub-topic of this topic: not passing the yyparse() result via global variables. This uses techniques that are already in use in some parsers in the tree, for example cube and jsonpath. The syncrep parser was a bit trickier, because there

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Pavel Stehule
pá 17. 1. 2025 v 16:35 odesílatel Bruce Momjian napsal: > On Fri, Jan 17, 2025 at 04:32:07PM +0100, Pavel Stehule wrote: > > This discussion was around 2017 when I wrote a proposal and I hadn't a > feeling > > 2017 is seven years ago so it would be good to get current feedback on > the desirabili

Re: Increase NUM_XLOGINSERT_LOCKS

2025-01-17 Thread Yura Sokolov
Excuse me, Andres, I've found I've pressed wrong button when I sent this letter first time, and it was sent only to you. So I'm sending the copy now. Please, reply to this message with copy of your answer. Your answer is really valuable to be published in the list. 16.01.2025 18:36, Andres Fr

Re: Conflict detection for update_deleted in logical replication

2025-01-17 Thread Masahiko Sawada
On Thu, Jan 16, 2025 at 2:02 AM Amit Kapila wrote: > > On Wed, Jan 15, 2025 at 2:20 PM Zhijie Hou (Fujitsu) > wrote: > > > > In the latest version, we implemented a simpler approach that allows the > > apply > > worker to directly advance the oldest_nonremovable_xid if the waiting time > > excee

Re: Fix misuse use of pg_b64_encode function (contrib/postgres_fdw/connection.c)

2025-01-17 Thread Peter Eisentraut
On 16.01.25 11:23, Ranier Vilela wrote: Em qui., 16 de jan. de 2025 às 05:07, Peter Eisentraut mailto:pe...@eisentraut.org>> escreveu: On 16.01.25 02:12, Ranier Vilela wrote: > Per Coverity. > > CID 1590024:    (CHECKED_RETURN) > Calling "pg_b64_encode" without checki

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Julien Rouhaud
On Fri, Jan 17, 2025 at 11:01:41AM -0500, Bruce Momjian wrote: > On Fri, Jan 17, 2025 at 04:55:07PM +0100, Pavel Stehule wrote: > > pá 17. 1. 2025 v 16:35 odesílatel Bruce Momjian napsal: > > > > So this feature would be like global GUC variables, with permission > > control? > > > > + t

Re: create subscription with (origin = none, copy_data = on)

2025-01-17 Thread vignesh C
On Fri, 17 Jan 2025 at 14:00, Sergey Tatarintsev wrote: > > Hi, hackers! > > I am looking at subscription creation command: > > CREATE SUBSCRIPTION sub CONNECTION '...' PUBLICATION pub WITH (origin = > none, copy_data = on); > > For now we log a warning if the publisher has subscribed to the same

Re: [PATCH] Add get_bytes() and set_bytes() functions

2025-01-17 Thread Dean Rasheed
On Tue, 14 Jan 2025 at 13:25, Aleksander Alekseev wrote: > > Thanks. I agree that the proposed error messages look nicer than the > one I used in v6. Here is the corrected patch. > This should use ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE, rather than ERRCODE_INVALID_PARAMETER_VALUE, for consistency wit

Re: Parallel heap vacuum

2025-01-17 Thread Masahiko Sawada
On Fri, Jan 17, 2025 at 1:43 AM Dilip Kumar wrote: > > On Fri, Jan 17, 2025 at 6:37 AM Masahiko Sawada wrote: >> >> On Sun, Jan 12, 2025 at 1:34 AM Masahiko Sawada >> wrote: >> > > > > IIRC, there was one of the blocker for implementing parallel heap vacuum was > group locking, have we already

Re: [PATCH] Hex-coding optimizations using SVE on ARM.

2025-01-17 Thread Nathan Bossart
With commit e24d770 in place, I took a closer look at hex_decode(), and I concluded that doing anything better without intrinsics would likely require either a huge lookup table or something with complexity rivalling the instrinsics approach (while also not rivalling its performance). So, I took a

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-01-17 Thread Oliver Ford
On Thu, Sep 12, 2024 at 2:41 AM Tatsuo Ishii wrote: > > It seems you allow to use IGNORE NULLS for all window functions. If > the case, you should explicitely stat that in the docs. Otherwise > users will be confused because; The latest version restricts it to lag, lead, first_value, last_value,

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Laurenz Albe
On Fri, 2025-01-17 at 11:01 -0500, Bruce Momjian wrote: > On Fri, Jan 17, 2025 at 04:55:07PM +0100, Pavel Stehule wrote: > > pá 17. 1. 2025 v 16:35 odesílatel Bruce Momjian napsal: > > > > So this feature would be like global GUC variables, with permission > > control? > > > > + types an

Re: Accept recovery conflict interrupt on blocked writing

2025-01-17 Thread Anthonin Bonnefoy
I've tested on a PG16, the issue is indeed triggered with the replication blocked while the conflicting query is stuck in ClientWrite. I've cleaned up the tests: I've created a dedicated PgProto (definitely open to suggestions for a better name...) module containing all the helpers to send and rec

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Bruce Momjian
On Fri, Jan 17, 2025 at 04:55:07PM +0100, Pavel Stehule wrote: > pá 17. 1. 2025 v 16:35 odesílatel Bruce Momjian napsal: > > So this feature would be like global GUC variables, with permission > control? > > + types and domain type check - holds data in binary form - there are not > conv

Re: Fwd: Re: proposal: schema variables

2025-01-17 Thread Dmitry Dolgov
> On Fri, Jan 17, 2025 at 11:01:41AM GMT, Bruce Momjian wrote: > On Fri, Jan 17, 2025 at 04:55:07PM +0100, Pavel Stehule wrote: > > pá 17. 1. 2025 v 16:35 odesílatel Bruce Momjian napsal: > > > > So this feature would be like global GUC variables, with permission > > control? > > > > + typ

Re: Skip collecting decoded changes of already-aborted transactions

2025-01-17 Thread Masahiko Sawada
On Wed, Jan 15, 2025 at 4:43 PM Peter Smith wrote: > > On Wed, Jan 15, 2025 at 5:49 PM Amit Kapila wrote: > > > > On Wed, Jan 15, 2025 at 3:11 AM Masahiko Sawada > > wrote: > > > > > > It seems we agreed on RBTXN_IS_PREPARED and rbtxn_is_prepared(). > > > Adding 'IS' seems to clarify the transa

Re: Add “FOR UPDATE NOWAIT” lock details to the log.

2025-01-17 Thread Fujii Masao
On 2025/01/17 18:29, Yuki Seino wrote: Thank you for your comments. + Currently, only lock failures due to NOWAIT are +    supported.  The default is off.  Only superusers This GUC also affects SKIP LOCKED, so that should be documented. I overlooked it... I have revised the document

Re: Accept recovery conflict interrupt on blocked writing

2025-01-17 Thread Andres Freund
Hi, On 2025-01-17 17:01:53 +0100, Anthonin Bonnefoy wrote: > I've cleaned up the tests: I've created a dedicated PgProto > (definitely open to suggestions for a better name...) module > containing all the helpers to send and receive messages on a raw > socket in 0001. Might be worth using it it i

Re: Accept recovery conflict interrupt on blocked writing

2025-01-17 Thread Andres Freund
Hi, On 2025-01-17 13:03:35 -0500, Andres Freund wrote: > I don't see anything implementing the promotion of ERRORs to FATAL? You're > preventing the error message being sent to the client, but I don't think that > causes the connection to be terminated. The pre-existing code doesn't have > that

Re: Catching query cancelations in PLPython3u

2025-01-17 Thread Adam Brusselback
Bumping this, because I am genuinely interested if there is a better way to do this. I'd really like to know if there is a better way than executing dummy queries...it feels dirty. I've seen plenty of extensions not handle query cancellation / exceptions gracefully. Also seems like something to t

Re: SQLFunctionCache and generic plans

2025-01-17 Thread Tom Lane
Alexander Pyhalov writes: > I've rebased patch on master. Tests pass here. The cfbot still doesn't like it; my guess is that you built without --with-libxml and so didn't notice the effects on xml.out. I've looked through the patch briefly and have a few thoughts: * You cannot use plancache.c l

Re: Accept recovery conflict interrupt on blocked writing

2025-01-17 Thread Andres Freund
Hi, On 2025-01-17 13:03:35 -0500, Andres Freund wrote: > > Previously, all interrupts except process dying were ignored while a > > process was blocked writing to a socket. If the connection to the client > > was broken (no clean FIN nor RST), a process sending results to the > > client could be s

Re: Add “FOR UPDATE NOWAIT” lock details to the log.

2025-01-17 Thread Yuki Seino
Thank you for your comments. + Currently, only lock failures due to NOWAIT are +    supported.  The default is off.  Only superusers This GUC also affects SKIP LOCKED, so that should be documented. I overlooked it... I have revised the document with SKIP LOCKED. If CollectLockHolders

Re: Parallel heap vacuum

2025-01-17 Thread Dilip Kumar
On Fri, Jan 17, 2025 at 6:37 AM Masahiko Sawada wrote: > On Sun, Jan 12, 2025 at 1:34 AM Masahiko Sawada > wrote: > > > IIRC, there was one of the blocker for implementing parallel heap vacuum was group locking, have we already resolved that issue or its being included in this patch set? -- R

Re: Change GUC hashtable to use simplehash?

2025-01-17 Thread John Naylor
On Wed, Jan 15, 2025 at 7:08 PM Anton A. Melnikov wrote: > It was x86 AMD Laptop: HP Probook 455 g7 with AMD Ryzen 7 4700U and 64GB DDR4 > RAM. > OS: Linux 5.15.0-130-generic #140~20.04.1-Ubuntu SMP Wed Dec 18 21:35:34 UTC > 2024 x86_64 x86_64 x86_64 GNU/Linux. > > ~$ valgrind --version > valgri

Re: per backend I/O statistics

2025-01-17 Thread Bertrand Drouvot
Hi, On Fri, Jan 17, 2025 at 03:12:36PM +0900, Michael Paquier wrote: > On Fri, Jan 17, 2025 at 06:06:35AM +, Bertrand Drouvot wrote: > > On Fri, Jan 17, 2025 at 09:08:02AM +0900, Michael Paquier wrote: > >> I could tweak that around the beginning of next week with a proposal > >> of patch. Be

Re: Adding OLD/NEW support to RETURNING

2025-01-17 Thread Dean Rasheed
On Fri, 17 Jan 2025 at 02:24, Richard Guo wrote: > > It seems that adding ParseNamespaceItems for the OLD or NEW aliases > may confuse scanNameSpaceForRelid() when searching the table namespace > for a relation item. Since they contain the same RTE, > scanNameSpaceForRelid() might mistakenly dete

Re: Conflict detection for update_deleted in logical replication

2025-01-17 Thread Amit Kapila
On Fri, Jan 17, 2025 at 1:37 PM Masahiko Sawada wrote: > > On Thu, Jan 16, 2025 at 2:02 AM Amit Kapila wrote: > > > > On Wed, Jan 15, 2025 at 2:20 PM Zhijie Hou (Fujitsu) > > wrote: > > > > > > In the latest version, we implemented a simpler approach that allows the > > > apply > > > worker to

Re: Add a property to automatically suspend portals as they produce given number of bytes

2025-01-17 Thread Kirill Reshke
Hi, client can use CURSOR feature to process data in batches. What is the case where proposed feature solves problem that CURSOR does not? https://www.postgresql.org/docs/current/plpgsql-cursors.html On Fri, 17 Jan 2025, 16:08 Vladimir Sitnikov, wrote: > Hi, > > Applications often face an "out