Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-18 Thread Kyotaro Horiguchi
At Mon, 19 Jun 2023 14:24:44 +0900, Michael Paquier wrote in > On Fri, Jun 16, 2023 at 04:27:40PM +0200, Julian Markwort wrote: > > Note that it is important that the PREPARE entry is in the WAL file > > that PostgreSQL is writing to prior to the inital crash. > > This has happened repeatedly

Re: Allow pg_archivecleanup to remove backup history files

2023-06-18 Thread Michael Paquier
On Mon, Jun 19, 2023 at 11:24:29AM +0900, torikoshia wrote: > Thanks, now I understand what you meant. If I may ask, why is the refactoring of 0003 done after the feature in 0002? Shouldn't the order be reversed? That would make for a cleaner git history. -- Michael signature.asc Description:

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-18 Thread Kyotaro Horiguchi
Thanks for the report, reproducer and the patches. At Fri, 16 Jun 2023 16:27:40 +0200, Julian Markwort wrote in > - prepare a transaction > - crash postgresql > - create standby.signal file > - start postgresql, wait for recovery to finish > - promote .. > The promotion will fail with a FATAL

Re: [BUG] recovery of prepared transactions during promotion can fail

2023-06-18 Thread Michael Paquier
On Fri, Jun 16, 2023 at 04:27:40PM +0200, Julian Markwort wrote: > I've discovered a serious bug that leads to a server crash upon > promoting an instance that crashed previously and did recovery in > standby mode. Reproduced here, for the versions mentioned. > The bug is present in PostgreSQL

Re: Support logical replication of DDLs

2023-06-18 Thread shveta malik
As per suggestion by Amit, reviewed two more formats to be used for DDL's WAL-logging purpose, analysis below: NodeToString: I do not think it is a good idea to use NodeToString in DDL Rep for reasons below: 1) It consists of too much internal and not-needed information. 2) Too large to be logged

Re: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases

2023-06-18 Thread Amit Kapila
On Mon, Jun 19, 2023 at 6:50 AM Masahiko Sawada wrote: > > On Sat, Jun 17, 2023 at 6:45 PM Amit Kapila wrote: > > > > On Tue, May 16, 2023 at 8:00 PM Masahiko Sawada > > wrote: > > > > > > On Thu, May 11, 2023 at 5:12 PM Masahiko Sawada > > > wrote: > > > > > > > > > > After thinking more

Re: path->param_info only set for lateral?

2023-06-18 Thread Tom Lane
James Coleman writes: > Over in "Parallelize correlated subqueries that execute within each > worker" [1} Richard Guo found a bug in the current version of my patch > in that thread. While debugging that issue I've been wondering why > Path's param_info field seems to be NULL unless there is a

Re: Deleting prepared statements from libpq.

