Re: A failure in prepared_xacts test

2024-04-28 Thread Tom Lane
Michael Paquier writes: > I don't disagree with your point, still I'm not sure that this can be > made entirely bullet-proof. Anyway, I think that we should still > improve this test and make it more robust for parallel operations: > installcheck fails equally on HEAD if there is a prepared

Re: A failure in prepared_xacts test

2024-04-28 Thread Alexander Lakhin
Hello Tom and Michael, 29.04.2024 08:11, Tom Lane wrote: Michael Paquier writes: If you grep the source tree, you'd notice that a prepared transaction named gxid only exists in the 2PC tests of ECPG, in src/interfaces/ecpg/test/sql/twophase.pgc. So the origin of the failure comes from a race

RE: Synchronizing slots from primary to standby

2024-04-28 Thread Zhijie Hou (Fujitsu)
On Friday, March 15, 2024 10:45 PM Bertrand Drouvot wrote: > > Hi, > > On Thu, Mar 14, 2024 at 02:22:44AM +, Zhijie Hou (Fujitsu) wrote: > > Hi, > > > > Since the standby_slot_names patch has been committed, I am attaching > > the last doc patch for review. > > > > Thanks! > > 1 === > >

Re: A failure in prepared_xacts test

2024-04-28 Thread Michael Paquier
On Mon, Apr 29, 2024 at 01:11:00AM -0400, Tom Lane wrote: > Up to now, we've only worried about whether tests running in parallel > within a single test suite can interact. It's quite scary to think > that the meson setup has expanded the possibility of interactions > to our entire source tree.

Re: documentation structure

2024-04-28 Thread Corey Huinker
> > I've splitted it to7 patches. > each patch split one into separate new files. > Seems like a good start. Looking at the diffs of these, I wonder if we would be better off with a func/ directory, each function gets its own file in that dir, and either these files above include the individual

Re: A failure in prepared_xacts test

2024-04-28 Thread Tom Lane
Michael Paquier writes: > If you grep the source tree, you'd notice that a prepared transaction > named gxid only exists in the 2PC tests of ECPG, in > src/interfaces/ecpg/test/sql/twophase.pgc. So the origin of the > failure comes from a race condition due to test parallelization, > because the

Re: pg_input_error_info doc 2 exampled crammed together

2024-04-28 Thread David G. Johnston
On Sunday, April 28, 2024, Michael Paquier wrote: > On Sun, Apr 28, 2024 at 06:45:30PM -0700, David G. Johnston wrote: > > My preference would be to limit this section to a single example. The > > numeric one, as it provides values for more output columns. I would > change > > the output

Re: A failure in prepared_xacts test

2024-04-28 Thread Alexander Lakhin
Hello Richard, 29.04.2024 04:12, Richard Guo wrote: Does anyone have any clue to this failure? FWIW, after another run of this test, the failure just disappears.  Does it suggest that the test case is flaky? I think this could be caused by the ecpg test twophase executed simultaneously with

Re: A failure in prepared_xacts test

2024-04-28 Thread Michael Paquier
On Mon, Apr 29, 2024 at 09:12:48AM +0800, Richard Guo wrote: > Does anyone have any clue to this failure? > > FWIW, after another run of this test, the failure just disappears. Does > it suggest that the test case is flaky? If you grep the source tree, you'd notice that a prepared transaction

Re: TerminateOtherDBBackends code comments inconsistency.

