Re: Set query_id for query contained in utility statement

2024-10-27 Thread Michael Paquier
On Thu, Oct 24, 2024 at 11:28:55AM +0900, Michael Paquier wrote: > Attached is the remaining piece, for DECLARE and CTAS. The > JumbleQuery() calls in ExecCreateTableAs() and ExplainOneUtility() for > CTAS queries are twins, showing the inner queries of CTAS > consistently. DECLARE is covered by

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-27 Thread Masahiko Sawada
On Sun, Oct 27, 2024 at 3:33 AM Stepan Neretin wrote: > > > >> >> IIUC after an immediate shutdown all pgstat entries are wiped out so >> the server doesn't have any pgstat entries for databases at this >> point. And since we don't run autovacuum on databases that have no >> pg_stat entries, no au

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-27 Thread Michael Paquier
On Sun, Oct 27, 2024 at 05:19:45PM -0700, Masahiko Sawada wrote: > my $psql1 = $node->interactive_psql('postgres'); > $psql1->query("create temp table test (a int primary key);"); > sleep(3); > > $node->stop('immediate'); > $node->start(); > $node->safe_psql('postgres', 'select 1'); > > sleep(5);

Re: Add isolation test template in injection_points for wait/wakeup/detach

2024-10-27 Thread Michael Paquier
On Fri, Oct 25, 2024 at 09:33:12AM +0900, Michael Paquier wrote: > I am going to remove the first permutation anyway to stabilize the CI > reports. But it feels like we have a different problem here, and I am > not sure what. A few days later, I have looked at the full set of CF bot jobs and 9f00

Re: Inconsistent RestrictInfo serial numbers

2024-10-27 Thread Richard Guo
On Fri, Oct 11, 2024 at 3:02 PM Ashutosh Bapat wrote: > 1. What strikes me as odd in your patch is that the last_rinfo_serial > is reset so far away from the new clause that will be created with the > next last_rinfo_serial OR the clause whose clones are being created. > It either indicates anothe

Re: Forbid to DROP temp tables of other sessions

2024-10-27 Thread Michael Paquier
On Fri, Oct 25, 2024 at 02:01:23PM -0400, Tom Lane wrote: > If autovacuum can do it, I don't see a reason to prevent superusers > from doing it manually. Being able to do a DROP of a temporary table in a controlled way can also be very handy when working on a cluster with a corrupted catalog state

Re: Pgoutput not capturing the generated columns

2024-10-27 Thread Peter Smith
Hi, here are my review comments for patch v43-0001. == 1. Missing docs update? The CREATE PUBLICATION docs currently says: When a column list is specified, only the named columns are replicated. If no column list is specified, all columns of the table are replicated through this publication,

RE: Pgoutput not capturing the generated columns