2023-06-18 Thread jian he
now it works. /src/test/modules/libpq_pipeline/libpq_pipeline.c > > /* Now that it's closed we should get an error when describing */ > res = PQdescribePortal(conn, "cursor_one"); > if (PQresultStatus(res) != PGRES_FATAL_ERROR) > pg_fatal("expected COMMAND_OK, got %s",

path->param_info only set for lateral?

2023-06-18 Thread James Coleman
Hello, Over in "Parallelize correlated subqueries that execute within each worker" [1} Richard Guo found a bug in the current version of my patch in that thread. While debugging that issue I've been wondering why Path's param_info field seems to be NULL unless there is a LATERAL reference even

Re: Allow pg_archivecleanup to remove backup history files

2023-06-18 Thread torikoshia
On 2023-06-16 11:22, Kyotaro Horiguchi wrote: At Thu, 15 Jun 2023 21:38:28 +0900, torikoshia wrote in On 2023-06-15 15:20, Kyotaro Horiguchi wrote: Thanks for your review! > + printf(_(" -x, --strip-extension=EXT strip this extention before > identifying files fo clean up\n")); > + printf(_("

Re: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases

2023-06-18 Thread Masahiko Sawada
On Sat, Jun 17, 2023 at 6:45 PM Amit Kapila wrote: > > On Tue, May 16, 2023 at 8:00 PM Masahiko Sawada wrote: > > > > On Thu, May 11, 2023 at 5:12 PM Masahiko Sawada > > wrote: > > > > > > > After thinking more about it, I realized that this is not a problem > > specific to HEAD. ISTM the

Re: [PATCH] hstore: Fix parsing on Mac OS X: isspace() is locale specific

2023-06-18 Thread Tom Lane
Michael Paquier writes: > Another thing that I was wondering, though.. Do you think that there > would be an argument in being stricter in the hstore code regarding > the handling of multi-byte characters with some checks based on > IS_HIGHBIT_SET() when parsing the keys and values? What have

Re: Do we want a hashset type?

2023-06-18 Thread jian he
On Sat, Jun 17, 2023 at 8:38 AM Joel Jacobson wrote: > > On Fri, Jun 16, 2023, at 17:42, Joel Jacobson wrote: > > I realise int4hashset_hash() is broken, > > since two int4hashset's that are considered equal, > > can by coincidence get different hashes: > ... > > Do we have any ideas on how to

Re: Deleting prepared statements from libpq.

2023-06-18 Thread Michael Paquier
On Sun, Jun 18, 2023 at 01:03:57PM +0200, Jelte Fennema wrote: > Sorry about that. I attached a new patch that allows linking to the > new functions (I forgot to add the functions to exports.txt). This new > patch also adds some basic tests for these new functions. I am okay with the arguments

Re: Deleting prepared statements from libpq.

2023-06-18 Thread Michael Paquier
On Sun, Jun 18, 2023 at 09:23:22PM +0800, jian he wrote: > previously I cannot link it. with > v2-0001-Support-sending-Close-messages-from-libpq.patch. now I can > compile it, link it, but then run time error. > same c program in the first email. > when I run it ./a.out, then error: > ./a.out:

Re: [PATCH] hstore: Fix parsing on Mac OS X: isspace() is locale specific

2023-06-18 Thread Michael Paquier
On Sun, Jun 18, 2023 at 12:38:12PM -0400, Tom Lane wrote: > FWIW, I think the status quo is fine. Having hstore do something that > is neither its historical behavior nor aligned with the core parser > doesn't seem like a great idea. Okay. Fine by me. > I don't buy this argument that >

Re: Do we want a hashset type?

2023-06-18 Thread Joel Jacobson
On Sun, Jun 18, 2023, at 18:45, Andrew Dunstan wrote: > . It might be worth sending a version number with the send function > (c.f. jsonb_send / jsonb_recv). That way would would not be tied forever > to some wire representation. Great idea; implemented. > . I think there are some important

Re: BUG #17946: LC_MONETARY & DO LANGUAGE plperl - BUG

2023-06-18 Thread Joe Conway
On 6/12/23 17:28, Joe Conway wrote: On 6/12/23 10:44, Joe Conway wrote: 1/ how do we fix the misbehavior reported due to libperl in existing stable branches I was mostly trying to concentrate on #1, but 2 & 3 are worthy of discussion. Hmm, browsing through the perl source I came across a

Re: Use generation context to speed up tuplesorts

2023-06-18 Thread Tomas Vondra
Hi Ronan, We briefly chatted about the glibc-tuning part of this thread at pgcon, so I wonder if you're still planning to pursue that. If you do, I suggest we start a fresh thread, so that it's not mixed with the already committed improvements of generation context. I wonder what's the situation

Re: Do we want a hashset type?

2023-06-18 Thread Andrew Dunstan
On 2023-06-16 Fr 20:38, Joel Jacobson wrote: New patch is attached, which will henceforth always be a complete patch, to avoid the hassle of having to assemble incremental patches. Cool, thanks. A couple of random thoughts: . It might be worth sending a version number with the send

Re: [PATCH] hstore: Fix parsing on Mac OS X: isspace() is locale specific

2023-06-18 Thread Tom Lane
Michael Paquier writes: > At the end, no need to do that. I have been able to hack the > attached, that shows the difference of treatment for \v when running > in macOS. Evan, what do you think? FWIW, I think the status quo is fine. Having hstore do something that is neither its historical

Re: Deleting prepared statements from libpq.

2023-06-18 Thread jian he
On Sun, Jun 18, 2023 at 7:04 PM Jelte Fennema wrote: > > On Sat, 17 Jun 2023 at 15:34, jian he wrote: > > I failed to link it. I don't know why. > > Sorry about that. I attached a new patch that allows linking to the > new functions (I forgot to add the functions to exports.txt). This new >

Re: Deleting prepared statements from libpq.

2023-06-18 Thread Jelte Fennema
On Sat, 17 Jun 2023 at 15:34, jian he wrote: > I failed to link it. I don't know why. Sorry about that. I attached a new patch that allows linking to the new functions (I forgot to add the functions to exports.txt). This new patch also adds some basic tests for these new functions.

Re: [PATCH] hstore: Fix parsing on Mac OS X: isspace() is locale specific

2023-06-18 Thread Michael Paquier
On Sun, Jun 18, 2023 at 10:50:16AM +0900, Michael Paquier wrote: > The difference between scanner_isspace() and array_isspace() is that > the former matches with what scan.l stores as rules for whitespace > characters, but the latter works on values. For hstore, we want the > latter, with