2024-04-28 Thread Amit Kapila
On Mon, Apr 22, 2024 at 9:56 PM Noah Misch wrote: > > On Mon, Apr 15, 2024 at 11:17:54AM +0530, Amit Kapila wrote: > > On Thu, Apr 11, 2024 at 6:58 PM Kirill Reshke > > wrote: > > > > > > While working on [0] i have noticed this comment in > > > TerminateOtherDBBackends function: > > > > > > /*

Re: pg_input_error_info doc 2 exampled crammed together

2024-04-28 Thread Michael Paquier
On Sun, Apr 28, 2024 at 06:45:30PM -0700, David G. Johnston wrote: > My preference would be to limit this section to a single example. The > numeric one, as it provides values for more output columns. I would change > the output format to expanded from default, in order to show all columns > and

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

2024-04-28 Thread Amit Kapila
On Thu, Apr 25, 2024 at 11:11 AM Bharath Rupireddy wrote: > > On Mon, Apr 22, 2024 at 7:21 PM Masahiko Sawada wrote: > > > > > Please find the attached v35 patch. > > > > The documentation says about both 'active' and 'inactive_since' > > columns of pg_replication_slots say: > > > > --- > >

Re: Background Processes in Postgres Extension

2024-04-28 Thread Ashutosh Bapat
On Sat, Apr 27, 2024 at 9:26 PM Sushrut Shivaswamy < sushrut.shivasw...@gmail.com> wrote: > Thanks for the suggestion on using postgres background worker. > > I tried creating one following the implementation in worker_spi and am > able to spawn a background worker successfully. > > However, the

Re: New committers: Melanie Plageman, Richard Guo

2024-04-28 Thread vignesh C
On Fri, 26 Apr 2024 at 17:24, Jonathan S. Katz wrote: > > The Core Team would like to extend our congratulations to Melanie > Plageman and Richard Guo, who have accepted invitations to become our > newest PostgreSQL committers. > > Please join us in wishing them much success and few reverts!

Re: Race condition in FetchTableStates() breaks synchronization of subscription tables

2024-04-28 Thread vignesh C
On Thu, 25 Apr 2024 at 16:20, Amit Kapila wrote: > > On Thu, Apr 25, 2024 at 7:01 AM Zhijie Hou (Fujitsu) > wrote: > > > > On Wednesday, April 24, 2024 6:29 PM vignesh C wrote: > > > > > > > > > The attached patch > > > v7-0001-Table-sync-missed-due-to-race-condition-in-subscr.patch > > >

Re: POC: GROUP BY optimization

2024-04-28 Thread jian he
On Wed, Apr 24, 2024 at 2:25 PM jian he wrote: > > hi. > I found an interesting case. > > CREATE TABLE t1 AS > SELECT (i % 10)::numeric AS x,(i % 10)::int8 AS y,'abc' || i % 10 AS > z, i::int4 AS w > FROM generate_series(1, 100) AS i; > CREATE INDEX t1_x_y_idx ON t1 (x, y); > ANALYZE t1; >

Re: pg_input_error_info doc 2 exampled crammed together

2024-04-28 Thread David G. Johnston
On Sunday, April 28, 2024, jian he wrote: > > > after checking the definition of [1], [2], > maybe here we should use > Possibly, though I’d be curious to see how consistent we are on this point elsewhere before making a point of it. > > and also add `(1 row)` information. Doesn’t seem

Re: Support "Right Semi Join" plan shapes

2024-04-28 Thread wenhui qiu
Hi Richard Thank you so much for your tireless work on this,I see the new version of the patch improves some of the comments .I think it can commit in July Thanks On Thu, 25 Apr 2024 at 11:28, Richard Guo wrote: > Here is another rebase with a commit message to help review. I also >

pg_input_error_info doc 2 exampled crammed together

2024-04-28 Thread jian he
hi. select * from pg_input_error_info('420', 'integer') select message, detail from pg_input_error_info('1234.567', 'numeric(7,4)') I found above two examples at [0] crammed together. select * from pg_input_error_info('420', 'integer')

A failure in prepared_xacts test

2024-04-28 Thread Richard Guo
Yesterday I noticed a failure on cirrus-ci for the 'Right Semi Join' patch. The failure can be found at [1], and it looks like: --- /tmp/cirrus-ci-build/src/test/regress/expected/prepared_xacts.out 2024-04-27 00:41:25.831297000 + +++

Re: Tarball builds in the new world order

2024-04-28 Thread Tom Lane
Alvaro Herrera writes: > Why is it that the .gitrevision file is only created here, instead of > being added to the tarball that "git archive" produces? Adding an > argument like > --add-virtual-file $(distdir)/.gitrevision:$(GIT_REFSPEC) > to the git archive call should suffice. I think

Re: Refactoring backend fork+exec code

2024-04-28 Thread Heikki Linnakangas
On 27/04/2024 11:27, Anton A. Melnikov wrote: Hello! Maybe add PGDLLIMPORT to extern bool LoadedSSL; and extern struct ClientSocket *MyClientSocket; definitions in the src/include/postmaster/postmaster.h ? Peter E noticed and Michael fixed them in commit 768ceeeaa1 already. -- Heikki

Re: Tarball builds in the new world order

2024-04-28 Thread Alvaro Herrera
On 2024-Apr-26, Tom Lane wrote: > --- mk-one-release.orig 2024-04-23 17:30:08.983226671 -0400 > +++ mk-one-release2024-04-26 15:17:29.713669677 -0400 > @@ -39,13 +39,17 @@ mkdir pgsql > git archive ${gitref} | tar xf - -C pgsql > > # Include the git ref in the output tarballs > +#

Re: DROP OWNED BY fails to clean out pg_init_privs grants

2024-04-28 Thread Tom Lane
I wrote: > Here's a draft patch that attacks that. It seems to fix the > problem with test_pg_dump: no dangling pg_init_privs grants > are left behind. Here's a v2 that attempts to add some queries to test_pg_dump.sql to provide visual verification that pg_shdepend and pg_init_privs are updated

Re: Fix overflow hazard in timestamp_pl_interval

2024-04-28 Thread Tom Lane
Joseph Koshakow writes: >> Attached is a patch that fixes some overflow/underflow hazards in >> `timestamp_pl_interval`. The microseconds overflow could produce >> incorrect result. The month overflow would generally still result in an >> error from the timestamp month field being too low, but

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread Justin Pryzby
On Sun, Apr 28, 2024 at 08:18:42AM -0500, Justin Pryzby wrote: > > I will explore this. Do we copy extended stats when we do CREATE > > TABLE ... PARTITION OF? I think we need to do the same here. > > Right, they're not copied because an extended stats objs on the parent > does something

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread David G. Johnston
On Sunday, April 28, 2024, Alexander Lakhin wrote: > > When we deal with mixed ownership, say, bob is an owner of a > partitioned table, but not an owner of a partition, should we > allow him to perform merge with that partition? > > Attaching via alter table requires the user to own both the

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread David G. Johnston
On Sunday, April 28, 2024, Alexander Lakhin wrote: > > When we deal with mixed ownership, say, bob is an owner of a > partitioned table, but not an owner of a partition, should we > allow him to perform merge with that partition? > > IIUC Merge causes the source tables to be dropped, their data

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread Justin Pryzby
On Sun, Apr 28, 2024 at 04:04:54AM +0300, Alexander Korotkov wrote: > Hi Justin, > > Thank you for your review. Please check v9 of the patchset [1]. > > On Wed, Apr 24, 2024 at 11:26 PM Justin Pryzby wrote: > > This patch also/already fixes the schema issue I reported. Thanks. > > > > If you

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread Alexander Korotkov
On Sun, Apr 28, 2024 at 2:00 PM Alexander Lakhin wrote: > 28.04.2024 03:59, Alexander Korotkov wrote: > > The revised patchset is attached. I'm going to push it if there are > > no objections. > > I have one additional question regarding security, if you don't mind: > What permissions should a

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-28 Thread Alexander Lakhin
Hello, 28.04.2024 03:59, Alexander Korotkov wrote: The revised patchset is attached. I'm going to push it if there are no objections. I have one additional question regarding security, if you don't mind: What permissions should a user have to perform split/merge? When we deal with mixed

Re: New committers: Melanie Plageman, Richard Guo

2024-04-28 Thread Alvaro Herrera
On 2024-Apr-26, Jonathan S. Katz wrote: > The Core Team would like to extend our congratulations to Melanie Plageman > and Richard Guo, who have accepted invitations to become our newest > PostgreSQL committers. > > Please join us in wishing them much success and few reverts! May your commits

Re: Typos in the code and README

2024-04-28 Thread David Rowley
On Sat, 20 Apr 2024 at 16:09, David Rowley wrote: > Here are a few more to see if it motivates anyone else to do a more > thorough search for another batch. I've pushed these now. David

Re: partitioning and identity column

2024-04-28 Thread Alexander Lakhin
27.04.2024 18:00, Alexander Lakhin wrote: Please look also at another script, which produces the same error: I've discovered yet another problematic case: CREATE TABLE tbl1 (a int GENERATED ALWAYS AS IDENTITY, b text)     PARTITION BY LIST (a); CREATE TABLE tbl2 (b text, a int NOT NULL);