2024-10-27 Thread Hayato Kuroda (Fujitsu)
Dear Shubham, More comments for v43-0001. 01. publication.out and publication.sql I think your fix is not sufficient, even if it pass tests. ``` -- error: system attributes "ctid" not allowed in column list ALTER PUBLICATION testpub_fortable ADD TABLE testpub_tbl5 (a, ctid); -ERROR: cannot u

Re: Pgoutput not capturing the generated columns

2024-10-27 Thread Amit Kapila
On Mon, Oct 28, 2024 at 7:43 AM Peter Smith wrote: > > 7. > +$node_publisher->wait_for_catchup('sub_gen'); > + > +is( $node_subscriber->safe_psql( > + 'postgres', "SELECT * FROM test_gen ORDER BY a"), > + qq(1|2), > + 'replication with generated columns in column list'); > + > > But, this is only

Re: Pgoutput not capturing the generated columns

2024-10-27 Thread Peter Smith
On Mon, Oct 28, 2024 at 4:34 PM Amit Kapila wrote: > > On Mon, Oct 28, 2024 at 7:43 AM Peter Smith wrote: > > > > Hi, here are my review comments for patch v43-0001. > > > > == > > src/backend/replication/logical/proto.c > > > > 2. > > +static bool > > +should_publish_column(Form_pg_attribute

Re: New "raw" COPY format

2024-10-27 Thread jian he
On Thu, Oct 24, 2024 at 2:30 PM Joel Jacobson wrote: > > On Thu, Oct 24, 2024, at 03:54, Masahiko Sawada wrote: > > I have one question: > > > > From the 0001 patch's commit message: > > > > No behavioral changes are intended; this is a pure refactoring to improve > > code > > clarity and maintai

Re: msvc directory missing in PostgreSQL 17.0

2024-10-27 Thread Dave Page
On Sun, 27 Oct 2024 at 10:17, 黄铎彦 <00...@fzu.edu.cn> wrote: > I could hardly find detailed and complete tutorials on building the latest > version with Visual Studio. > You can see how it’s done if you take a look at the actions in https://github.com/dpage/winpgbuild. The postgresql-dev one i

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-27 Thread Stepan Neretin
> IIUC after an immediate shutdown all pgstat entries are wiped out so > the server doesn't have any pgstat entries for databases at this > point. And since we don't run autovacuum on databases that have no > pg_stat entries, no autovacuum worker worked on the 'postgres' > database. Please try exec

Re: Re: msvc directory missing in PostgreSQL 17.0

2024-10-27 Thread huangdy2...@qq.com
On Sun, 27 Oct 2024 at 16:38 GMT+8, Dave Page wrote: >You can see how it’s done if you take a look at the actions in >https://github.com/dpage/winpgbuild. The postgresql-dev one is probably the >best example, as it only runs a single meson build, whilst the postgresql >action is a matrix buil

Re: Statistics Import and Export

2024-10-27 Thread Alexander Lakhin
Hello Jeff and Corey, 26.10.2024 01:18, Jeff Davis wrote: On Tue, 2024-09-17 at 05:02 -0400, Corey Huinker wrote: I've taken most of Jeff's work, reincorporated it into roughly the same patch structure as before, and am posting it now. I have committed the import side of this patch series; tha

Re: msvc directory missing in PostgreSQL 17.0

2024-10-27 Thread huangdy2...@qq.com
On Sun, 27 Oct 2024 at 17:38 GMT+8, 黄铎彦 wrote: >That repo seems to be something like Github action. But I would like to >generate sln and vcxproj files in my Windows PC, then open Visual Studio, >compile and navigate. I used `meson setup --backend vs` but got compile error with the sln file.

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

2024-10-27 Thread jian he
On Mon, Oct 21, 2024 at 8:39 PM Fujii Masao wrote: > On 2024/10/21 18:30, Kirill Reshke wrote: > > v4 no longer applies. It now conflicts with > > e7834a1a251d4a28245377f383ff20a657ba8262. > > Also, there were review comments. > > > > So, I decided to rebase. > > Thanks for the patch! Here are my

Re: Pgoutput not capturing the generated columns

2024-10-27 Thread Amit Kapila
On Mon, Oct 28, 2024 at 7:43 AM Peter Smith wrote: > > Hi, here are my review comments for patch v43-0001. > > == > src/backend/replication/logical/proto.c > > 2. > +static bool > +should_publish_column(Form_pg_attribute att, Bitmapset *columns) > +{ > + if (att->attisdropped) > + return false

Re: Conflict detection for update_deleted in logical replication

2024-10-27 Thread Peter Smith
Hi Hou-San, here are a few trivial comments remaining for patch v6-0001. == General. 1. There are multiple comments in this patch mentioning 'wal' which probably should say 'WAL' (uppercase). ~~~ 2. There are multiple comments in this patch missing periods (.) == doc/src/sgml/protocol.

Re: Make default subscription streaming option as Parallel

2024-10-27 Thread Amit Kapila
On Tue, Oct 22, 2024 at 9:26 PM vignesh C wrote: > > The attached v5 version has the change to create subscriptions in > streaming off mode. I also did not find any other TAP test which > required further changes. > Pushed. -- With Regards, Amit Kapila.

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-27 Thread Stepan Neretin
> > The assertion failure happens in an autovacuum worker. So if you are > looking for a test that can be integrated in the tree, you could get > some inspiration from 006_signal_autovacuum.pl and rely on an > injection point wait with the existing autovacuum-worker-start. My > 2c, as it looks ea

RE: Pgoutput not capturing the generated columns

2024-10-27 Thread Hayato Kuroda (Fujitsu)
Dear Shubham, Thanks for updating the patch! I resumed reviewing the patch set. Here are only cosmetic comments as my rehabilitation. 01. getPublications() I feel we could follow the notation like getSubscriptions(), because number of parameters became larger. How do you feel like attached? 02

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-27 Thread Masahiko Sawada
On Sun, Oct 27, 2024 at 5:50 PM Michael Paquier wrote: > > On Sun, Oct 27, 2024 at 05:19:45PM -0700, Masahiko Sawada wrote: > > my $psql1 = $node->interactive_psql('postgres'); > > $psql1->query("create temp table test (a int primary key);"); > > sleep(3); > > > > $node->stop('immediate'); > > $no

Re: Alias of VALUES RTE in explain plan

2024-10-27 Thread Andrei Lepikhov
On 10/28/24 03:15, Yasir wrote: By design of my solution, I was not taking it as a bug. But now, I agree with your opinion. I think the case provided by Ashutosh was initially correct, and nothing needs to change. Look at the similar case: EXPLAIN SELECT x,y FROM ( SELECT oid,relname FROM pg

Re: Assertion failure when autovacuum drops orphan temp indexes.

2024-10-27 Thread Stepan Neretin
> Thank you for your suggestion. IMHO I'm not sure we need to have a > regression test for this bug as it's just an oversight of recently > committed code. My suggestion was just to help Stepan reproduce this > failure using TAP tests. > > Yes, I have reproduced the issue manually before your chang

Re: msvc directory missing in PostgreSQL 17.0

2024-10-27 Thread Umar Hayat
Hi, In my opinion the issue could be Active-state perl ( as I see in your log file, activestate perl path). In this thread [0] people faced same problem and solved it using strawberry perl. Regards Umar Hayat [0] https://www.postgresql.org/message-id/flat/CADK3HHLQ1MNmfXqEvQi36D_MQrheOZPcXv2H3s

Proposal to add exclusion constraint from existing index

2024-10-27 Thread Marcelo Fernandes
Hi folks, >From the source code, the `ATExecAddIndexConstraint` function does not support creating an exclusion constraint from an existing gist index. Here's the snippet I am talking about: src/backend/commands/tablecmds.c ```c /* Note we currently don't support EXCLUSION constraints here */ if

