Re: [BUG] pg_stat_statements and extended query protocol

2023-03-28 Thread Michael Paquier
On Thu, Mar 23, 2023 at 01:54:05PM +, Imseih (AWS), Sami wrote: > Yes, that is possible but we will need to add a libpq API > that allows the caller to pass in a "fetch size". > PQsendQueryParams does not take in a "fetch size", > so it returns all rows, through PQsendQueryParams > > https://

Re: PGdoc: add missing ID attribute to create_subscription.sgml

2023-03-28 Thread Amit Kapila
On Wed, Mar 29, 2023 at 6:31 AM Hayato Kuroda (Fujitsu) wrote: > > Dear Amit-san, > > > There is no need to break the link line. See attached. > > I understood your saying. I think it's better. > Pushed. -- With Regards, Amit Kapila.

Re: Should vacuum process config file reload more often

2023-03-28 Thread Kyotaro Horiguchi
At Wed, 29 Mar 2023 13:21:55 +0900 (JST), Kyotaro Horiguchi wrote in > autovacuum.c:2893 > /* >* If any of the cost delay parameters has been set > individually for >* this table, disable the balancing algorithm. >*/ >

Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

2023-03-28 Thread Drouvot, Bertrand
Hi, On 3/29/23 2:09 AM, Michael Paquier wrote: On Tue, Mar 28, 2023 at 05:43:26PM +0900, Kyotaro Horiguchi wrote: No. Fine by me, except that "block read requests" seems to suggest kernel read() calls, maybe because it's not clear whether "block" refers to our buffer blocks or file blocks to me

Re: logical decoding and replication of sequences, take 2

2023-03-28 Thread Masahiko Sawada
On Wed, Mar 29, 2023 at 3:34 AM Tomas Vondra wrote: > > On 3/28/23 18:34, Masahiko Sawada wrote: > > On Mon, Mar 27, 2023 at 11:46 PM Tomas Vondra > > wrote: > >> > >> > >> > >> On 3/27/23 03:32, Masahiko Sawada wrote: > >>> Hi, > >>> > >>> On Fri, Mar 24, 2023 at 7:26 AM Tomas Vondra > >>> wrot

Re: Using Ephemeral Named Relation like a temporary table

2023-03-28 Thread Corey Huinker
On Wed, Mar 29, 2023 at 12:54 AM Yugo NAGATA wrote: > Hello, > > > Temporary tables are often used to store transient data in > batch processing and the contents can be accessed multiple > times. However, frequent use of temporary tables has a problem > that the system catalog tends to bloat. I k

Re: Using Ephemeral Named Relation like a temporary table

2023-03-28 Thread Pavel Stehule
Hi st 29. 3. 2023 v 6:54 odesílatel Yugo NAGATA napsal: > Hello, > > > Temporary tables are often used to store transient data in > batch processing and the contents can be accessed multiple > times. However, frequent use of temporary tables has a problem > that the system catalog tends to bloat

[PATCH] Allow Postgres to pick an unused port to listen

2023-03-28 Thread Yurii Rashkovskii
Hi, I would like to suggest a patch against master (although it may be worth backporting it) that makes it possible to listen on any unused port. The main motivation is running colocated instances of Postgres (such as test benches) without having to coordinate port allocation in an unnecessarily

Using Ephemeral Named Relation like a temporary table

2023-03-28 Thread Yugo NAGATA
Hello, Temporary tables are often used to store transient data in batch processing and the contents can be accessed multiple times. However, frequent use of temporary tables has a problem that the system catalog tends to bloat. I know there has been several proposals to attack this problem, but I

RE: doc: add missing "id" attributes to extension packaging page

2023-03-28 Thread Hayato Kuroda (Fujitsu)
Dear my comrade Brar, > Thanks, I actually was not aware of this. > > Also, kudos for capturing the missing id and advocating for consistency > regarding ids even before this is actively enforced. This nurtures my > optimism that consistency might actually be achieveable without > everybody getti

Re: Should vacuum process config file reload more often

