Re: [PATCH] LockAcquireExtended improvement

2024-03-26 Thread Will Mortensen
On Thu, Mar 14, 2024 at 1:15 PM Robert Haas wrote: > Seeing no further discussion, I have committed my version of this > patch, with your test case. This comment on ProcSleep() seems to have the values of dontWait backward (double negatives are tricky): * Result: PROC_WAIT_STATUS_OK if we ac

Re: recovery modules

2024-03-26 Thread Nathan Bossart
another rebase for cfbot -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From 0ccdbb0a010830380e6ff4b7a052198d50f0680f Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Wed, 15 Feb 2023 14:28:53 -0800 Subject: [PATCH v20 1/5] introduce routine for checking mutually exclusive st

Re: Properly pathify the union planner

2024-03-26 Thread Richard Guo
On Wed, Mar 27, 2024 at 6:23 AM David Rowley wrote: > Because this field is set, it plans the CTE thinking it's a UNION > child and breaks when it can't find a SortGroupClause for the CTE's > target list item. Right. The problem here is that we mistakenly think that the CTE query is a subquery

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

2024-03-26 Thread shveta malik
On Tue, Mar 26, 2024 at 9:59 PM Bharath Rupireddy wrote: > > On Tue, Mar 26, 2024 at 4:35 PM Bharath Rupireddy > wrote: > > > > If we just sync inactive_since value for synced slots while in > > recovery from the primary, so be it. Why do we need to update it to > > the current time when the slot

Re: Can't find not null constraint, but \d+ shows that

2024-03-26 Thread Tender Wang
Alvaro Herrera 于2024年3月26日周二 23:25写道: > On 2024-Mar-26, Tender Wang wrote: > > > postgres=# CREATE TABLE t1(c0 int, c1 int); > > postgres=# ALTER TABLE t1 ADD CONSTRAINT Q PRIMARY KEY(c0, c1); > > postgres=# ALTER TABLE t1 DROP c1; > > > > postgres=# ALTER TABLE t1 ALTER c0 DROP NOT NULL; > >

Re: remaining sql/json patches

2024-03-26 Thread jian he
On Tue, Mar 26, 2024 at 6:16 PM jian he wrote: > > On Fri, Mar 22, 2024 at 12:08 AM Amit Langote wrote: > > > > On Wed, Mar 20, 2024 at 9:53 PM Amit Langote > > wrote: > > > I'll push 0001 tomorrow. > > > > Pushed that one. Here's the remaining JSON_TABLE() patch. > > hi. I don't fully unders

Re: remaining sql/json patches

2024-03-26 Thread Amit Langote
On Wed, Mar 27, 2024 at 12:42 PM jian he wrote: > hi. > I don't fully understand all the code in json_table patch. > maybe we can split it into several patches, I'm working on exactly that atm. > like: > * no nested json_table_column. > * nested json_table_column, with PLAN DEFAULT > * nested js

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

2024-03-26 Thread Bharath Rupireddy
On Tue, Mar 26, 2024 at 11:22 PM Bertrand Drouvot wrote: > > > I'm attaching v24 patches. It implements the above idea proposed > > upthread for synced slots. > > v24-0002 > > 1 === > > This commit does two things: > 1) Updates inactive_since for sync slots with the value > receiv

Re: pgsql: Track last_inactive_time in pg_replication_slots.

2024-03-26 Thread Amit Kapila
On Tue, Mar 26, 2024 at 9:10 PM Alvaro Herrera wrote: > > On 2024-Mar-26, Nathan Bossart wrote: > > > FWIW I'd really prefer to have something like max_slot_xid_age for this. A > > time-based parameter would likely help with most cases, but transaction ID > > usage will vary widely from server to

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

2024-03-26 Thread Amit Kapila
On Wed, Mar 27, 2024 at 10:08 AM Bharath Rupireddy wrote: > > On Tue, Mar 26, 2024 at 11:22 PM Bertrand Drouvot > wrote: > > > 3) > > update_synced_slots_inactive_time(): > > > > This assert is removed, is it intentional? > > Assert(s->active_pid == 0); > > Yes, the slot can get acquired in the c

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

2024-03-26 Thread shveta malik
On Wed, Mar 27, 2024 at 10:22 AM Amit Kapila wrote: > > On Wed, Mar 27, 2024 at 10:08 AM Bharath Rupireddy > wrote: > > > > On Tue, Mar 26, 2024 at 11:22 PM Bertrand Drouvot > > wrote: > > > > > 3) > > > update_synced_slots_inactive_time(): > > > > > > This assert is removed, is it intentional?

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

2024-03-26 Thread Bharath Rupireddy
On Wed, Mar 27, 2024 at 10:24 AM shveta malik wrote: > > On Wed, Mar 27, 2024 at 10:22 AM Amit Kapila wrote: > > > > On Wed, Mar 27, 2024 at 10:08 AM Bharath Rupireddy > > wrote: > > > > > > On Tue, Mar 26, 2024 at 11:22 PM Bertrand Drouvot > > > wrote: > > > > > > > 3) > > > > update_synced_sl