Re: msvc directory missing in PostgreSQL 17.0

2024-10-27 Thread 黄铎彦
I could hardly find detailed and complete tutorials on building the latest version with Visual Studio. I did use meson to generate sln and vcxproj files in Command Prompt (attatchment: 00meson_cmd_to_gen_sln.txt). But after opening the sln and run menu command "build -> build solution", it faile

Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails

2024-10-27 Thread Tender Wang
Alvaro Herrera 于2024年10月27日周日 05:47写道: > On 2024-Oct-25, Alvaro Herrera wrote: > > > On 2024-Oct-25, Tender Wang wrote: > > > > > Thanks for reporting. I can reproduce this memory invalid access on > HEAD. > > > After debuging codes, I found the root cause. > > > In DetachPartitionFinalize(), be

Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)

2024-10-27 Thread Tom Lane
I wrote: > In the no-good-deed-goes-unpunished department: buildfarm member > hamerkop doesn't like this patch [1]. The diffs look like > ... > So what I'd like to do to fix this is to change > - if ((file = AllocateFile(filename, PG_BINARY_R)) == NULL) > + if ((file = AllocateFile(filenam

libedit history seems to be misbehaving / broken

2024-10-27 Thread Tomas Vondra
Hi, I accidentally built master with libedit (instead of the readline I use most of the time, due to missing readline-devel package). And for a while it was working fine, but then I realized the history is not working anymore, and is broken in a weird way :-( I'm not terribly familiar with libedi

Re: msvc directory missing in PostgreSQL 17.0

2024-10-27 Thread Andres Freund
Hi, On October 27, 2024 5:50:51 AM EDT, "huangdy2...@qq.com" wrote: >On Sun, 27 Oct 2024 at 17:38 GMT+8, 黄铎彦 wrote: > > >>That repo seems to be something like Github action. But I would like to >>generate sln and vcxproj files in my Windows PC, then open Visual Studio, >>compile and navigate

Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)

2024-10-27 Thread Pavel Stehule
ne 27. 10. 2024 v 18:42 odesílatel Tom Lane napsal: > I wrote: > > In the no-good-deed-goes-unpunished department: buildfarm member > > hamerkop doesn't like this patch [1]. The diffs look like > > ... > > So what I'd like to do to fix this is to change > > - if ((file = AllocateFile(filenam

Re: libedit history seems to be misbehaving / broken

2024-10-27 Thread Tomas Vondra
On 10/27/24 20:03, Tom Lane wrote: > Tomas Vondra writes: >> I'm not terribly familiar with libedit, so can't say if it's a bug in >> libedit, or if we're just using it wrong in some way. I investigated >> that while on a flight from pgconf.eu, but can't look into this further. >> So let me at

Re: Alias of VALUES RTE in explain plan

2024-10-27 Thread Tom Lane
Yasir writes: > On Sat, Oct 26, 2024 at 12:21 AM Tom Lane wrote: >> I forgot to mention a third problem, which is that reassigning the >> alias during subquery pullup means it doesn't happen if subquery >> pullup doesn't happen. > Yes, that is by design. By design? How can you claim that's not

Re: Alias of VALUES RTE in explain plan

2024-10-27 Thread Yasir
On Mon, Oct 28, 2024 at 1:07 AM Tom Lane wrote: > Yasir writes: > > On Sat, Oct 26, 2024 at 12:21 AM Tom Lane wrote: > >> I forgot to mention a third problem, which is that reassigning the > >> alias during subquery pullup means it doesn't happen if subquery > >> pullup doesn't happen. > > > Ye

Allowing pg_recvlogical to create temporary replication slots

2024-10-27 Thread Torsten Förtsch
Hi, This is my very first message to this mailing list. Please advise if I am making any mistakes in the procedure. The attached patch enables pg_recvlogical to create a temporary slot. What is the next step in the process to get this change into official postgres? Thanks, Torsten diff --git a/

Re: libedit history seems to be misbehaving / broken

2024-10-27 Thread Tom Lane
Tomas Vondra writes: > I'm not terribly familiar with libedit, so can't say if it's a bug in > libedit, or if we're just using it wrong in some way. I investigated > that while on a flight from pgconf.eu, but can't look into this further. > So let me at least share the behavior I observed, and wha

Re: [Patch] remove duplicated smgrclose

2024-10-27 Thread Kirill Reshke
On Wed, 14 Aug 2024 at 11:35, Steven Niu wrote: > > Junwang, Kirill, > > The split work has been done. I created a new patch for removing redundant > smgrclose() function as attached. > Please help review it. > > Thanks, > Steven > > Steven Niu 于2024年8月12日周一 18:11写道: >> >> Kirill, >> >> Good cat

Re: Alias of VALUES RTE in explain plan

2024-10-27 Thread Yasir
On Fri, Oct 25, 2024 at 10:35 PM Tom Lane wrote: > Yasir writes: > > I have fixed the code to produce desired output by adding a few lines in > > pull_up_simple_subquery(). > > Attached patch is divided in 2 files: > > - 001-Fix-Alias-VALUES-RTE.patch contains the actual fix. > > - 002-Fix-Ali

Re: Alias of VALUES RTE in explain plan

2024-10-27 Thread Yasir
On Sat, Oct 26, 2024 at 12:21 AM Tom Lane wrote: > I wrote: > > However ... I don't like this implementation, not even a little > > bit. > > I forgot to mention a third problem, which is that reassigning the > alias during subquery pullup means it doesn't happen if subquery > pullup doesn't happe

Re: heap_inplace_lock vs. autovacuum w/ LOCKTAG_TUPLE

2024-10-27 Thread Noah Misch
On Sun, Oct 27, 2024 at 08:00:00AM +0300, Alexander Lakhin wrote: > 27.10.2024 07:09, Noah Misch wrote: > > On Sat, Oct 26, 2024 at 11:49:36AM -0700, Noah Misch wrote: > > > intra-grant-inplace-db.spec got a novel failure today: > > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=sarus&dt

Re: race condition in pg_class

2024-10-27 Thread Noah Misch
On Thu, Aug 22, 2024 at 12:32:00AM -0700, Noah Misch wrote: > This move also loses the optimization of unpinning before XactLockTableWait(). > heap_update() doesn't optimize that way, so that's fine. In this other thread, I'm proposing to go back to unpinning: https://postgr.es/m/20241027214035.8a