2023-03-28 Thread Kyotaro Horiguchi
At Wed, 29 Mar 2023 12:09:08 +0900 (JST), Kyotaro Horiguchi wrote in > timeing perfectly. I think we might accidentally add a reload > timing. In that case, the assumption could break. In most cases, I > think we use snapshotting in various ways to avoid unintended variable > changes. (And I bei

Re: Data is copied twice when specifying both child and parent table in publication

2023-03-28 Thread Amit Kapila
On Wed, Mar 29, 2023 at 7:44 AM Peter Smith wrote: > > A minor review comment for v25-0001. > > == > src/backend/commands/subscriptioncmds.c > > 1. > @@ -1936,21 +1936,56 @@ fetch_table_list(WalReceiverConn *wrconn, List > *publications) > WalRcvExecResult *res; > StringInfoData cmd; > T

Re: refactoring relation extension and BufferAlloc(), faster COPY

2023-03-28 Thread Andres Freund
Hi, On 2023-03-27 15:32:47 +0900, Kyotaro Horiguchi wrote: > At Sun, 26 Mar 2023 12:26:59 -0700, Andres Freund wrote > in > > Hi, > > > > Attached is v5. Lots of comment polishing, a bit of renaming. I extracted > > the > > relation extension related code in hio.c back into its own function. >

Re: refactoring relation extension and BufferAlloc(), faster COPY

2023-03-28 Thread Andres Freund
Hi, On 2023-03-26 17:42:45 -0400, Melanie Plageman wrote: > Below is my review of a slightly older version than you just posted -- > much of it you may have already addressed. Far from all is already - thanks for the review! > From 3a6c3f41000e057bae12ab4431e6bb1c5f3ec4b0 Mon Sep 17 00:00:00 20

Re: Should vacuum process config file reload more often

2023-03-28 Thread Kyotaro Horiguchi
At Tue, 28 Mar 2023 20:35:28 -0400, Melanie Plageman wrote in > On Tue, Mar 28, 2023 at 4:21 AM Kyotaro Horiguchi > wrote: > > > > At Mon, 27 Mar 2023 14:12:03 -0400, Melanie Plageman > > wrote in > > > So, I've attached an alternate version of the patchset which takes the > > > approach of h

Re: hio.c does visibilitymap_pin()/IO while holding buffer lock

2023-03-28 Thread Andres Freund
Hi, On 2023-03-28 18:21:02 -0700, Andres Freund wrote: > Here's a draft patch. Attached is v2, with a stupid bug fixed and a bit of comment / pgindent polish. Greetings, Andres Freund >From 6f27018765f167a8d2a52bc7c9068cb09ca8d82c Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Mon, 24 Oct

Re: Data is copied twice when specifying both child and parent table in publication

2023-03-28 Thread Peter Smith
A minor review comment for v25-0001. == src/backend/commands/subscriptioncmds.c 1. @@ -1936,21 +1936,56 @@ fetch_table_list(WalReceiverConn *wrconn, List *publications) WalRcvExecResult *res; StringInfoData cmd; TupleTableSlot *slot; - Oid tableRow[3] = {TEXTOID, TEXTOID, NAMEARRAYOID};

pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

2023-03-28 Thread Yugo NAGATA
Hello, Attached patch introduces a function pg_column_toast_chunk_id that returns a chunk ID of a TOASTed value. Recently, one of our clients needed a way to show which columns are actually TOASTed because they would like to know how much updates on the original table affects to its toast table s

Re: allow_in_place_tablespaces vs. pg_basebackup

2023-03-28 Thread Michael Paquier
On Tue, Mar 28, 2023 at 05:15:25PM +1300, Thomas Munro wrote: > The commit message explains pretty well, and it seems to work in > simple testing, and yeah commit c6f2f016 was not a work of art. > pg_basebackeup --format=plain "worked", but your way is better. I > guess we should add a test of -Fp

Re: hio.c does visibilitymap_pin()/IO while holding buffer lock

2023-03-28 Thread Andres Freund
Hi, On 2023-03-25 11:17:07 -0700, Andres Freund wrote: > I don't see how that's easily possible with the current lock ordering > rules. At least without giving up using RBM_ZERO_AND_LOCK for extending or > stuffing even more things to happen with the the extension lock held, which I > don't think

RE: PGdoc: add missing ID attribute to create_subscription.sgml

2023-03-28 Thread Hayato Kuroda (Fujitsu)
Dear Amit-san, > There is no need to break the link line. See attached. I understood your saying. I think it's better. Best Regards, Hayato Kuroda FUJITSU LIMITED

Re: [RFC] Add jit deform_counter

2023-03-28 Thread David Rowley
On Sun, 12 Jun 2022 at 21:14, Dmitry Dolgov <9erthali...@gmail.com> wrote: > I've noticed that JIT performance counter generation_counter seems to include > actions, relevant for both jit_expressions and jit_tuple_deforming options. It > means one can't directly see what is the influence of jit_tup

Re: Add LZ4 compression in pg_dump

2023-03-28 Thread Tomas Vondra
On 3/28/23 00:34, gkokola...@pm.me wrote: > > ... > >> Got it. In that case I agree it's fine to do that in a single commit. > > For what is worth, I think that this patch should get a +1 and get in. It > solves the empty writes problem and includes a test to a previous untested > case. > Pushe

Re: Should vacuum process config file reload more often

2023-03-28 Thread Melanie Plageman
On Tue, Mar 28, 2023 at 4:21 AM Kyotaro Horiguchi wrote: > > At Mon, 27 Mar 2023 14:12:03 -0400, Melanie Plageman > wrote in > > So, I've attached an alternate version of the patchset which takes the > > approach of having one commit which only enables cost-based delay GUC > > refresh for VACUUM

Re: ALTER TABLE SET ACCESS METHOD on partitioned tables

2023-03-28 Thread Michael Paquier
On Tue, Mar 28, 2023 at 02:56:28PM +0900, Michael Paquier wrote: > Hmm. This is a good point. It is true that the patch feels > incomplete on this side. I don't see why we could not be flexible, > and allow a value of 0 in a partitioned table's relam to mean that we > would pick up the database

Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

2023-03-28 Thread Michael Paquier
On Tue, Mar 28, 2023 at 05:43:26PM +0900, Kyotaro Horiguchi wrote: > No. Fine by me, except that "block read requests" seems to suggest > kernel read() calls, maybe because it's not clear whether "block" > refers to our buffer blocks or file blocks to me.. If it is generally > clear, I'm fine with

Re: Why mark empty pages all visible?

2023-03-28 Thread Peter Geoghegan
On Tue, Mar 28, 2023 at 3:29 PM Andres Freund wrote: > Why is that? It's as clear a signal of concurrent activity on the buffer > you're going to get. Not immediately getting a cleanup lock in VACUUM is informative to the extent that you only care about what is happening that very nanosecond. If

Re: Request for comment on setting binary format output per session

2023-03-28 Thread Jeff Davis
On Tue, 2023-03-28 at 10:22 -0400, Dave Cramer wrote: > OK, IIUC what you are proposing here is that there would be a > separate pool for  > database, user, and OIDs. This doesn't seem too flexible. For > instance if I create a UDT and then want it to be returned  > as binary then I have to reconfi

Re: running logical replication as the subscription owner

2023-03-28 Thread Jeff Davis
On Tue, 2023-03-28 at 13:55 -0400, Robert Haas wrote: > Oh, interesting. I hadn't realized we were doing that, and I do think > that narrows the vulnerability quite a bit. It's good to know I wasn't missing something obvious. > bsent logical replication, you don't really need to worry > about whe

Re: Add pg_walinspect function with block info columns

2023-03-28 Thread Michael Paquier
On Tue, Mar 28, 2023 at 11:15:17AM -0700, Peter Geoghegan wrote: > On Mon, Mar 27, 2023 at 7:47 PM Bharath Rupireddy > wrote: >> Hm, agreed. Changed in the attached v7-0002 patch. We can as well >> write a case statement in the create function SQL to output forkname >> instead forknumber, but I'd

Re: zstd compression for pg_dump

2023-03-28 Thread Jacob Champion
On Wed, Mar 15, 2023 at 9:50 PM Justin Pryzby wrote: > On Fri, Mar 10, 2023 at 12:48:13PM -0800, Jacob Champion wrote: > > It looks like pg_dump's meson.build is missing dependencies on zstd > > (meson couldn't find the headers in the subproject without them). > > I saw that this was added for LZ4

