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

2024-11-13 Thread vignesh C
On Thu, 7 Nov 2024 at 15:33, Nisha Moond wrote: > > On Mon, Sep 16, 2024 at 3:31 PM Bharath Rupireddy > wrote: > > > > Please find the attached v46 patch having changes for the above review > > comments and your test review comments and Shveta's review comments. > > > Hi, > > I’ve reviewed this t

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

2024-11-13 Thread Nisha Moond
On Wed, Sep 18, 2024 at 12:22 PM shveta malik wrote: > > On Mon, Sep 16, 2024 at 3:31 PM Bharath Rupireddy > wrote: > > > > Hi, > > > > > > Please find the attached v46 patch having changes for the above review > > comments and your test review comments and Shveta's review comments. > > > > Thank

Some dead code in get_param_path_clause_serials()

2024-11-13 Thread Richard Guo
The function get_param_path_clause_serials() is used to get the set of pushed-down clauses enforced within a parameterized Path. Since we don't currently support parameterized MergeAppend paths, and it doesn't look like that is going to change anytime soon (as explained in the comments for generat

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Tomas Vondra
On 11/13/24 05:38, Ashutosh Bapat wrote: > ... > > Here's way we can fix SnapBuildProcessRunningXacts() similar to > DecodeCommit(). DecodeCommit() uses SnapBuildXactNeedsSkip() to decide > whether a given transaction should be decoded or not. > /* > * Should the contents of transaction ending at

BitmapOr node not used in plan for ANY/IN but is for sequence of ORs ...

2024-11-13 Thread Jim Vanns
(sent to general users mailing list yesterday - but perhaps this is a more suitable audience?) In PG16.4, we have a table of key/pair data (around 30M rows) where there are about 7 distinct keys and each has a conditional or partial index on them (the distribution is different for each key/value p

Re: doc fail about ALTER TABLE ATTACH re. NO INHERIT

2024-11-13 Thread Amit Langote
On Tue, Nov 12, 2024 at 5:46 PM Alvaro Herrera wrote: > On 2024-Nov-11, Amit Langote wrote: > > > The restriction also exists in the CREATE TABLE PARTITION OF path: > > > > [...] > > > > I think we can remove the restriction at least for the leaf partition > > case just like in the ATTACH PARTITIO

Re: altering a column's collation leaves an invalid foreign key

2024-11-13 Thread jian he
On Thu, Nov 7, 2024 at 8:15 PM Peter Eisentraut wrote: > > Apparently this is intentional. It's the difference between RESTRICT > and NO ACTION. In ri_restrict(), there is a comment: > > /* > * If another PK row now exists providing the old key values, we should > * not do anyth

Re: Some dead code in get_param_path_clause_serials()

2024-11-13 Thread Andrei Lepikhov
On 11/13/24 16:34, Richard Guo wrote: The function get_param_path_clause_serials() is used to get the set of pushed-down clauses enforced within a parameterized Path. Since we don't currently support parameterized MergeAppend paths, and it doesn't look like that is going to change anytime soon (

Re: Converting contrib SQL functions to new style

2024-11-13 Thread Ronan Dunklau
Le mardi 12 novembre 2024, 09:30:30 heure normale d’Europe centrale Michael Paquier a écrit : > On Thu, Nov 07, 2024 at 10:06:37AM +0900, Michael Paquier wrote: > > Good point. Checking all these contrib updates one-by-one is an ant's > > work, but I'll see if I can get at least some of them done

Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

2024-11-13 Thread Yugo NAGATA
On Tue, 12 Nov 2024 17:38:25 +0900 torikoshia wrote: > On 2024-11-12 14:17, Yugo Nagata wrote: > > On Tue, 12 Nov 2024 14:03:50 +0900 > > Yugo Nagata wrote: > > > >> On Tue, 12 Nov 2024 01:27:53 +0500 > >> Kirill Reshke wrote: > >> > >> > On Mon, 11 Nov 2024 at 16:11, torikoshia > >> > wrot

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

2024-11-13 Thread Nisha Moond
Please find the v48 patch attached. On Thu, Sep 19, 2024 at 9:40 AM shveta malik wrote: > > When we promote hot standby with synced logical slots to become new > primary, the logical slots are never invalidated with > 'inactive_timeout' on new primary. It seems the check in > SlotInactiveTimeout

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Amit Kapila
On Tue, Nov 12, 2024 at 6:29 PM Tomas Vondra wrote: > > Sure, maybe fixing LogicalIncreaseRestartDecodingForSlot() is enough to > fix this particular case. But I'd be happier if we could also add > asserts checking the LSN advances, to detect similar issues that we may > be unaware of yet. > As m

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Tomas Vondra
On 11/13/24 10:38, Amit Kapila wrote: > On Tue, Nov 12, 2024 at 6:29 PM Tomas Vondra wrote: >> >> Sure, maybe fixing LogicalIncreaseRestartDecodingForSlot() is enough to >> fix this particular case. But I'd be happier if we could also add >> asserts checking the LSN advances, to detect similar

Re: Add reject_limit option to file_fdw

2024-11-13 Thread torikoshia
On 2024-11-12 15:23, Kirill Reshke wrote: Thanks for your review! On Tue, 12 Nov 2024 at 06:17, torikoshia wrote: On 2024-11-12 01:49, Fujii Masao wrote: > On 2024/11/11 21:45, torikoshia wrote: >>> Thanks for adding the comment. It clearly states that REJECT_LIMIT >>> can be >>> a single-qu

Re: Add reject_limit option to file_fdw

2024-11-13 Thread torikoshia
On 2024-11-12 14:51, Yugo Nagata wrote: Thanks for your review! On Tue, 12 Nov 2024 10:16:50 +0900 torikoshia wrote: On 2024-11-12 01:49, Fujii Masao wrote: > On 2024/11/11 21:45, torikoshia wrote: >>> Thanks for adding the comment. It clearly states that REJECT_LIMIT >>> can be >>> a single

Re: BitmapOr node not used in plan for ANY/IN but is for sequence of ORs ...

2024-11-13 Thread Tomas Vondra
On 11/13/24 13:08, Jim Vanns wrote: > (sent to general users mailing list yesterday - but perhaps this is a > more suitable audience?) > > In PG16.4, we have a table of key/pair data (around 30M rows) where > there are about 7 distinct keys and each has a conditional or partial > index on them (th

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Tomas Vondra
On 11/13/24 11:59, Amit Kapila wrote: > On Tue, Nov 12, 2024 at 12:43 PM Ashutosh Bapat > wrote: >> >> On Tue, Nov 12, 2024 at 12:02 PM Masahiko Sawada >> wrote: >>> >>> On Mon, Nov 11, 2024 at 2:08 PM Tomas Vondra wrote: But neither of those fixes prevents backwards move for

Re: define pg_structiszero(addr, s, r)

2024-11-13 Thread Ranier Vilela
Em qua., 13 de nov. de 2024 às 04:50, Bertrand Drouvot < bertranddrouvot...@gmail.com> escreveu: > Hi, > > On Wed, Nov 13, 2024 at 09:25:37AM +0900, Michael Paquier wrote: > > So that seems worth the addition, especially for > > smaller sizes where this is 6 times faster here. > > So, something li

Re: Converting contrib SQL functions to new style

2024-11-13 Thread Peter Eisentraut
On 13.11.24 09:15, Ronan Dunklau wrote: Le mardi 12 novembre 2024, 09:30:30 heure normale d’Europe centrale Michael Paquier a écrit : On Thu, Nov 07, 2024 at 10:06:37AM +0900, Michael Paquier wrote: Good point. Checking all these contrib updates one-by-one is an ant's work, but I'll see if I c

Re: Enable data checksums by default

2024-11-13 Thread Peter Eisentraut
On 07.11.24 19:38, Alvaro Herrera wrote: I have just noticed that since this patch was committed as 04bec894a04c, pg_upgrade's "make check" action is unusable when given the "olddump/oldinstall" options. We now need to inject '-k' to the initdb line for old servers, and we don't, so all upgrade

Re: SQL:2011 application time

2024-11-13 Thread Peter Eisentraut
I have committed the documentation patches v43-0001-Add-WITHOUT-OVERLAPS-and-PERIOD-to-ALTER-TABLE-r.patch v43-0002-Update-conexclop-docs-for-WITHOUT-OVERLAPS.patch For the logical replication fixes v43-0003-Fix-logical-replication-for-temporal-tables.patch can you summarize what the issues cu

Writing out WAL buffers that are still in flux

2024-11-13 Thread Thomas Munro
Hi, As we learned in the build farm[1], at least one checksumming filesystem doesn't like it if you write data from memory that is still changing, when direct I/O is enabled. That was BTRFS, but the next version of OpenZFS seems to have a similar allergy. In Andres's thread about fixing that (am

Re: Add reject_limit option to file_fdw

2024-11-13 Thread Yugo NAGATA
On Wed, 13 Nov 2024 21:48:10 +0900 torikoshia wrote: > On 2024-11-12 14:51, Yugo Nagata wrote: > > Thanks for your review! > > > On Tue, 12 Nov 2024 10:16:50 +0900 > > torikoshia wrote: > > > >> On 2024-11-12 01:49, Fujii Masao wrote: > >> > On 2024/11/11 21:45, torikoshia wrote: > >> >>> Tha

Re: POC: make mxidoff 64 bits

2024-11-13 Thread Maxim Orlov
On Tue, 12 Nov 2024 at 02:31, Heikki Linnakangas wrote: > The wraparound logic is still not correct. Yep, my fault. I forget to reset segment counter if wraparound is happened. Fixed. When I try to select from a table after upgrade that contains > post-wraparound multixids: > > TRAP: failed Ass

Re: FW: Building Postgres 17.0 with meson

2024-11-13 Thread Nazir Bilal Yavuz
Hi, On Wed, 13 Nov 2024 at 18:17, Mark Hill wrote: > > The error above says meson can't find openssl/ssl.h but it's there: > D:\Jenkins\workspace\workspace\Postgres-9.4\PostgreSQL\postgres-Source\buildPostgreSQL_wx6_17.0\postgresql-17.0>dir > > D:\Jenkins\workspace\workspace\Postgres-9.4\OpenSS

Fwd: pgsql-hack...@postgresql.org VS pgsql-hackers@lists.postgresql.org

2024-11-13 Thread Tony Wayne
-- Forwarded message - From: Tony Wayne Date: Wed, Nov 13, 2024 at 9:07 PM Subject: Re: pgsql-hack...@postgresql.org VS pgsql-hackers@lists.postgresql.org To: Kai Wagner On Wed, Nov 13, 2024 at 8:55 PM Kai Wagner wrote: > Hi Tony, > > pgsql-hackers@lists.postgresql.org is th

Re: proposal: schema variables

2024-11-13 Thread Dmitry Dolgov
> On Sun, Nov 10, 2024 at 06:51:40PM GMT, Pavel Stehule wrote: > ne 10. 11. 2024 v 17:19 odesílatel Pavel Stehule > napsal: > I thought a lot of time about better solutions for identifier collisions > and I really don't think so there is some consistent user friendly syntax. > Personally I think t

Re: pgsql-hack...@postgresql.org VS pgsql-hackers@lists.postgresql.org

2024-11-13 Thread Kai Wagner
Hi Tony, pgsql-hackers@lists.postgresql.org is the correct mailing list to send patches. Kai On 13/11/2024 16:18, Tony Wayne wrote: Hi Hackers, Can you please tell which mail should we use to send Patches or POCs or start a discussion? Regards, Tony Wayne. -- Kai Wagner Sr. Engineering

Re: Allow default \watch interval in psql to be configured

2024-11-13 Thread Daniel Gustafsson
> On 4 Nov 2024, at 14:55, Kirill Reshke wrote: > I'm mostly fine with this patch, Thanks for review! > but maybe we need to handle `errno == > ERANGE` inside ParseVariableDouble and provide a better error msg in > this case? > Something like: > ``` > reshke=# \set WATCH_INTERVAL -1e-309 > unde

Re: New GUC autovacuum_max_threshold ?

2024-11-13 Thread wenhui qiu
HI > In any case, we should do the tests that Robert suggested and/or come up > with a good mathematical model, because we are in the dark at the moment. I think SQL Server has given us great inspiration >I think we should indeed provide a retro-compatible behaviour (so maybe > another GUC after al

Re: Parametrization minimum password lenght

2024-11-13 Thread Emanuele Musella
Hi Tomas, we have done the fixes that you have suggested us in the last mail. 1) Modified passwordcheck.sql with a_nice_long_password and also passwordcheck.out 2) we added the documentation in the doc/src/sgml/passwordcheck.sgml. 3) we have done make check successfully. If you have other sugg

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Peter Geoghegan
On Wed, Nov 13, 2024 at 11:07 AM Tomas Vondra wrote: > My plan was to apply the patch to both 17 and HEAD, and then maybe do > something smarter in HEAD in a separate commit. But then Michael pointed > out other pageinspect functions just error out in this version-mismatch > cases, so I think it's

Re: Reordering DISTINCT keys to match input path's pathkeys

2024-11-13 Thread Andrei Lepikhov
On 11/13/24 13:49, Richard Guo wrote: On Mon, Oct 28, 2024 at 6:15 PM Andrei Lepikhov wrote: On 6/7/24 16:46, Richard Guo wrote: This patch does not apply any more, so here is a new rebase, with some tweaks to the comments. This patch needs a minor rebase again. After skimming the code, I w

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Amit Kapila
On Tue, Nov 12, 2024 at 12:43 PM Ashutosh Bapat wrote: > > On Tue, Nov 12, 2024 at 12:02 PM Masahiko Sawada > wrote: > > > > On Mon, Nov 11, 2024 at 2:08 PM Tomas Vondra wrote: > > > > > > > > > But neither of those fixes prevents backwards move for confirmed_flush > > > LSN, as enforced by ass

Re: SQL:2011 application time

2024-11-13 Thread Peter Eisentraut
I committed a few fixes in this area today. Has everything here been addressed? On 16.08.24 04:12, jian he wrote: On Thu, Aug 8, 2024 at 4:54 AM Paul Jungwirth wrote: Rebased to e56ccc8e42. I only applied to 0001-0003. in create_table.sgml, I saw the WITHOUT OVERLAPS change is mainly in

Re: SQL:2011 application time

2024-11-13 Thread Peter Eisentraut
A quick comment on the patch v43-0005-Add-UPDATE-DELETE-FOR-PORTION-OF.patch regarding the code in transformForPortionOfClause() and the additions you made to lsyscache.c: What you are doing is taking a type OID and a function OID and then converting them back to name and namespace and then

Re: Enable data checksums by default

2024-11-13 Thread Alvaro Herrera
On 2024-Nov-13, Peter Eisentraut wrote: > On 07.11.24 19:38, Alvaro Herrera wrote: > > I have just noticed that since this patch was committed as 04bec894a04c, > > pg_upgrade's "make check" action is unusable when given the > > "olddump/oldinstall" options. We now need to inject '-k' to the initd

RE: Parallel heap vacuum

2024-11-13 Thread Hayato Kuroda (Fujitsu)
Dear Sawada-san, > TidStoreBeginIterateShared() is designed for multiple parallel workers > to iterate a shared TidStore. During an iteration, parallel workers > share the iteration state and iterate the underlying radix tree while > taking appropriate locks. Therefore, it's available only for a s

Re: New GUC autovacuum_max_threshold ?

2024-11-13 Thread Frédéric Yhuel
On 11/9/24 16:59, Nathan Bossart wrote: AFAICT the main advantage of these formulas is that you don't need another GUC, but they also makes the existing ones more difficult to configure. I wouldn't say that's the main advantage. It doesn't seem very clean to me to cap to a fixed value. Beca

Re: doc: pgevent.dll location

2024-11-13 Thread Peter Eisentraut
On 12.11.24 17:52, Peter Eisentraut wrote: So the most straightforward way to "make it work like it used to" would be to change src/bin/pgevent/meson.build to use shared_module() instead of shared_library(). I developed the attached patch for this. I haven't tested it locally, but I checked i

Re: Commit Timestamp and LSN Inversion issue

2024-11-13 Thread Amit Kapila
On Tue, Nov 12, 2024 at 5:30 PM Tomas Vondra wrote: > > On 11/12/24 04:05, Amit Kapila wrote: > > > > Right, and the patch sent by Hou-San [1] (based on the original patch > > by Jan) is somewhat on these lines. The idea you have shared or > > implemented by the patch is a logical clock stored in

Re: Skip collecting decoded changes of already-aborted transactions

2024-11-13 Thread Masahiko Sawada
On Mon, Nov 11, 2024 at 5:40 PM Peter Smith wrote: > > On Tue, Nov 12, 2024 at 5:00 AM Masahiko Sawada wrote: > > > > I've attached the updated patch. > > > > Hi, here are some review comments for the latest v6-0001. > > == > contrib/test_decoding/sql/stats.sql > > 1. > +INSERT INTO stats_tes

Re: proposal: schema variables

2024-11-13 Thread Pavel Stehule
st 13. 11. 2024 v 17:35 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Sun, Nov 10, 2024 at 06:51:40PM GMT, Pavel Stehule wrote: > > ne 10. 11. 2024 v 17:19 odesílatel Pavel Stehule < > pavel.steh...@gmail.com> > > napsal: > > I thought a lot of time about better solutions for ide

Re: Skip collecting decoded changes of already-aborted transactions

2024-11-13 Thread Masahiko Sawada
On Tue, Nov 12, 2024 at 7:29 PM vignesh C wrote: > > On Mon, 11 Nov 2024 at 23:30, Masahiko Sawada wrote: > > > > On Sun, Nov 10, 2024 at 11:24 PM Peter Smith wrote: > > > > > > Hi Sawada-San, here are some review comments for the patch v5-0001. > > > > > > > Thank you for reviewing the patch! >

Graceful way to handle too many locks

2024-11-13 Thread Chris Cleveland
In my extension I got a mystery error: TRAP: failed Assert("InterruptHoldoffCount > 0"), File: "lwlock.c", Line: 1869, PID: 62663 0 postgres 0x00010135adb4 ExceptionalCondition + 108 1 postgres 0x0001012235ec LWLockRelease + 1456 2 postgres 0x0001011faebc UnlockReleaseBuffer + 24 Turn

Re: no library dependency in Makefile?

2024-11-13 Thread Noah Misch
This burned me recently. On Sun, Nov 26, 2017 at 02:18:16PM +0800, 高增琦 wrote: > Update version: > 1. Re-base with head of master > 2. Add some basic support for PGXS > > After replacing submake-libpgport/submake-libpgfeutils with > $(stlib_pgport)/$(stlib_pgfeutils) in > Makefiles of client progr

Re: Graceful way to handle too many locks

2024-11-13 Thread Tomas Vondra
On 11/13/24 20:05, Chris Cleveland wrote: > In my extension I got a mystery error: > > TRAP: failed Assert("InterruptHoldoffCount > 0"), File: "lwlock.c", > Line: 1869, PID: 62663 > 0postgres 0x00010135adb4ExceptionalCondition + 108 > 1postgres 0x0001012235ecLWLockRelease + 1456 > 2post

Re: .ready and .done files considered harmful

2024-11-13 Thread Robert Haas
On Wed, Nov 13, 2024 at 11:05 AM Alvaro Herrera wrote: > So, my question now is, would there be much opposition to backpatching > beb4e9ba1652 + 1fb17b190341 to REL_14_STABLE? It seems like it's been long enough now that if the new logic had major problems we probably would have found them by now

Re: pg_combinebackup --incremental

2024-11-13 Thread Jakub Wartak
On Mon, Nov 4, 2024 at 6:53 PM Robert Haas wrote: Hi Robert, [..] 1. Well, I have also the same bug as Bertrand which seems to be because MacOS was used development rather than Linux (and thus MacOS doesnt have copy_file_range(2)/HAVE_COPY_FILE_RANGE) --> I've simply fallen back to undefHAVE_C

Re: doc fail about ALTER TABLE ATTACH re. NO INHERIT

2024-11-13 Thread Alvaro Herrera
On 2024-Nov-13, Amit Langote wrote: > I rebased my patch over 14e87ffa5c54 and noticed that NOT NULL > constraints can also (or not) be marked NO INHERIT. I think we should > allow NO INHERIT NOT NULL constraints on leaf partitions just like > CHECK constraints, so changed AddRelationNotNullConst

Re: proposal: schema variables

2024-11-13 Thread Pavel Stehule
st 13. 11. 2024 v 15:24 odesílatel Laurenz Albe napsal: > Thanks for the updated patch set. > > Here is my review of patch 0005: > > > --- a/src/backend/access/transam/xact.c > > +++ b/src/backend/access/transam/xact.c > > +#include "commands/session_variable.h" > > You probably forgot to move th

RE: FW: Building Postgres 17.0 with meson

2024-11-13 Thread Mark Hill
EXTERNAL On Wed, Nov 6, 2024 at 4:21 PM Robert Hass wrote: > I am not an expert on this topic, but do use these options on macOS and they > do work for me. A typical 'meson setup' invocation for me is: > meson setup $HOME/pgsql $HOME/pgsql-meson -Dcassert=true -Ddebug=true > -Dextra_include_di

pgsql-hack...@postgresql.org VS pgsql-hackers@lists.postgresql.org

2024-11-13 Thread Tony Wayne
Hi Hackers, Can you please tell which mail should we use to send Patches or POCs or start a discussion? Regards, Tony Wayne.

Re: pgsql-hack...@postgresql.org VS pgsql-hackers@lists.postgresql.org

2024-11-13 Thread David G. Johnston
On Wed, Nov 13, 2024 at 8:18 AM Tony Wayne wrote: > Can you please tell which mail should we use to send Patches or POCs or > start a discussion? > > The "lists" subdomain is the real one; the other is legacy and now just an alias. David J.

Re: Infinite loop in XLogPageRead() on standby

2024-11-13 Thread Alexander Kukushkin
Hi Michael, Now that v17 is released and before v18 feature freeze we have a few months, I hope you will find some time to look at it. On Wed, 5 Jun 2024 at 07:09, Michael Paquier wrote: > On Tue, Jun 04, 2024 at 04:16:43PM +0200, Alexander Kukushkin wrote: > > Now that beta1 was released I hop

Re: Avoiding superfluous buffer locking during nbtree backwards scans

2024-11-13 Thread Peter Geoghegan
On Tue, Nov 12, 2024 at 10:14 PM Masahiro Ikeda wrote: > On 2024-11-13 00:55, Peter Geoghegan wrote: > > The wrapper function has extra assertions, compared to what we do > > already. It's slightly more defensive, and IMV slightly clearer. > > Thanks, I agree with adding the function for refactori

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Tomas Vondra
On 11/12/24 08:39, Michael Paquier wrote: > On Mon, Nov 11, 2024 at 07:32:10PM +0100, Tomas Vondra wrote: >> This adds an out argument to brin_page_items, but I failed to consider >> the user may still run with an older version of the extension - either >> after pg_upgrade (as in the report), or

Re: .ready and .done files considered harmful

2024-11-13 Thread Alvaro Herrera
Hello, sorry for necro-posting here: On 2021-May-03, Robert Haas wrote: > I and various colleagues of mine have from time to time encountered > systems that got a bit behind on WAL archiving, because the > archive_command started failing and nobody noticed right away. We've recently had a couple

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Tomas Vondra
On 11/12/24 09:04, Hayato Kuroda (Fujitsu) wrote: > Dear Tomas, > >> Here's a fix for pageinspect bug in PG17, reported in [1]. The bug turns >> out to be introduced by my commit > > I could not see the link, but I think it is [1], right? > Right. Apologies, I forgot to include the link. >> >>

Re: Speed up TransactionIdIsCurrentTransactionId() with lots of subxacts

2024-11-13 Thread Bertrand Drouvot
Hi, On Fri, Oct 11, 2024 at 12:21:12AM +0300, Heikki Linnakangas wrote: > > + 98.52%98.45% postgres postgres [.] > > TransactionIdIsCurrentTransactionId > In this scenario with lots of active subtransactions, > TransactionIdIsCurrentTranactionId effectively degenerates into a lin

Re: btree: implement dynamic prefix truncation (was: Improving btree performance through specializing by key shape, take 2)

2024-11-13 Thread Dmitry Dolgov
> On Tue, Aug 13, 2024 at 02:39:10PM GMT, Peter Geoghegan wrote: > On Tue, Aug 6, 2024 at 5:42 PM Matthias van de Meent > wrote: > > Attached is version 16 now. > > I ran this with my old land registry benchmark, used for validating > the space utilization impact of nbtree deduplication (among oth

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Tomas Vondra
On 11/13/24 18:20, Peter Geoghegan wrote: > On Wed, Nov 13, 2024 at 11:07 AM Tomas Vondra wrote: >> My plan was to apply the patch to both 17 and HEAD, and then maybe do >> something smarter in HEAD in a separate commit. But then Michael pointed >> out other pageinspect functions just error out

Re: Graceful way to handle too many locks

2024-11-13 Thread Robert Haas
On Wed, Nov 13, 2024 at 2:05 PM Chris Cleveland wrote: > In my extension I got a mystery error: > > TRAP: failed Assert("InterruptHoldoffCount > 0"), File: "lwlock.c", Line: > 1869, PID: 62663 > 0 postgres 0x00010135adb4 ExceptionalCondition + 108 > 1 postgres 0x0001012235ec LWLockRelease

Re: split func.sgml to separated individual sgml files

2024-11-13 Thread Corey Huinker
> > The following is step-by-step logic. > > The end result (one file per section) seems good to me. I suspect that reviewer burden may be the biggest barrier to going forward. Perhaps breaking up the changes so that each new sect1 file gets its own commit, allowing the reviewer to more easily (if

Re: btree: implement dynamic prefix truncation (was: Improving btree performance through specializing by key shape, take 2)

2024-11-13 Thread Peter Geoghegan
On Wed, Nov 13, 2024 at 3:30 PM Dmitry Dolgov <9erthali...@gmail.com> wrote: > > On Tue, Aug 13, 2024 at 02:39:10PM GMT, Peter Geoghegan wrote: > > On Tue, Aug 6, 2024 at 5:42 PM Matthias van de Meent > > To be clear, this test involves bulk loading of an unlogged table (the > > land registry table

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Masahiko Sawada
On Wed, Nov 13, 2024 at 3:53 AM Tomas Vondra wrote: > > > > On 11/13/24 10:38, Amit Kapila wrote: > > On Tue, Nov 12, 2024 at 6:29 PM Tomas Vondra wrote: > >> > >> Sure, maybe fixing LogicalIncreaseRestartDecodingForSlot() is enough to > >> fix this particular case. But I'd be happier if we could

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Tomas Vondra
On 11/14/24 00:33, Masahiko Sawada wrote: > On Wed, Nov 13, 2024 at 3:53 AM Tomas Vondra wrote: >> >> >> >> On 11/13/24 10:38, Amit Kapila wrote: >>> On Tue, Nov 12, 2024 at 6:29 PM Tomas Vondra wrote: Sure, maybe fixing LogicalIncreaseRestartDecodingForSlot() is enough to fix t

Re: Converting contrib SQL functions to new style

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 09:39:06AM +0100, Peter Eisentraut wrote: > By the way, if we're going to touch all these extension script files to make > them more modern SQL-like, we could also use named parameters more. Sounds like a good idea to do. Thanks for the suggestion. -- Michael signature.a

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Masahiko Sawada
On Wed, Nov 13, 2024 at 3:47 PM Tomas Vondra wrote: > > > > On 11/14/24 00:33, Masahiko Sawada wrote: > > On Wed, Nov 13, 2024 at 3:53 AM Tomas Vondra wrote: > >> > >> > >> > >> On 11/13/24 10:38, Amit Kapila wrote: > >>> On Tue, Nov 12, 2024 at 6:29 PM Tomas Vondra wrote: > > Sure, ma

Re: On non-Windows, hard depend on uselocale(3)

2024-11-13 Thread Thomas Munro
On Wed, Oct 2, 2024 at 1:04 AM Peter Eisentraut wrote: > On 28.08.24 20:50, Peter Eisentraut wrote: > > I suggest that the simplification of the xlocale.h configure tests could > > be committed separately. This would also be useful independent of this, > > and it's a sizeable chunk of this patch.

Converting SetOp to read its two inputs separately

2024-11-13 Thread Tom Lane
Here are the beginnings of a patchset to do what was discussed at [1], namely change the SetOp node type to read its inputs as outerPlan and innerPlan, rather than appending them together with a flag column to show which rows came from where. The previous thread wondered why manually DISTINCT'ing

Re: pgsql-hack...@postgresql.org VS pgsql-hackers@lists.postgresql.org

2024-11-13 Thread * Neustradamus *
Dear all, Can you remove all alias to *@postgresql.org, etc. because it is a problem of spam... And please inform to all that the good ML are *@lists.postgresql.org. Thanks in advance. Regards, Neustradamus From: Kai Wagner Sent: Wednesday, November 1

Re: define pg_structiszero(addr, s, r)

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 07:50:50AM +, Bertrand Drouvot wrote: > I did a quick check with clang and it looks like it is not as smart as gcc > for the non inline case. Not as much, still smart enough to skip the > 64B part when dealing with a structure that does not require it. So it's actually

Re: altering a column's collation leaves an invalid foreign key

2024-11-13 Thread jian he
On Wed, Nov 13, 2024 at 8:56 PM jian he wrote: > > https://stackoverflow.com/questions/14921668/difference-between-restrict-and-no-action > mentioned about the difference between "no action" and "restrict". > > RI_FKey_restrict_upd comments also says: > > * The SQL standard intends that this refe

Re: Skip collecting decoded changes of already-aborted transactions

2024-11-13 Thread Peter Smith
Hi Sawda-San, Here are some more review comments for the latest (accidentally called v6 again?) v6-0001 patch. == contrib/test_decoding/sql/stats.sql 1. +-- Execute a transaction that is prepared and aborted. We detect that the +-- transaction is aborted before spilling changes, and then ski

Re: Enhancing Memory Context Statistics Reporting

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 01:00:52PM +0530, Rahila Syed wrote: > I used one DSA area per process to share statistics. Currently, > the size limit for each DSA is 16 MB, which can accommodate > approximately 6,700 MemoryContextInfo structs. Any additional > statistics will spill over to a file. I opte

Re: Converting contrib SQL functions to new style

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 09:15:08AM +0100, Ronan Dunklau wrote: > Ok, please find attached a new complete patch series including tests for the > uncovered functions. Tests pass both before and after the move to SQL-body > functions. In 0001 for the tests of contrib/xml2/, you have forgotten to up

Re: Statistics Import and Export

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 01:04:32AM -0500, Corey Huinker wrote: > Makes sense, and the fix is changing a single character (unless we think it > warrants a test case). I'd suggest to add a small test case, actually. Like all the other tests of stats_import.sql, the error happens quickly meaning tha

Re: .ready and .done files considered harmful

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 02:52:31PM -0500, Robert Haas wrote: > On Wed, Nov 13, 2024 at 11:05 AM Alvaro Herrera > wrote: >> So, my question now is, would there be much opposition to backpatching >> beb4e9ba1652 + 1fb17b190341 to REL_14_STABLE? > > It seems like it's been long enough now that if t

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 09:00:30PM +0100, Tomas Vondra wrote: > Does that mean you think we should fix the issue at hand differently? > Say, by looking at number of columns and building the correct tuple, > like I did in my initial patch? 691e8b2e18 is not something I would have done when it comes

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Peter Geoghegan
On Wed, Nov 13, 2024 at 7:48 PM Michael Paquier wrote: > On Wed, Nov 13, 2024 at 09:00:30PM +0100, Tomas Vondra wrote: > > Does that mean you think we should fix the issue at hand differently? > > Say, by looking at number of columns and building the correct tuple, > > like I did in my initial pat

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Peter Geoghegan
On Wed, Nov 13, 2024 at 3:00 PM Tomas Vondra wrote: > Does that mean you think we should fix the issue at hand differently? > Say, by looking at number of columns and building the correct tuple, > like I did in my initial patch? I don't feel strongly about it either way. But if it was my fix I'd

Re: Reordering DISTINCT keys to match input path's pathkeys

2024-11-13 Thread Richard Guo
On Wed, Nov 13, 2024 at 7:36 PM Andrei Lepikhov wrote: > On 11/13/24 13:49, Richard Guo wrote: > > Thanks for reviewing this patch. After some consideration, I think > > it's not too complex to also apply this optimization to DISTINCT ON. > > The parser already ensures that the DISTINCT ON expres

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

2024-11-13 Thread Peter Smith
Hi Nisha. Thanks for the recent patch updates. Here are my review comments for the latest patch v48-0001. == Commit message 1. Till now, postgres has the ability to invalidate inactive replication slots based on the amount of WAL (set via max_slot_wal_keep_size GUC) that will be needed for t

Re: [PATCH] Refactor SLRU to always use long file names

2024-11-13 Thread Michael Paquier
On Tue, Nov 12, 2024 at 05:37:02PM +0300, Aleksander Alekseev wrote: > Also it occured to me that as a 4th option we could just get rid of > this check. Users however will pay the price every time they execute > pg_upgrade so I doubt we are going to do this. We cannot remove the check, or Nathan w

Re: Fix for pageinspect bug in PG 17

2024-11-13 Thread Michael Paquier
On Wed, Nov 13, 2024 at 07:54:03PM -0500, Peter Geoghegan wrote: > On Wed, Nov 13, 2024 at 7:48 PM Michael Paquier wrote: >> 691e8b2e18 is not something I would have done when it comes to >> pageinspect, FWIW. There is the superuser argument for this module, >> so I'd vote for an error and apply

RE: Fix for pageinspect bug in PG 17

2024-11-13 Thread Hayato Kuroda (Fujitsu)
Dear Tomas, Thanks for updating the patch. I've tested new patch and confirmed the brin_pgage_items() could error out: ``` postgres=# SELECT * FROM brin_page_items(get_raw_page('foo_id_idx', 2), 'foo_id_idx'); ERROR: function has wrong number of declared columns HINT: To resolve the problem,

Support for NO INHERIT to INHERIT state change with named NOT NULL constraints

2024-11-13 Thread Suraj Kharage
Hi, Upstream commit 14e87ffa5c543b5f30ead7413084c25f7735039f added the support for named NOT NULL constraints which are INHERIT by default. We can declare those as NO INHERIT which means those constraints will n

Re: RFC: Extension Packaging & Lookup

2024-11-13 Thread David E. Wheeler
On Nov 7, 2024, at 10:30, David E. Wheeler wrote: > Last week I tried to integrate all the ideas into this thread and the > previous[1] into a single proposal that attempts to work through all the > implications and issues. I’ve drafted it as a blog post[2] and plan to > publish it next week,

Re: Speed up TransactionIdIsCurrentTransactionId() with lots of subxacts

2024-11-13 Thread Heikki Linnakangas
On 13/11/2024 18:08, Bertrand Drouvot wrote: === 1 + parentOffset--; + parents[parentOffset]->totalXids = totalXids; what about "parents[--parentOffset]->totalXids = totalXids;" instead? That would remove the ability for someone to insert code between the decrement and the array access. IM

Re: Some dead code in get_param_path_clause_serials()

2024-11-13 Thread Richard Guo
On Wed, Nov 13, 2024 at 9:59 PM Andrei Lepikhov wrote: > On 11/13/24 16:34, Richard Guo wrote: > > The function get_param_path_clause_serials() is used to get the set of > > pushed-down clauses enforced within a parameterized Path. Since we > > don't currently support parameterized MergeAppend pa

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

2024-11-13 Thread vignesh C
On Wed, 13 Nov 2024 at 15:00, Nisha Moond wrote: > > Please find the v48 patch attached. > > On Thu, Sep 19, 2024 at 9:40 AM shveta malik wrote: > > > > When we promote hot standby with synced logical slots to become new > > primary, the logical slots are never invalidated with > > 'inactive_time

Improve the error message for logical replication of regular column to generated column.

2024-11-13 Thread Shubham Khanna
Hi all, Recently there was an issue reported by Kuroda-san on a different thread [1]. I have created this thread to discuss the issue separately. Currently, the ERROR message for the replication of a regular column on the publisher node to a generated column on the subscriber node is:- ERROR: log

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Michael Paquier
On Thu, Nov 14, 2024 at 11:45:56AM +0530, Ashutosh Bapat wrote: > Here's a quick and dirty patch which describes the idea. I didn't get > time to implement code to move SnapBuild::restart_lsn if > SnapBuild::start_decoding_at moves forward while building initial > snapshot. I am not sure whether th

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Ashutosh Bapat
Thanks for noticing it. Sorry. Attached. On Thu, Nov 14, 2024 at 12:04 PM Michael Paquier wrote: > > On Thu, Nov 14, 2024 at 11:45:56AM +0530, Ashutosh Bapat wrote: > > Here's a quick and dirty patch which describes the idea. I didn't get > > time to implement code to move SnapBuild::restart_lsn

Re: per backend I/O statistics

2024-11-13 Thread Michael Paquier
On Fri, Nov 08, 2024 at 02:09:30PM +, Bertrand Drouvot wrote: > 0001 (the largest one) > > Introduces a new statistics KIND. It is named PGSTAT_KIND_PER_BACKEND as it > could > be used in the future to store other statistics (than the I/O ones) per > backend. > The new KIND is a variabl

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-13 Thread Ashutosh Bapat
On Wed, Nov 13, 2024 at 5:25 PM Tomas Vondra wrote: > > On 11/13/24 05:38, Ashutosh Bapat wrote: > > ... > > > > Here's way we can fix SnapBuildProcessRunningXacts() similar to > > DecodeCommit(). DecodeCommit() uses SnapBuildXactNeedsSkip() to decide > > whether a given transaction should be deco

Re: remaining sql/json patches

2024-11-13 Thread Nikita Malakhov
Hi! Amit, ok, I'll start a new thread with this patch after I deal with an issue on plan execution, I've found it during testing. On Mon, Nov 11, 2024 at 3:29 AM Amit Langote wrote: > Hi Nikita, > > On Sat, Nov 9, 2024 at 5:22 PM Nikita Malakhov wrote: > > > > Hi! > > > > We'd like to help to

Re: DOCS - pg_replication_slot . Fix the 'inactive_since' description

2024-11-13 Thread Nisha Moond
On Thu, Oct 31, 2024 at 11:05 PM Bruce Momjian wrote: > > > Yes, all good suggestions, updated patch attached. > Few comments for the changes under "inactive_since" description: +The time when slot synchronization (see ) +was most recently stopped. NULL if the slot +has

Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY

2024-11-13 Thread vignesh C
On Wed, 13 Nov 2024 at 11:15, Shlok Kyal wrote: > > Thanks for providing the comments. > > On Tue, 12 Nov 2024 at 12:52, Zhijie Hou (Fujitsu) > wrote: > > > > On Friday, November 8, 2024 7:06 PM Shlok Kyal > > wrote: > > > > > > Hi Amit, > > > > > > On Thu, 7 Nov 2024 at 11:37, Amit Kapila wro

  1   2   >