Re: Clear padding in PgStat_HashKey keys

2024-11-03 Thread Michael Paquier
On Sun, Nov 03, 2024 at 04:25:41AM +, Bertrand Drouvot wrote: > We are using sizeof(PgStat_HashKey) in pgstat_cmp_hash_key() and we compute > the > hash hash key in pgstat_hash_hash_key() using the PgStat_HashKey struct size > as > input: this lead to unexpected results if the keys contain ra

Re: general purpose array_sort

2024-11-03 Thread jian he
On Mon, Nov 4, 2024 at 1:46 PM Michael Paquier wrote: > > > +typentry = lookup_type_cache(elmtyp, TYPECACHE_LT_OPR); > +if (!OidIsValid(typentry->lt_opr)) > +ereport(ERROR, > +(errcode(ERRCODE_UNDEFINED_FUNCTION), > + errmsg("could not identify order

Re: Allowing pg_recvlogical to create temporary replication slots

2024-11-03 Thread Michael Paquier
On Fri, Nov 01, 2024 at 01:42:55PM +0100, Torsten Förtsch wrote: > I was in the process of experimenting with this idea and found that > pg_recvlogical can: > - only create the slot or > - create the slot and immediately use it > - try to create the slot and if the slot is already there use it > >

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-11-03 Thread Michael Paquier
On Mon, Nov 04, 2024 at 06:29:42AM +0200, Alexander Korotkov wrote: > The attached patchset contains patch 0001, which improves handling of > not in recovery state by usage of PromoteIsTriggered(). When > (PromoteIsTriggered() == false), last replay LSN is not accepted and > not reported in errdet

Re: [PATCH] Rename trim_array() for consistency with the rest of array_* functions

2024-11-03 Thread Michael Paquier
On Tue, Oct 29, 2024 at 03:23:15PM +0300, Aleksander Alekseev wrote: >> While unfortunately named, we cannot deprecate TRIM_ARRAY() because it >> is mandated by the standard. > > I didn't know that, thanks. Wow. Neither did I. > Still PostgreSQL doesn't follow the standard precisely in more tha

Re: general purpose array_sort

2024-11-03 Thread Michael Paquier
On Sun, Nov 03, 2024 at 11:33:05AM +0800, Junwang Zhao wrote: > Rebase needed due to array_reverse committed, PFA v11. There has been another conflict since you have posted this version (noticed that after my business in 027124a872d7). I have looked at 0001. +if (ARR_NDIM(array) < 1) +

Re: Pgoutput not capturing the generated columns

2024-11-03 Thread Amit Kapila
On Mon, Nov 4, 2024 at 10:30 AM Peter Smith wrote: > > On Mon, Nov 4, 2024 at 12:28 AM vignesh C wrote: > > Thanks for the latest doc v2 "fix" patch. Here are my review comments about > it. > > == > src/sgml/logical-replication.sgml > > 1. > During initial data synchronization, only the

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-11-03 Thread jian he
Hi there. zero knowledge of Oath, just reading through the v35-0001. forgive me if my comments are naive. +static int +parse_interval(struct async_ctx *actx, const char *interval_str) +{ + double parsed; + int cnt; + + /* + * The JSON lexer has already validated the number, which is stricter than

Re: Pgoutput not capturing the generated columns

2024-11-03 Thread Peter Smith
On Mon, Nov 4, 2024 at 12:28 AM vignesh C wrote: > > On Thu, 31 Oct 2024 at 16:44, Ajin Cherian wrote: > > > > > > > > On Thu, Oct 31, 2024 at 9:55 PM Ajin Cherian wrote: > >> > >> I ran some tests and verified that the patch works with previous versions > >> of PG12 and PG17 > >> 1. Verified w

Re: small pg_combinebackup improvements

2024-11-03 Thread Amul Sul
On Fri, Nov 1, 2024 at 1:31 PM Bertrand Drouvot wrote: > > Hi, > > On Thu, Oct 31, 2024 at 12:06:25PM -0400, Robert Haas wrote: > > On Thu, Oct 31, 2024 at 11:41 AM Bertrand Drouvot > > wrote: > > > I'm not sure about 0001 but I think 0002 deserves a back patch as I think > > > it fits > > > int

Re: Pgoutput not capturing the generated columns

2024-11-03 Thread Ajin Cherian
On Mon, Nov 4, 2024 at 2:20 PM Amit Kapila wrote: > > On Thu, Oct 31, 2024 at 4:26 PM Ajin Cherian wrote: > > > > 5. Verified that publications with different column list are disallowed to > > be subscribed by one subscription > >a. PUB_A(column list = (a, b)) PUB_B(no column list, with > >

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-11-03 Thread Alexander Korotkov
On Sun, Nov 3, 2024 at 11:03 PM Alexander Korotkov wrote: > On Sun, Nov 3, 2024 at 10:54 PM Alexander Korotkov > wrote: > > > > On Mon, Oct 28, 2024 at 9:42 PM Alexander Korotkov > > wrote: > > > > > > On Mon, Oct 28, 2024 at 11:36 AM Heikki Linnakangas > > > wrote: > > > > > > > > On 25/10/

Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.

2024-11-03 Thread jian he
hi. about v5. if (exprs_known_equal(root, expr1, expr2, btree_opfamily)) { /* * Ensure that the collation of the expression matches * that of the partition key. Checking just one collation

Re: Pgoutput not capturing the generated columns

2024-11-03 Thread Amit Kapila
On Thu, Oct 31, 2024 at 4:26 PM Ajin Cherian wrote: > > 5. Verified that publications with different column list are disallowed to be > subscribed by one subscription >a. PUB_A(column list = (a, b)) PUB_B(no column list, with > publish_generated_column) - OK >b. PUB_A(column list = (a, b

Re: Pgoutput not capturing the generated columns

2024-11-03 Thread Peter Smith
On Thu, Oct 31, 2024 at 3:16 AM vignesh C wrote: > > On Wed, 30 Oct 2024 at 15:06, Amit Kapila wrote: > > > > On Tue, Oct 29, 2024 at 8:50 PM vignesh C wrote: > > > > > > Thank you for reporting this issue. The attached v46 patch addresses > > > the problem and includes some adjustments to the c

Re: New function normal_rand_array function to contrib/tablefunc.

2024-11-03 Thread Andy Fan
Dean Rasheed writes: > On Wed, 16 Oct 2024 at 08:43, Andy Fan wrote: >> >> Thanks for the detailed feedback! Here is the rebased version. >> > > I took another look at this and I think it's in reasonable shape. > > I'm attaching an update, rebasing it on top of 9be4e5d293. Thank you Dean. >

Re: What is a typical precision of gettimeofday()?

2024-11-03 Thread Hannu Krosing
Hi Tom, Did I understand correctly that you would prefer the documentation part to be much smaller than it is now and all current the discussion about things that are not strictly about the pg_test_timing to be not in the docs for it ? My current plan is to move the other discussions around timin

Re: What is a typical precision of gettimeofday()?

2024-11-03 Thread Tom Lane
Hannu Krosing writes: > Did I understand correctly that you would prefer the documentation part to > be much smaller than it is now and all current the discussion about things > that are not strictly about the pg_test_timing to be not in the docs for it > ? Well, I would like for the docs not to

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-11-03 Thread Alexander Korotkov
On Sun, Nov 3, 2024 at 10:54 PM Alexander Korotkov wrote: > > On Mon, Oct 28, 2024 at 9:42 PM Alexander Korotkov > wrote: > > > > On Mon, Oct 28, 2024 at 11:36 AM Heikki Linnakangas wrote: > > > > > > On 25/10/2024 14:56, Alexander Korotkov wrote: > > > > I see that pg_wal_replay_wait_status()

Re: pgsql: Implement pg_wal_replay_wait() stored procedure

2024-11-03 Thread Alexander Korotkov
Hi, Heikki! On Mon, Oct 28, 2024 at 9:42 PM Alexander Korotkov wrote: > > On Mon, Oct 28, 2024 at 11:36 AM Heikki Linnakangas wrote: > > > > On 25/10/2024 14:56, Alexander Korotkov wrote: > > > I see that pg_wal_replay_wait_status() might look weird, but it seems > > > to me like the best of fea

Re: Time to add a Git .mailmap?

2024-11-03 Thread Daniel Gustafsson
> On 1 Nov 2024, at 13:53, Peter Eisentraut wrote: > > On 01.11.24 12:53, Alvaro Herrera wrote: >> On 2024-Oct-31, Daniel Gustafsson wrote: >>> When looking at our Git tree for a recent conference presentation I >>> happened to >>> notice that we have recently gained duplicate names in the short

Re: Repeat the condition check twice in function distribute_qual_to_rels

2024-11-03 Thread Tom Lane
"bigbro...@hotmail.com" writes: > I notice that check the condtion again when after invoked process_equivalence > and return failed. > /* EC rejected it, so set left_ec/right_ec the hard way ... */ > if (restrictinfo->mergeopfamilies) /* EC might have changed this */ > Above the cod

Re: EphemeralNamedRelation and materialized view

2024-11-03 Thread Tom Lane
Yugo Nagata writes: > While looking into the commit b4da732fd64e936970f38c792f8b32c4bdf2bcd5, > I noticed that we can create a materialized view using Ephemeral Named > Relation in PostgreSQL 16 or earler. Yeah, we should reject that, but I feel like this patch is not ambitious enough, because t

Re: Inval reliability, especially for inplace updates

2024-11-03 Thread Noah Misch
On Fri, Nov 01, 2024 at 04:38:29PM -0700, Noah Misch wrote: > This was a near miss to having a worst-in-years regression in a minor release, > so I'm proposing this sequence: > > - Revert from non-master branches commits 8e7e672 (inplace180, "WAL-log > inplace update before revealing it to other

Re: Pgoutput not capturing the generated columns

2024-11-03 Thread vignesh C
On Fri, 1 Nov 2024 at 13:27, Hayato Kuroda (Fujitsu) wrote: > > Dear Vignesh, > > Thanks for rebasing the patch! Before reviewing deeply, I want to confirm the > specification. > I understood like below based on the documentation. > > - If publish_generated_columns is false, the publication won't

Re: Pgoutput not capturing the generated columns

2024-11-03 Thread vignesh C
On Thu, 31 Oct 2024 at 16:44, Ajin Cherian wrote: > > > > On Thu, Oct 31, 2024 at 9:55 PM Ajin Cherian wrote: >> >> I ran some tests and verified that the patch works with previous versions of >> PG12 and PG17 >> 1. Verified with publications with generated columns and without generated >> colu

Re: Improve the efficiency of _bt_killitems.

2024-11-03 Thread feichanghong
> On Nov 1, 2024, at 18:50, Heikki Linnakangas wrote: > > On 01/11/2024 10:41, feichanghong wrote: >>> On Nov 1, 2024, at 16:24, Heikki Linnakangas wrote: >>> >>> On 01/11/2024 09:19, feichanghong wrote: Hi hackers, In the _bt_killitems function, the following logic is present: we s