Re: Why mark empty pages all visible?

2023-03-28 Thread Andres Freund
Hi, On 2023-03-28 13:05:19 -0700, Peter Geoghegan wrote: > On Tue, Mar 28, 2023 at 12:01 PM Andres Freund wrote: > > I will probably make that argument - so far I was just trying to understand > > the intent of the current code. There aren't really comments explaining why > > we > > want to mark

Re: Add LZ4 compression in pg_dump

2023-03-28 Thread Tomas Vondra
On 3/28/23 18:07, gkokola...@pm.me wrote: > > --- Original Message --- > On Friday, March 24th, 2023 at 10:30 AM, gkokola...@pm.me > wrote: > >> >> --- Original Message --- >> On Thursday, March 23rd, 2023 at 6:10 PM, Tomas Vondra >> tomas.von...@enterprisedb.com wrote: >> >>>

Re: Support logical replication of DDLs

2023-03-28 Thread Zheng Li
On Sun, Mar 26, 2023 at 5:22 PM Tom Lane wrote: > I spent some time looking through this thread to try to get a sense > of the state of things, and I came away quite depressed. The patchset > has ballooned to over 2MB, which is a couple orders of magnitude > larger than anyone could hope to mean

Re: pgsql: amcheck: Fix verify_heapam for tuples where xmin or xmax is 0.

2023-03-28 Thread Robert Haas
On Mon, Mar 27, 2023 at 4:52 PM Peter Geoghegan wrote: > This is fine, as far as it goes. Obviously it fixes the immediate problem. OK, I've committed and back-patched this fix to v14, just like the erroneous commit that created the issue. -- Robert Haas EDB: http://www.enterprisedb.com

Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions

2023-03-28 Thread Corey Huinker
On Tue, Mar 28, 2023 at 3:25 PM Isaac Morland wrote: > On Mon, 19 Dec 2022 at 17:57, Corey Huinker > wrote: > >> >> Attached is my work in progress to implement the changes to the CAST() >> function as proposed by Vik Fearing. >> >> CAST(expr AS typename NULL ON ERROR) >> will use error-safe

Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions

2023-03-28 Thread Corey Huinker
On Tue, Mar 28, 2023 at 2:53 PM Gregory Stark (as CFM) wrote: > On Tue, 3 Jan 2023 at 14:16, Tom Lane wrote: > > > > Vik Fearing writes: > > > > > I don't think we should add that syntax until I do get it through the > > > committee, just in case they change something. > > > > Agreed. So this

Re: Why mark empty pages all visible?