Re: Exposing the lock manager's WaitForLockers() to SQL

2024-03-26 Thread Will Mortensen
Rebased, fixed a couple typos, and reordered the isolation tests to put the most elaborate pair last. v11-0001-Refactor-GetLockConflicts-into-more-general-GetL.patch Description: Binary data v11-0002-Allow-specifying-single-lockmode-in-WaitForLocke.patch Description: Binary data v11-0003-Add-

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

2024-03-26 Thread shveta malik
On Tue, Mar 26, 2024 at 6:05 PM Bertrand Drouvot wrote: > > > > We can think on that later if we really need another > > field which give us sync time. > > I think that calling GetCurrentTimestamp() so frequently could be too costly, > so > I'm not sure we should. Agreed. > > In my second appro

Re: Why is parula failing?

2024-03-26 Thread Tom Lane
David Rowley writes: > Unfortunately, REL_16_STABLE does not have the additional debugging, > so don't get to know what reltuples was set to. Let's wait a bit to see if it fails in HEAD ... but if not, would it be reasonable to back-patch the additional debugging output?

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

2024-03-26 Thread Bharath Rupireddy
On Wed, Mar 27, 2024 at 10:08 AM Bharath Rupireddy wrote: > > Please find the attached v25-0001 (made this 0001 patch now as > inactive_since patch is committed) patch with the above changes. Fixed an issue in synchronize_slots where DatumGetLSN is being used in place of DatumGetTimestampTz. Foun

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

2024-03-26 Thread Bertrand Drouvot
Hi, On Wed, Mar 27, 2024 at 10:08:33AM +0530, Bharath Rupireddy wrote: > On Tue, Mar 26, 2024 at 11:22 PM Bertrand Drouvot > wrote: > > > > - if (!(RecoveryInProgress() && slot->data.synced)) > > + if (!(InRecovery && slot->data.synced)) > > slo

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

2024-03-26 Thread shveta malik
On Wed, Mar 27, 2024 at 11:05 AM Bharath Rupireddy wrote: > > Fixed an issue in synchronize_slots where DatumGetLSN is being used in > place of DatumGetTimestampTz. Found this via CF bot member [1], not on > my dev system. > > Please find the attached v6 patch. Thanks for the patch. Few trivial t

Re: Statistics Import and Export

2024-03-26 Thread Corey Huinker
> > > > +\gexec > > Why do we need to construct the command and execute? Can we instead > execute the function directly? That would also avoid ECHO magic. > We don't strictly need it, but I've found the set-difference operation to be incredibly useful in diagnosing problems. Additionally, the valu

Re: Statistics Import and Export

2024-03-26 Thread Corey Huinker
> > 1) The docs say this: > > >The purpose of this function is to apply statistics values in an >upgrade situation that are "good enough" for system operation until >they are replaced by the next ANALYZE, usually via >autovacuum This function is used by >pg_upgrade and pg_res

Re: pg_upgrade and logical replication

2024-03-26 Thread vignesh C
On Mon, 19 Feb 2024 at 12:38, Amit Kapila wrote: > > On Mon, Feb 19, 2024 at 6:54 AM Hayato Kuroda (Fujitsu) > wrote: > > > > Thanks for reviewing! PSA new version. > > > > Pushed this after making minor changes in the comments. Recently there was a failure in 004_subscription tap test at [1]. I

Re: Change GUC hashtable to use simplehash?

2024-03-26 Thread John Naylor
On Wed, Mar 20, 2024 at 11:01 PM Jeff Davis wrote: > > > I found that adding __attribute__((no_sanitize_address)) to > > fasthash_accum_cstring_aligned() passes CI. While this kind of > > exception is warned against (for good reason), I think it's fine here > > given that glibc and NetBSD, and pro

Re: Propagate pathkeys from CTEs up to the outer query

2024-03-26 Thread Richard Guo
On Wed, Mar 27, 2024 at 1:20 AM Tom Lane wrote: > Richard Guo writes: > > I agree with your points. Previously I was thinking that CTEs were the > > only scenario where we needed to remember the best path and only > > required the best path's pathkeys. However, considering potential > > future

Re: pgsql: Track last_inactive_time in pg_replication_slots.

2024-03-26 Thread Bharath Rupireddy
On Wed, Mar 27, 2024 at 10:10 AM Amit Kapila wrote: > > On Tue, Mar 26, 2024 at 9:10 PM Alvaro Herrera > wrote: > > > > On 2024-Mar-26, Nathan Bossart wrote: > > > > > FWIW I'd really prefer to have something like max_slot_xid_age for this. > > > A > > > time-based parameter would likely help

<    1   2