2023-03-28 Thread Peter Geoghegan
On Tue, Mar 28, 2023 at 12:01 PM Andres Freund wrote: > I will probably make that argument - so far I was just trying to understand > the intent of the current code. There aren't really comments explaining why we > want to mark currently-pinned empty/new pages all-visible and enter them into > the

Re: Some revises in adding sorting path

2023-03-28 Thread David Rowley
On Tue, 21 Feb 2023 at 22:02, Richard Guo wrote: > Looking at the codes now I have some concern that what we do in > create_ordered_paths for partial paths may have already been done in > generate_useful_gather_paths, especially when query_pathkeys is equal to > sort_pathkeys. Not sure if this is

Re: POC: Better infrastructure for automated testing of concurrency issues

2023-03-28 Thread Alexander Korotkov
On Tue, Mar 28, 2023 at 9:44 PM Gregory Stark (as CFM) wrote: > On Wed, 31 Aug 2022 at 20:52, Alexander Korotkov wrote: > > > > I'll continue work on this patch. The rebased patch is attached. It > > implements stop events as configure option (not runtime GUC option). > > It looks like this pat

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2023-03-28 Thread stephane tachoires
Hi, Patch v15-0001-ALTER-TABLE-MERGE-PARTITIONS-command.patch Apply nicely. One warning on meson compile (configure -Dssl=openssl -Dldap=enabled -Dauto_features=enabled -DPG_TEST_EXTRA='ssl,ldap,kerberos' -Dbsd_auth=disabled -Dbonjour=disabled -Dpam=disabled -Dpltcl=disabled -Dsystemd=disabled

Re: Schema variables - new implementation for Postgres 15

2023-03-28 Thread Pavel Stehule
Hi ne 26. 3. 2023 v 19:53 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Sun, Mar 26, 2023 at 07:32:05PM +0800, Julien Rouhaud wrote: > > Hi, > > > > I just have a few minor wording improvements for the various comments / > > documentation you quoted. > > Talking about documentat

Re: Documentation for building with meson

2023-03-28 Thread samay sharma
Hi, On Wed, Mar 15, 2023 at 4:28 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > > [PATCH v8 1/5] Make minor additions and corrections to meson docs > > The last hunk revealed that there is some mixing up between meson setup > and meson configure. This goes a bit further. For

Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions

2023-03-28 Thread Isaac Morland
On Mon, 19 Dec 2022 at 17:57, Corey Huinker wrote: > > Attached is my work in progress to implement the changes to the CAST() > function as proposed by Vik Fearing. > > CAST(expr AS typename NULL ON ERROR) > will use error-safe functions to do the cast of expr, and will return > NULL if the c

Re: Schema variables - new implementation for Postgres 15

2023-03-28 Thread Pavel Stehule
ne 26. 3. 2023 v 13:32 odesílatel Julien Rouhaud napsal: > Hi, > > I just have a few minor wording improvements for the various comments / > documentation you quoted. > > On Sun, Mar 26, 2023 at 08:53:49AM +0200, Pavel Stehule wrote: > > út 21. 3. 2023 v 17:18 odesílatel Peter Eisentraut < > > pe

Re: Why mark empty pages all visible?

2023-03-28 Thread Andres Freund
Hi, On 2023-03-27 21:51:09 -0700, Peter Geoghegan wrote: > On Mon, Mar 27, 2023 at 9:32 PM Andres Freund wrote: > > > You haven't said anything about the leading cause of marking empty > > > pages all-frozen, by far: lazy_vacuum_heap_page(). Should it also stop > > > marking empty pages all-froze

Re: [PATCH]Feature improvement for MERGE tab completion

2023-03-28 Thread Gregory Stark (as CFM)
Ah, another thread with a bouncing email address... Please respond to to thread from this point to avoid bounces. -- Gregory Stark As Commitfest Manager

Re: [PATCH]Feature improvement for MERGE tab completion

2023-03-28 Thread Gregory Stark (as CFM)
It looks like this remaining work isn't going to happen this CF and therefore this release. There hasn't been an update since January when Dean Rasheed posted a review. Unless there's any updates soon I'll move this on to the next commitfest or mark it returned with feedback. -- Gregory Stark As

Re: running logical replication as the subscription owner

2023-03-28 Thread Jelte Fennema
On Tue, 28 Mar 2023 at 18:13, Robert Haas wrote: > > On Mon, Mar 27, 2023 at 6:08 PM Jelte Fennema wrote: > > For high privileged subscription owners, > > we downgrade to the permissions of the table owner, but for low > > privileged ones we care about permissions of the subscription owner > > it

Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions

2023-03-28 Thread Gregory Stark (as CFM)
On Tue, 3 Jan 2023 at 14:16, Tom Lane wrote: > > Vik Fearing writes: > > > I don't think we should add that syntax until I do get it through the > > committee, just in case they change something. > > Agreed. So this is something we won't be able to put into v16; > it'll have to wait till there's

Re: Request for comment on setting binary format output per session

2023-03-28 Thread Gregory Stark (as CFM)
FYI I attached this thread to https://commitfest.postgresql.org/42/3777 which I believe is the same issue. I mistakenly had this listed as a CF entry with no discussion for a long time due to that missing link. -- Gregory Stark As Commitfest Manager

Re: Add LZ4 compression in pg_dump

2023-03-28 Thread Justin Pryzby
On Tue, Mar 28, 2023 at 06:40:03PM +0200, Tomas Vondra wrote: > On 3/28/23 18:07, gkokola...@pm.me wrote: > > --- Original Message --- > > On Friday, March 24th, 2023 at 10:30 AM, gkokola...@pm.me > > wrote: > > > >> --- Original Message --- > >> On Thursday, March 23rd, 2023 at

Re: zstd compression for pg_dump

2023-03-28 Thread Tomas Vondra
On 3/28/23 20:03, Kirk Wolak wrote: > On Tue, Mar 28, 2023 at 12:23 PM Tomas Vondra > mailto:tomas.von...@enterprisedb.com>> > wrote: > > On 3/27/23 19:28, Justin Pryzby wrote: > > On Fri, Mar 17, 2023 at 03:43:31AM +0100, Tomas Vondra wrote: > >> On 3/16/23 05:50, Justin Pryzby wrote:

Re: POC: Better infrastructure for automated testing of concurrency issues

2023-03-28 Thread Gregory Stark (as CFM)
On Wed, 31 Aug 2022 at 20:52, Alexander Korotkov wrote: > > I'll continue work on this patch. The rebased patch is attached. It > implements stop events as configure option (not runtime GUC option). It looks like this patch isn't going to be ready this commitfest. And it hasn't received much di

Re: "variable not found in subplan target list"

2023-03-28 Thread Tom Lane
Alvaro Herrera writes: > So I'm back home and found a couple more weird errors in the log: > ERROR: mismatching PartitionPruneInfo found at part_prune_index 0 > DETALLE: plan node relids (b 1), pruneinfo relids (b 36) This one reproduces for me. > select > pg_catalog.pg_stat_get_buf_f

Re: logical decoding and replication of sequences, take 2

2023-03-28 Thread Tomas Vondra
On 3/28/23 18:34, Masahiko Sawada wrote: > On Mon, Mar 27, 2023 at 11:46 PM Tomas Vondra > wrote: >> >> >> >> On 3/27/23 03:32, Masahiko Sawada wrote: >>> Hi, >>> >>> On Fri, Mar 24, 2023 at 7:26 AM Tomas Vondra >>> wrote: I merged the earlier "fixup" patches into the relevant parts, an

Re: "variable not found in subplan target list"

2023-03-28 Thread Alvaro Herrera
So I'm back home and found a couple more weird errors in the log: MERGE INTO public.idxpart2 as target_0 USING (select 1 from public.xmltest2 as ref_0 inner join public.prt1_l_p1 as sample_0 inner join fkpart4.droppk as ref

Re: allow_in_place_tablespaces vs. pg_basebackup

2023-03-28 Thread Thomas Munro
On Tue, Mar 28, 2023 at 5:15 PM Thomas Munro wrote: > I guess we should add a test of -Fp too, to keep it working? Oops, that was already tested in existing tests, so I take that back.

Re: Add pg_walinspect function with block info columns

2023-03-28 Thread Peter Geoghegan
On Mon, Mar 27, 2023 at 7:47 PM Bharath Rupireddy wrote: > Hm, agreed. Changed in the attached v7-0002 patch. We can as well > write a case statement in the create function SQL to output forkname > instead forknumber, but I'd stop doing that to keep in sync with > pg_buffercache. I just don't see

Re: zstd compression for pg_dump

2023-03-28 Thread Kirk Wolak
On Tue, Mar 28, 2023 at 12:23 PM Tomas Vondra wrote: > On 3/27/23 19:28, Justin Pryzby wrote: > > On Fri, Mar 17, 2023 at 03:43:31AM +0100, Tomas Vondra wrote: > >> On 3/16/23 05:50, Justin Pryzby wrote: > >>> On Fri, Mar 10, 2023 at 12:48:13PM -0800, Jacob Champion wrote: > On Wed, Mar 8, 2

Re: running logical replication as the subscription owner

2023-03-28 Thread Robert Haas
On Tue, Mar 28, 2023 at 1:38 AM Jeff Davis wrote: > > If they do have those things then in > > theory they might be able to protect themselves, but in practice they > > are unlikely to be careful enough. I judge that practically every > > installation where table owners use triggers would be easi

Re: Non-superuser subscription owners

2023-03-28 Thread Jeff Davis
On Fri, 2023-03-24 at 00:17 -0700, Jeff Davis wrote: > The other patch you posted seems like it makes a lot of progress in > that direction, and I think that should go in first. That was one of > the items I suggested previously[2], so thank you for working on > that. The above is not a hard objec

Re: Data is copied twice when specifying both child and parent table in publication

2023-03-28 Thread Jacob Champion
On Tue, Mar 28, 2023 at 2:59 AM wangw.f...@fujitsu.com wrote: > The scenario of this bug is to subscribe to two publications at the same time, > and these two publications publish parent table and child table respectively. > And option via_root is specified in both publications or only in the > p

Re: Add LZ4 compression in pg_dump

2023-03-28 Thread Tomas Vondra
On 3/28/23 18:07, gkokola...@pm.me wrote: > > > > > > --- Original Message --- > On Friday, March 24th, 2023 at 10:30 AM, gkokola...@pm.me > wrote: > >> >> --- Original Message --- >> On Thursday, March 23rd, 2023 at 6:10 PM, Tomas Vondra >> tomas.von...@enterprisedb.com

Re: logical decoding and replication of sequences, take 2

2023-03-28 Thread Masahiko Sawada
On Mon, Mar 27, 2023 at 11:46 PM Tomas Vondra wrote: > > > > On 3/27/23 03:32, Masahiko Sawada wrote: > > Hi, > > > > On Fri, Mar 24, 2023 at 7:26 AM Tomas Vondra > > wrote: > >> > >> I merged the earlier "fixup" patches into the relevant parts, and left > >> two patches with new tweaks (deducing

Re: zstd compression for pg_dump

2023-03-28 Thread Tomas Vondra
On 3/27/23 19:28, Justin Pryzby wrote: > On Fri, Mar 17, 2023 at 03:43:31AM +0100, Tomas Vondra wrote: >> On 3/16/23 05:50, Justin Pryzby wrote: >>> On Fri, Mar 10, 2023 at 12:48:13PM -0800, Jacob Champion wrote: On Wed, Mar 8, 2023 at 10:59 AM Jacob Champion wrote: > I did some

Re: running logical replication as the subscription owner

2023-03-28 Thread Robert Haas
On Mon, Mar 27, 2023 at 6:08 PM Jelte Fennema wrote: > Attached is an updated version of your patch with what I had in mind > (admittedly it needed one more line than "just" the return to make it > work). But as you can see all previous tests for a lowly privileged > subscription owner that **cann

Re: Commitfest 2023-03 starting tomorrow!

2023-03-28 Thread Gregory Stark (as CFM)
Status summary: Needs review: 116. Waiting on Author: 30. Ready for Committer: 32. Committed: 94. Moved to next CF: 17. Returned with Feedback: 6. Rejected: 6. Withdrawn: 18. Total: 319. Ok, here are the patches that have been stuck in "Waiting on Author" for a while. I divided t

Re: Add LZ4 compression in pg_dump

2023-03-28 Thread gkokolatos
--- Original Message --- On Friday, March 24th, 2023 at 10:30 AM, gkokola...@pm.me wrote: > > --- Original Message --- > On Thursday, March 23rd, 2023 at 6:10 PM, Tomas Vondra > tomas.von...@enterprisedb.com wrote: > > > This leaves the empty-data issue (which we have a f

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2023-03-28 Thread Jelte Fennema
On Tue, 28 Mar 2023 at 16:54, Denis Laxalde wrote: > I had a look into your patchset (v16), did a quick review and played a > bit with the feature. > > Patch 2 is missing the documentation about PQcancelSocket() and contains > a few typos; please find attached a (fixup) patch to correct these. Th

Re: Memory leak from ExecutorState context?

2023-03-28 Thread Tomas Vondra
On 3/28/23 15:17, Jehan-Guillaume de Rorthais wrote: > On Tue, 28 Mar 2023 00:43:34 +0200 > Tomas Vondra wrote: > >> On 3/27/23 23:13, Jehan-Guillaume de Rorthais wrote: >>> Please, find in attachment a patch to allocate bufFiles in a dedicated >>> context. I picked up your patch, backpatch'd

Re: Initial Schema Sync for Logical Replication

2023-03-28 Thread Masahiko Sawada
On Tue, Mar 28, 2023 at 6:47 PM Amit Kapila wrote: > > On Mon, Mar 27, 2023 at 8:17 AM Masahiko Sawada wrote: > > > > On Fri, Mar 24, 2023 at 11:51 PM Kumar, Sachin wrote: > > > > > > > From: Amit Kapila > > > > > I think we won't be able to use same snapshot because the transaction > > > > >

Re: Memory leak from ExecutorState context?

2023-03-28 Thread Jehan-Guillaume de Rorthais
Hi, Sorry for the late answer, I was reviewing the first patch and it took me some time to study and dig around. On Thu, 23 Mar 2023 08:07:04 -0400 Melanie Plageman wrote: > On Fri, Mar 10, 2023 at 1:51 PM Jehan-Guillaume de Rorthais > wrote: > > > So I guess the best thing would be to go thro

Re: [EXTERNAL] Re: Add non-blocking version of PQcancel

2023-03-28 Thread Denis Laxalde
Hi Jelte, I had a look into your patchset (v16), did a quick review and played a bit with the feature. Patch 2 is missing the documentation about PQcancelSocket() and contains a few typos; please find attached a (fixup) patch to correct these. --- a/src/interfaces/libpq/libpq-fe.h +++ b/src/int

Re: Support logical replication of DDLs

2023-03-28 Thread Jonathan S. Katz
On 3/27/23 2:37 AM, Amit Kapila wrote: On Mon, Mar 27, 2023 at 2:52 AM Tom Lane wrote: And TBH, I don't think that I quite believe the premise in the first place. The whole point of using logical rather than physical replication is that the subscriber installation(s) aren't exactly like the

Re: "variable not found in subplan target list"

2023-03-28 Thread Tom Lane
I wrote: > The planner is reducing the scan of target_parted to > a dummy scan, as is reasonable, but it forgets to > provide ctid as an output from that scan; then the > parent join node is unhappy because it does have > a ctid output. So it looks like the problem is some > shortcut we take while

Re: Missing update of all_hasnulls in BRIN opclasses

2023-03-28 Thread Tomas Vondra
Hi, It took me a while but I finally got back to reworking this to use the bt_info bit, as proposed by Alvaro. And it turned out to work great, because (a) it's a tuple-level flag, i.e. the right place, and (b) it does not overload existing flags. This greatly simplified the code in add_values_to

Re: Kerberos delegation support in libpq and postgres_fdw

2023-03-28 Thread Stephen Frost
Greetings, * Stephen Frost (sfr...@snowman.net) wrote: > * Greg Stark (st...@mit.edu) wrote: > > The CFBot says there's a function be_gssapi_get_proxy() which is > > undefined. Presumably this is a missing #ifdef or a definition that > > should be outside an #ifdef. > > Yup, just a couple of miss

Re: Support logical replication of global object commands

2023-03-28 Thread Zheng Li
> I think that there are some (possibly) tricky challenges that haven't > been discussed yet to support replicating global objects. > > First, as for publications having global objects (roles, databases, > and tablespaces), but storing them in database specific tables like > pg_publication doesn't

Re: Request for comment on setting binary format output per session

2023-03-28 Thread Dave Cramer
On Sun, 26 Mar 2023 at 21:30, Tom Lane wrote: > Dave Cramer writes: > > On Sun, 26 Mar 2023 at 18:12, Tom Lane wrote: > >> I would not expect DISCARD ALL to reset a session-level property. > > > Well if we can't reset it with DISCARD ALL how would that work with > > pgbouncer, or any pool for t

Re: Move definition of standard collations from initdb to pg_collation.dat

2023-03-28 Thread Peter Eisentraut
On 28.03.23 13:33, Tom Lane wrote: While we're here, do we want to adopt some other spelling of "the root locale" than "und", in view of recent discoveries about the instability of that on old ICU versions? That issue was fixed by 3b50275b12, so we can keep using the "und" spelling.

Re: TAP output format in pg_regress

2023-03-28 Thread Daniel Gustafsson
> On 28 Mar 2023, at 15:26, Daniel Gustafsson wrote: > I think the attached is a good candidate for going in, but I would like to > see it > for another spin in the CF bot first. Another candidate due to a thinko which raised a compiler warning. -- Daniel Gustafsson v19-0001-pg_regress-Emit

Re: Infinite Interval

2023-03-28 Thread Ashutosh Bapat
On Mon, Mar 20, 2023 at 3:16 AM Joseph Koshakow wrote: > > > > On Sun, Mar 19, 2023 at 5:13 PM Tom Lane wrote: > > > >Did you actually write "if TIMESTAMP_IS_NOBEGIN(dt2)" and not > >"if (TIMESTAMP_IS_NOBEGIN(dt2))"? If the former, I'm not surprised > >that pgindent gets confused. T

Re: Infinite Interval

2023-03-28 Thread Ashutosh Bapat
On Sun, Mar 26, 2023 at 1:28 AM Tom Lane wrote: > > I think you can take it as read that simple C test programs on modern > platforms will exhibit IEEE-compliant handling of float infinities. > For the record, I tried the attached. It gives a warning at compilation time. $gcc float_inf.c float_i

Re: SQL/JSON revisited

2023-03-28 Thread Erik Rijkers
Op 3/27/23 om 20:54 schreef Alvaro Herrera: Docs amended as I threatened. Other than that, this has required more > [v12-0001-SQL-JSON-constructors.patch] > [v12-0001-delta-uniqueifyJsonbObject-bugfix.patch] In doc/src/sgml/func.sgml, some minor stuff: 'which specify the data type returned'

Re: Infinite Interval

2023-03-28 Thread Ashutosh Bapat
On Sun, Mar 19, 2023 at 12:18 AM Joseph Koshakow wrote: > > The problem is that `secs = rint(secs)` rounds the seconds too early > and loses any fractional seconds. Do we have an overflow detecting > multiplication function for floats? We have float8_mul() which checks for overflow. typedef doubl

Re: Add standard collation UNICODE

2023-03-28 Thread Jeff Davis
On Tue, 2023-03-28 at 08:46 -0400, Joe Conway wrote: > > As long as we still have to initialize the libc locale fields to > > some > > language, I think it would be less confusing to keep the ICU locale > > on > > the same language. > > I definitely agree with that. Sounds good -- no changes then

Re: TAP output format in pg_regress

2023-03-28 Thread Daniel Gustafsson
> On 15 Mar 2023, at 11:36, Peter Eisentraut > wrote: > > On 24.02.23 10:49, Daniel Gustafsson wrote: >> Another rebase on top of 337903a16f. Unless there are conflicting reviews, I >> consider this patch to be done and ready for going in during the next CF. > > I think this is just about as g

Re: Memory leak from ExecutorState context?

2023-03-28 Thread Jehan-Guillaume de Rorthais
On Tue, 28 Mar 2023 00:43:34 +0200 Tomas Vondra wrote: > On 3/27/23 23:13, Jehan-Guillaume de Rorthais wrote: > > Please, find in attachment a patch to allocate bufFiles in a dedicated > > context. I picked up your patch, backpatch'd it, went through it and did > > some minor changes to it. I hav

Re: "variable not found in subplan target list"

2023-03-28 Thread Tom Lane
I wrote: > I reduced this down to > MERGE INTO public.target_parted as target_0 > USING public.itest1 as ref_0 > ON target_0.b = ref_0.a > WHEN NOT MATCHED >THEN INSERT VALUES (42, 13); > The critical moving part seems to just be that the MERGE target > is a partitioned table

Re: Hash table scans outside transactions

2023-03-28 Thread Ashutosh Bapat
Bumping it to attract some attention. On Tue, Mar 21, 2023 at 12:51 PM Ashutosh Bapat wrote: > > Hi, > Hash table scans (seq_scan_table/level) are cleaned up at the end of a > transaction in AtEOXact_HashTables(). If a hash seq scan continues > beyond transaction end it will meet "ERROR: no hash_

Re: "variable not found in subplan target list"

2023-03-28 Thread Tom Lane
Alvaro Herrera writes: > I have to run now so can't dissect it, but while running sqlsmith on the > SQL/JSON patch after Justin's report, I got $SUBJECT in this query: I reduced this down to MERGE INTO public.target_parted as target_0 USING public.itest1 as ref_0 ON target_0.b = ref_0.a

Re: Add standard collation UNICODE

2023-03-28 Thread Joe Conway
On 3/28/23 06:07, Peter Eisentraut wrote: On 23.03.23 21:16, Jeff Davis wrote: Another thought: for ICU, do we want the default collation to be UNICODE (root collation)? What we have now gets the default from the environment, which is consistent with the libc provider. But now that we have the

Re: PGdoc: add missing ID attribute to create_subscription.sgml

2023-03-28 Thread Amit Kapila
On Tue, Mar 28, 2023 at 1:00 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Amit, > > Thank you for reviewing! PSA new version. > > > Isn't it better to move the link-related part to the next line > > wherever possible? Currently, it looks bit odd. > > Previously I preferred not to add a new line insi

Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

2023-03-28 Thread Damir Belyalov
> > I might misunderstand something, but I believe the v5 patch uses > copy_generic_opt_list and it does not add IGNORE_DATATYPE_ERRORS as a > keyword. > It modifies neither kwlist.h nor gram.y. > Sorry, didn't notice that. I think everything is alright now. Regards, Damir Belyalov Postgres Profe

Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

2023-03-28 Thread torikoshia
On 2023-03-27 23:28, Damir Belyalov wrote: Hi! I made the specified changes and my patch turned out the same as yours. The performance measurements were the same too. Thanks for your review and measurements. The only thing left to do is how not to add IGNORE_DATATYPE_ERRORS as a keyword. See

Re: Non-replayable WAL records through overflows and >MaxAllocSize lengths

2023-03-28 Thread Michael Paquier
On Mon, Dec 19, 2022 at 12:37:19PM +0100, Alvaro Herrera wrote: > I have created one in the January commitfest, > https://commitfest.postgresql.org/41/ > and rebased the patch on current master. (I have not reviewed this.) I have spent some time on that, and here are some comments with an updated

Re: "variable not found in subplan target list"

2023-03-28 Thread Tom Lane
Alvaro Herrera writes: > I have to run now so can't dissect it, but while running sqlsmith on the > SQL/JSON patch after Justin's report, I got $SUBJECT in this query: Reproduces in HEAD and v15 too (once you replace pg_catalog.system_user with some function that exists in v15). So it's not the

Re: Move definition of standard collations from initdb to pg_collation.dat

2023-03-28 Thread Tom Lane
Peter Eisentraut writes: > While working on [0], I was wondering why the collations ucs_basic and > unicode are not in pg_collation.dat. I traced this back through > history, and I think this was just lost in a game of telephone. > The initial commit for pg_collation.h (414c5a2ea6) has only the

"variable not found in subplan target list"

2023-03-28 Thread Alvaro Herrera
I have to run now so can't dissect it, but while running sqlsmith on the SQL/JSON patch after Justin's report, I got $SUBJECT in this query: MERGE INTO public.target_parted as target_0 USING (select subq_0.c5 as c0, subq_0.c0 as c1, ref_0.a as c2, s

  1   2   >