Re: same query but different result on pg16devel and pg15.2

2023-04-03 Thread Richard Guo
On Tue, Apr 4, 2023 at 10:53 AM tender wang wrote: > Hi hackers, > I encounter a problem, as shown below: > > query: > select > ref_0.ps_suppkey as c0, > ref_1.c_acctbal as c1, > ref_2.o_totalprice as c2, > ref_2.o_orderpriority as c3, > ref_2.o_clerk as c4 > from > public.parts

Re: Minimal logical decoding on standbys

2023-04-03 Thread Amit Kapila
On Mon, Apr 3, 2023 at 8:51 PM Drouvot, Bertrand wrote: > > On 4/2/23 10:10 PM, Andres Freund wrote: > > Hi, > >> restart_lsn = s->data.restart_lsn; > >> - > >> -/* > >> - * If the slot is already invalid or is fresh enough, we > >> don't need to > >> -

Re: same query but different result on pg16devel and pg15.2

2023-04-03 Thread tender wang
Attached file included table schema information, but no data. tender wang 于2023年4月4日周二 10:53写道: > Hi hackers, > I encounter a problem, as shown below: > > query: > select > ref_0.ps_suppkey as c0, > ref_1.c_acctbal as c1, > ref_2.o_totalprice as c2, > ref_2.o_orderpriority as c3, >

Re: Prefetch the next tuple's memory during seqscans

2023-04-03 Thread David Rowley
On Tue, 4 Apr 2023 at 07:47, Gregory Stark (as CFM) wrote: > The referenced patch was committed March 19th but there's been no > comment here. Is this patch likely to go ahead this release or should > I move it forward again? Thanks for the reminder on this. I have done some work on it but just

RE: Add missing copyright for pg_upgrade/t/* files

2023-04-03 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thank you for responding! > > Yeah, it is good to have the Copyright to keep it consistent with > other test files and otherwise as well. > > --- a/src/bin/pg_upgrade/t/001_basic.pl > +++ b/src/bin/pg_upgrade/t/001_basic.pl > @@ -1,3 +1,5 @@ > +# Copyright (c) 2022-2023, PostgreSQL G

Re: RFC: logical publication via inheritance root?

2023-04-03 Thread Peter Smith
FYI, the WIP patch does not seem to apply cleanly anymore using the latest HEAD. See the cfbot rebase logs [1]. -- [1] http://cfbot.cputube.org/patch_42_4225.log Kind Regards, Peter Smith. Fujitsu Australia

Re: Add missing copyright for pg_upgrade/t/* files

2023-04-03 Thread Amit Kapila
On Mon, Apr 3, 2023 at 7:25 PM Hayato Kuroda (Fujitsu) wrote: > > While reading codes, I noticed that pg_upgrade/t/001_basic.pl and > pg_upgrade/t/002_pg_upgrade.pl do not contain the copyright. > > I checked briefly and almost all files have that, so I thought they missed it. > PSA the patch to f

Re: O(n) tasks cause lengthy startups and checkpoints

2023-04-03 Thread Nathan Bossart
I sent this one to the next commitfest and marked it as waiting-on-author and targeted for v17. I'm aiming to have something that addresses the latest feedback ready for the July commitfest. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: pg_usleep for multisecond delays

2023-04-03 Thread Nathan Bossart
On Mon, Apr 03, 2023 at 04:33:27PM -0400, Gregory Stark (as CFM) wrote: > Is this still a WIP? Is it targeting this release? There are only a > few days left before the feature freeze. I'm guessing it should just > move to the next CF for the next release? I moved it to the next commitfest and mar

Re: [BUG] pg_stat_statements and extended query protocol

2023-04-03 Thread Imseih (AWS), Sami
> Maybe, but is there any field demand for that? I don't think there is. > We clearly do need to fix the > reported rowcount for cases where ExecutorRun is invoked more than > once per ExecutorEnd call; but I think that's sufficient. Sure, the original proposed fix, but with tracking the es_tota

RE: Support logical replication of DDLs

2023-04-03 Thread houzj.f...@fujitsu.com
On Friday, March 31, 2023 6:31 AM Peter Smith wrote: Hi, > > It seems that lately, the patch attachments are lacking version numbers. It > causes unnecessary confusion. For example, I sometimes fetch patches from > this thread locally to "diff" them with previous patches to get a rough > overv

Re: [BUG] pg_stat_statements and extended query protocol

2023-04-03 Thread Tom Lane
"Imseih (AWS), Sami" writes: > I wonder if the right answer here is to track fetches as > a separate counter in pg_stat_statements, in which fetch > refers to the number of times a portal is executed? Maybe, but is there any field demand for that? IMV, the existing behavior is that we count one

Re: zstd compression for pg_dump

2023-04-03 Thread Justin Pryzby
On Mon, Apr 03, 2023 at 11:26:09PM +0200, Tomas Vondra wrote: > On 4/3/23 21:17, Justin Pryzby wrote: > > On Sat, Apr 01, 2023 at 10:26:01PM +0200, Tomas Vondra wrote: > >>> Feel free to mess around with threads (but I'd much rather see the patch > >>> progress for zstd:long). > >> > >> OK, underst

Re: [BUG] pg_stat_statements and extended query protocol

2023-04-03 Thread Imseih (AWS), Sami
> Why should that be the definition? Partial execution of a portal > might be something that is happening at the driver level, behind the > user's back. You can't make rational calculations of, say, plan > time versus execution time if that's how "calls" is measured. Correct, and there are also dr

same query but different result on pg16devel and pg15.2

2023-04-03 Thread tender wang
Hi hackers, I encounter a problem, as shown below: query: select ref_0.ps_suppkey as c0, ref_1.c_acctbal as c1, ref_2.o_totalprice as c2, ref_2.o_orderpriority as c3, ref_2.o_clerk as c4 from public.partsupp as ref_0 left join public.nation as sample_0 inner join pu

Re: [BUG] pg_stat_statements and extended query protocol

2023-04-03 Thread Tom Lane
"Imseih (AWS), Sami" writes: >> Also, I'm doubtful that counting calls this way is a great idea, >> which would mean you only need one new counter field not two. The >> fact that you're having trouble defining what it means certainly >> suggests that the implementation is out front of the design.

Re: [BUG] pg_stat_statements and extended query protocol

2023-04-03 Thread Imseih (AWS), Sami
> * Yeah, it'd be nice to have an in-core test, but it's folly to insist > on one that works via libpq and psql. That requires a whole new set > of features that you're apparently designing on-the-fly with no other > use cases in mind. I don't think that will accomplish much except to > ensure that

Re: running logical replication as the subscription owner

2023-04-03 Thread Noah Misch
On Mon, Apr 03, 2023 at 12:05:29PM -0700, Jeff Davis wrote: > On Sun, 2023-04-02 at 20:21 -0700, Noah Misch wrote: > > The most-plausible-to-me attack involves an ENABLE ALWAYS trigger > > that logs > > CURRENT_USER to an audit table. > > How does requiring that the subscription owner have SET ROL

Re: Minimal logical decoding on standbys

2023-04-03 Thread Masahiko Sawada
On Tue, Apr 4, 2023 at 3:17 AM Drouvot, Bertrand wrote: > > Hi, > > On 4/3/23 8:10 AM, Drouvot, Bertrand wrote: > > Hi, > > > > On 4/3/23 7:35 AM, Amit Kapila wrote: > >> On Mon, Apr 3, 2023 at 4:26 AM Jeff Davis wrote: > >> > >> Agreed, even Bertrand and myself discussed the same approach few >

fairywren exiting in ecpg

2023-04-03 Thread Andres Freund
Hi, Looks like fairywren is possibly seeing something I saw before and spent many days looking into: https://postgr.es/m/20220909235836.lz3igxtkcjb5w7zb%40awork3.anarazel.de which led me to add the following to .cirrus.yml: # Cirrus defaults to SetErrorMode(SEM_NOGPFAULTERRORBOX | ...). That

Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode

2023-04-03 Thread David Rowley
On Tue, 4 Apr 2023 at 02:49, Melanie Plageman wrote: > v9 attached. I've made a pass on the v9-0001 patch only. Here's what I noted down: v9-0001: 1. In the documentation and comments, generally we always double-space after a period. I see quite often you're not following this. 2. Doc: We co

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-03 Thread Tom Lane
David Rowley writes: > I think there would be quite a bit of work to do before we could ever > start to think about that. The planner does quite a bit of writing on > the parse, e.g adding new RangeTblEntrys to the query's rtable. We'd > either need to fix all those first or make a copy of the pa

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-03 Thread Tom Lane
Andres Freund writes: > It sounds too hard compared to the gains, but another way could be to plan > with the relevant path generation hard disabled, and plan from scratch, with > additional scan types enabled, if we end up being unable to generate valid > plan. Actually, I kind of like that. It

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-03 Thread David Rowley
On Tue, 4 Apr 2023 at 11:18, Andres Freund wrote: > It sounds too hard compared to the gains, but another way could be to plan > with the relevant path generation hard disabled, and plan from scratch, with > additional scan types enabled, if we end up being unable to generate valid > plan. I thin

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-03 Thread Andres Freund
Hi, On 2023-04-03 14:04:30 -0400, Tom Lane wrote: > Robert Haas writes: > > On Mon, Apr 3, 2023 at 8:13 AM Tom Lane wrote: > >> Personally, I'd get rid of disable_cost altogether if I could. > >> I'm not in a hurry to extend its use to more places. > > > I agree. I've wondered if we should put

Re: Kerberos delegation support in libpq and postgres_fdw

2023-04-03 Thread David Christensen
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:not tested Did a code review pass here; here is some feedback. + /* If p

Re: Should vacuum process config file reload more often

2023-04-03 Thread Melanie Plageman
On Mon, Apr 3, 2023 at 3:08 PM Andres Freund wrote: > On 2023-04-03 14:43:14 -0400, Tom Lane wrote: > > Melanie Plageman writes: > > > v13 attached with requested updates. > > > > I'm afraid I'd not been paying any attention to this discussion, > > but better late than never. I'm okay with letti

Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

2023-04-03 Thread Alexander Korotkov
On Mon, Apr 3, 2023 at 5:12 PM Pavel Borisov wrote: > Upon Alexander reverting patches v15 from master, I've rebased what > was correction patches v4 in a message above on a fresh master > (together with patches v15). The resulting patch v16 is attached. Pavel, thank you for you review, revisions

Re: Patch proposal: New hooks in the connection path

2023-04-03 Thread Gregory Stark (as CFM)
This looks like it was a good discussion -- last summer. But it doesn't seem to be a patch under active development now. It sounds like there were some design constraints that still need some new ideas to solve and a new patch will be needed to address them. Should this be marked Returned With Fe

Re: psql: Add role's membership options to the \du+ command

2023-04-03 Thread David G. Johnston
On Wed, Mar 22, 2023 at 11:11 AM Pavel Luzanov wrote: > In the previous version, I didn't notice (unlike cfbot) the compiler > warning. Fixed in version 6. > > I've marked this Ready for Committer. My opinion is that this is a necessary modification due to the already-committed changes to the me

Re: [PATCH] Introduce array_shuffle() and array_sample()

2023-04-03 Thread Daniel Gustafsson
> On 3 Apr 2023, at 23:46, Tom Lane wrote: > > Daniel Gustafsson writes: >> On 29 Sep 2022, at 21:33, Tom Lane wrote: >>> I find this behavior a bit surprising: >>> >>> +SELECT >>> array_dims(array_sample('[-1:2][2:3]={{1,2},{3,NULL},{5,6},{7,8}}'::int[], >>> 3)); >>> + array_dims >>> +---

Re: Split index and table statistics into different types of stats

2023-04-03 Thread Gregory Stark (as CFM)
On Thu, 16 Mar 2023 at 05:25, Drouvot, Bertrand wrote: > > My plan was to get [1] done before resuming working on the "Split index and > table statistics into different types of stats" one. > [1]: https://commitfest.postgresql.org/42/4106/ Generate pg_stat_get_xact*() functions with Macros ([1]

Re: [PATCH] Introduce array_shuffle() and array_sample()

2023-04-03 Thread Tom Lane
Daniel Gustafsson writes: > On 29 Sep 2022, at 21:33, Tom Lane wrote: >> I find this behavior a bit surprising: >> >> +SELECT >> array_dims(array_sample('[-1:2][2:3]={{1,2},{3,NULL},{5,6},{7,8}}'::int[], >> 3)); >> + array_dims >> +- >> + [-1:1][2:3] >> +(1 row) >> >> I can buy

Re: generic plans and "initial" pruning

2023-04-03 Thread Tom Lane
Amit Langote writes: > [ v38 patchset ] I spent a little bit of time looking through this, and concluded that it's not something I will be wanting to push into v16 at this stage. The patch doesn't seem very close to being committable on its own terms, and even if it was now is not a great time in

Re: WIP: Aggregation push-down - take2

2023-04-03 Thread Gregory Stark (as CFM)
It looks like in November 2022 Tomas Vondra said: > I did a quick initial review of the v20 patch series. > I plan to do a more thorough review over the next couple days, if time permits. > In general I think the patch is in pretty good shape. Following which Antonin Houska updated the patch resp

Re: GUC for temporarily disabling event triggers

2023-04-03 Thread Daniel Gustafsson
> On 3 Apr 2023, at 16:09, Robert Haas wrote: > On Mon, Apr 3, 2023 at 9:15 AM Daniel Gustafsson wrote: >>> On 3 Apr 2023, at 15:09, Robert Haas wrote: >>> I continue to think it's odd that the sense of this is inverted as >>> compared with row_security. >> >> I'm not sure I follow. Do you pr

Re: zstd compression for pg_dump

2023-04-03 Thread Tomas Vondra
On 4/3/23 21:17, Justin Pryzby wrote: > On Sat, Apr 01, 2023 at 10:26:01PM +0200, Tomas Vondra wrote: >>> Feel free to mess around with threads (but I'd much rather see the patch >>> progress for zstd:long). >> >> OK, understood. The long mode patch is pretty simple. IIUC it does not >> change t

Re: [PATCH] Introduce array_shuffle() and array_sample()

2023-04-03 Thread Daniel Gustafsson
> On 29 Sep 2022, at 21:33, Tom Lane wrote: > > Martin Kalcher writes: >> New patch: array_shuffle() and array_sample() use pg_global_prng_state now. > > I took a closer look at the patch today. Since this seems pretty close to going in, and seems like quite useful functions, I took a look to

Re: [PATCH] Introduce array_shuffle() and array_sample()

2023-04-03 Thread Gregory Stark (as CFM)
Given that there's been no updates since September 22 I'm going to make this patch Returned with Feedback. The patch can be resurrected when there's more work done -- don't forget to move it to the new CF when you do that. -- Gregory Stark As Commitfest Manager

Re: pg_stats and range statistics

2023-04-03 Thread Gregory Stark (as CFM)
On Fri, 24 Mar 2023 at 14:48, Egor Rogov wrote: > > Done. > There is one thing I'm not sure what to do about. This check: > > if (typentry->typtype != TYPTYPE_RANGE) > ereport(ERROR, > (errcode(ERRCODE_DATATYPE_MISMATCH), >errmsg("expected arr

Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert

2023-04-03 Thread Jacob Champion
On Mon, Apr 3, 2023 at 12:40 PM Daniel Gustafsson wrote: > Doh, sorry, my bad. I read and wrote 1.0.1 but was thinking about 1.0.2. You > are right, in 1.0.1 that API does not exist. I'm not all too concerned with > skipping this tests on OpenSSL versions that by the time 16 ships are 6 years >

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-04-03 Thread Melanie Plageman
On Mon, Apr 3, 2023 at 12:13 AM Pavel Luzanov wrote: > > Hello, > > I found that the 'standalone backend' backend type is not documented > right now. > Adding something like (from commit message) would be helpful: > > Both the bootstrap backend and single user mode backends will have > backend_typ

Re: pg_usleep for multisecond delays

2023-04-03 Thread Gregory Stark (as CFM)
On Mon, 13 Mar 2023 at 17:17, Nathan Bossart wrote: > > On Fri, Mar 10, 2023 at 12:28:28PM -0500, Tom Lane wrote: > > A quick grep for pg_usleep with large intervals finds rather more > > than you touched: > > > > [...] > > > > Did you have reasons for excluding the rest of these? > > I'm still lo

Re: Removing unneeded self joins

2023-04-03 Thread Gregory Stark (as CFM)
On Mon, 6 Mar 2023 at 00:30, Michał Kłeczek wrote: > > Hi All, > > I just wanted to ask about the status and plans for this patch. > I can see it being stuck at “Waiting for Author” status in several commit > tests. Sadly it seems to now be badly in need of a rebase. There are large hunks failin

Re: psql - factor out echo code

2023-04-03 Thread Gregory Stark (as CFM)
On Mon, 13 Feb 2023 at 05:41, Peter Eisentraut wrote: > > I think this patch requires an up-to-date summary and explanation. The > thread is over a year old and the patch has evolved quite a bit. There > are some test changes that are not explained. Please provide more > detail so that the patc

Re: SQL/JSON revisited

2023-04-03 Thread Alexander Lakhin
Hi Alvaro, 03.04.2023 20:16, Alvaro Herrera wrote: So I pushed 0001 on Friday, and here are 0002 (which I intend to push shortly, since it shouldn't be controversial) and the "JSON query functions" patch as 0003. After looking at it some more, I think there are some things that need to be addr

Re: Prefetch the next tuple's memory during seqscans

2023-04-03 Thread Gregory Stark (as CFM)
On Sun, 29 Jan 2023 at 21:24, David Rowley wrote: > > I've moved this patch to the next CF. This patch has a dependency on > what's being proposed in [1]. The referenced patch was committed March 19th but there's been no comment here. Is this patch likely to go ahead this release or should I mov

Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert

2023-04-03 Thread Daniel Gustafsson
> On 3 Apr 2023, at 21:04, Jacob Champion wrote: > > On Sun, Apr 2, 2023 at 1:36 PM Daniel Gustafsson wrote: >>> On 31 Mar 2023, at 19:59, Jacob Champion wrote: >>> I can make that change; note that it'll also skip some of the new tests >>> with OpenSSL 1.0.1, where there's no SSL_CTX_set_cert_

Re: Minimal logical decoding on standbys

2023-04-03 Thread Andres Freund
Hi, On 2023-04-03 17:34:52 +0200, Alvaro Herrera wrote: > On 2023-Apr-03, Drouvot, Bertrand wrote: > > > +/* > > + * Report terminating or conflicting message. > > + * > > + * For both, logical conflict on standby and obsolete slot are handled. > > + */ > > +static void > > +ReportTerminationInva

Re: Pass heaprel to GlobalVisTestFor() in vacuumRedirectAndPlaceholder()

2023-04-03 Thread Peter Geoghegan
On Mon, Apr 3, 2023 at 12:09 AM Drouvot, Bertrand wrote: > Right. Please find enclosed V2 also taking care of BTPageIsRecyclable() > and _bt_pendingfsm_finalize(). Pushed that as too separate patches just now. Thanks. BTW, I'm not overly happy about the extent of the changes to nbtree from commi

Re: zstd compression for pg_dump

2023-04-03 Thread Justin Pryzby
On Sat, Apr 01, 2023 at 10:26:01PM +0200, Tomas Vondra wrote: > > Feel free to mess around with threads (but I'd much rather see the patch > > progress for zstd:long). > > OK, understood. The long mode patch is pretty simple. IIUC it does not > change the format, i.e. in the worst case we could le

Re: running logical replication as the subscription owner

2023-04-03 Thread Jeff Davis
On Mon, 2023-04-03 at 10:26 -0400, Robert Haas wrote: > Not very much. I think the biggest risk is user confusion, but I > don't > think that's a huge risk because I don't think this scenario will > come > up very often. Also, it's kind of hard to imagine that there's a > security model here which

Re: Should vacuum process config file reload more often

2023-04-03 Thread Andres Freund
Hi, On 2023-04-03 14:43:14 -0400, Tom Lane wrote: > Melanie Plageman writes: > > v13 attached with requested updates. > > I'm afraid I'd not been paying any attention to this discussion, > but better late than never. I'm okay with letting autovacuum > processes reload config files more often th

Re: Thoughts on using Text::Template for our autogenerated code?

2023-04-03 Thread Corey Huinker
> > Yeah, it's somewhat hard to believe that the cost/benefit ratio would be > attractive. But maybe you could mock up some examples of what the input > could look like, and get people on board (or not) before writing any > code. > > tl;dr - I tried a few things, nothing that persuades myself let

Re: running logical replication as the subscription owner

2023-04-03 Thread Jeff Davis
On Sun, 2023-04-02 at 20:21 -0700, Noah Misch wrote: > The most-plausible-to-me attack involves an ENABLE ALWAYS trigger > that logs > CURRENT_USER to an audit table. How does requiring that the subscription owner have SET ROLE privileges on the table owner help that case? As Robert pointed out, u

Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert

2023-04-03 Thread Jacob Champion
On Sun, Apr 2, 2023 at 1:36 PM Daniel Gustafsson wrote: > > On 31 Mar 2023, at 19:59, Jacob Champion wrote: > > I can make that change; note that it'll also skip some of the new tests > > with OpenSSL 1.0.1, where there's no SSL_CTX_set_cert_cb. If that's > > acceptable, it should be an easy swit

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

2023-04-03 Thread Andres Freund
Hi, On 2023-04-03 14:25:59 +0200, Tomas Vondra wrote: > On 4/3/23 00:40, Andres Freund wrote: > > Hi, > > > > On 2023-03-28 19:17:21 -0700, Andres Freund wrote: > >> 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

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-03 Thread Robert Haas
On Mon, Apr 3, 2023 at 2:04 PM Tom Lane wrote: > Yeah. In some places it would not be too hard; for example, if we > generated seqscan paths last instead of first for baserels, the rule > could be "generate it if enable_seqscan is on OR if we made no other > path for the rel". It's much messier

Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

2023-04-03 Thread Pavel Stehule
Hi po 3. 4. 2023 v 19:37 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > po 27. 3. 2023 v 5:36 odesílatel Kirk Wolak napsal: > >> I have marked the item Ready for Commiter... > > > Thank you for doc and for review > > I'm kind of surprised there was any interest in this proposal at al

Re: [BUG] Logical replica crash if there was an error in a function.

2023-04-03 Thread Tom Lane
"Anton A. Melnikov" writes: > Now there are no any pending questions, so moved it to RFC. I did not think this case was worth memorializing in a test before, and I still do not. I'm inclined to reject this patch. regards, tom lane

Re: Should vacuum process config file reload more often

2023-04-03 Thread Tom Lane
Melanie Plageman writes: > v13 attached with requested updates. I'm afraid I'd not been paying any attention to this discussion, but better late than never. I'm okay with letting autovacuum processes reload config files more often than now. However, I object to allowing ProcessConfigFile to be

Re: Minimal logical decoding on standbys

2023-04-03 Thread Drouvot, Bertrand
Hi, On 4/3/23 8:10 AM, Drouvot, Bertrand wrote: Hi, On 4/3/23 7:35 AM, Amit Kapila wrote: On Mon, Apr 3, 2023 at 4:26 AM Jeff Davis wrote: Agreed, even Bertrand and myself discussed the same approach few emails above. BTW, if we have this selective logic to wake physical/logical walsenders a

Re: [Proposal] Add foreign-server health checks infrastructure

2023-04-03 Thread Tom Lane
Fujii Masao writes: > Regarding 0001 patch, on second thought, to me, it seems odd to expose > a function that doesn't have anything to directly do with PostgreSQL > as a libpq function. The function simply calls poll() on the socket > with POLLRDHUP if it is supported. While it is certainly conve

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-03 Thread Tom Lane
Robert Haas writes: > On Mon, Apr 3, 2023 at 8:13 AM Tom Lane wrote: >> Personally, I'd get rid of disable_cost altogether if I could. >> I'm not in a hurry to extend its use to more places. > I agree. I've wondered if we should put some work into that. It feels > bad to waste CPU cycles generat

Re: Non-superuser subscription owners

2023-04-03 Thread Robert Haas
On Sat, Apr 1, 2023 at 12:00 PM Alexander Lakhin wrote: > I've managed to reproduce it using the following script: > for ((i=1;i<=10;i++)); do > echo "iteration $i" > echo " > CREATE ROLE sub_user; > CREATE SUBSCRIPTION testsub CONNECTION 'dbname=db' > PUBLICATION testpub WITH (connect = false);

Re: [Proposal] Add foreign-server health checks infrastructure

2023-04-03 Thread Fujii Masao
On 2023/03/13 16:05, Hayato Kuroda (Fujitsu) wrote: Thank you so much for your reviewing! Now we can wait comments from senior members and committers. Thanks for working on this patch! Regarding 0001 patch, on second thought, to me, it seems odd to expose a function that doesn't have anythi

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-03 Thread Robert Haas
On Mon, Apr 3, 2023 at 8:13 AM Tom Lane wrote: > Personally, I'd get rid of disable_cost altogether if I could. > I'm not in a hurry to extend its use to more places. I agree. I've wondered if we should put some work into that. It feels bad to waste CPU cycles generating paths we intend to basica

Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

2023-04-03 Thread Tom Lane
Pavel Stehule writes: > po 27. 3. 2023 v 5:36 odesílatel Kirk Wolak napsal: >> I have marked the item Ready for Commiter... > Thank you for doc and for review I'm kind of surprised there was any interest in this proposal at all, TBH, but apparently there is some. Still, I think you over-engine

Re: [BUG] pg_stat_statements and extended query protocol

2023-04-03 Thread Tom Lane
"Imseih (AWS), Sami" writes: >> So... The idea here is to set a custom fetch size so as the number of >> calls can be deterministic in the tests, still more than 1 for the >> tests we'd have. And your point is that libpq enforces always 0 when >> sending the EXECUTE message causing it to always

Re: Should vacuum process config file reload more often

2023-04-03 Thread Melanie Plageman
On Sun, Apr 2, 2023 at 10:28 PM Masahiko Sawada wrote: > Thank you for updating the patches. Here are comments for 0001, 0002, > and 0003 patches: Thanks for the review! v13 attached with requested updates. > 0001: > > @@ -391,7 +389,7 @@ heap_vacuum_rel(Relation rel, VacuumParams *params, >

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

2023-04-03 Thread Dave Cramer
> participating clients to receive GUC configured format. I do not > > think that libpq's result format being able to be overridden by GUC >> > is a good idea at all, the library has to to participate, and I >> > think can be made to so so without adjusting the interface (say, by >> > resultForma

Re: Minimal logical decoding on standbys

2023-04-03 Thread Alvaro Herrera
On 2023-Apr-03, Drouvot, Bertrand wrote: > +/* > + * Report terminating or conflicting message. > + * > + * For both, logical conflict on standby and obsolete slot are handled. > + */ > +static void > +ReportTerminationInvalidation(bool terminating, bool islogical, int pid, > +

Re: Minimal logical decoding on standbys

2023-04-03 Thread Drouvot, Bertrand
Hi, On 4/2/23 10:10 PM, Andres Freund wrote: Hi, Btw, most of the patches have some things that pgindent will change (and some that my editor will highlight). It wouldn't hurt to run pgindent for the later patches... done. Pushed the WAL format change. Thanks! On 2023-04-02 10:27:45

Re: Initial Schema Sync for Logical Replication

2023-04-03 Thread Masahiko Sawada
On Mon, Apr 3, 2023 at 3:54 PM Kumar, Sachin wrote: > > > > > -Original Message- > > From: Masahiko Sawada > > > > I was thinking each TableSync process will call pg_dump --table, > > > > This way if we have N tableSync process, we can have N pg_dump -- > > table=table_name called in para

Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode

2023-04-03 Thread Melanie Plageman
On Mon, Apr 3, 2023 at 1:09 AM David Rowley wrote: > > On Sat, 1 Apr 2023 at 13:24, Melanie Plageman > wrote: > > Your diff LGTM. > > > > Earlier upthread in [1], Bharath had mentioned in a review comment about > > removing the global variables that he would have expected the analogous > > globa

Re: is_superuser is not documented

2023-04-03 Thread Fujii Masao
On 2023/04/01 22:34, Joseph Koshakow wrote: The patch updated the guc table for is_superuser in src/backend/utils/misc/guc_tables.c Yes, this patch moves the descriptions of is_superuser to config.sgml and changes its group to PRESET_OPTIONS. However, when I look at the code on master I do

Re: daitch_mokotoff module

2023-04-03 Thread Tomas Vondra
On 4/3/23 15:19, Dag Lem wrote: > Dag Lem writes: > >> I sincerely hope this resolves any blocking issues with copyright / >> legalese / credits. >> > > Can this now be considered ready for commiter, so that Paul or someone > else can flip the bit? > Hi, I think from the technical point of vie

Re: running logical replication as the subscription owner

2023-04-03 Thread Robert Haas
Thank you for this email. It's very helpful to get your opinion on this. On Sun, Apr 2, 2023 at 11:21 PM Noah Misch wrote: > On Wed, Mar 29, 2023 at 04:00:45PM -0400, Robert Haas wrote: > > > The dangerous cases seem to be something along the lines of a security- > > > invoker trigger function th

Re: running logical replication as the subscription owner

2023-04-03 Thread Robert Haas
On Fri, Mar 31, 2023 at 6:46 PM Jeff Davis wrote: > I guess the "more convenient" is where I'm confused, because the "grant > subscription_owner to table owner with set role true" is not likely to > be conveniently already present; it would need to be issued manually to > take advantage of this sp

Re: [EXTERNAL] Re: [PATCH] Report the query string that caused a memory error under Valgrind

2023-04-03 Thread Tom Lane
Onur Tirtir writes: > Thank you for sharing your proposal as a patch. It looks much nicer and > useful than mine. > I've also tested it for a few cases --by injecting a memory error on > purpose-- and seen that it helps reporting the problematic query. > Should we move forward with v3 then? OK,

Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

2023-04-03 Thread Pavel Borisov
Upon Alexander reverting patches v15 from master, I've rebased what was correction patches v4 in a message above on a fresh master (together with patches v15). The resulting patch v16 is attached. Pavel. v16-0002-Add-EvalPlanQual-delete-returning-isolation-test.patch Description: Binary data v

Re: Infinite Interval

2023-04-03 Thread Ashutosh Bapat
Hi Joseph, On Mon, Apr 3, 2023 at 6:02 AM Joseph Koshakow wrote: > > I've attached a patch with all of the errcontext calls removed. None of > the existing out of range errors have an errdetail call so I think this > is more consistent. If we do want to add errdetail, then we should > probably

Re: GUC for temporarily disabling event triggers

2023-04-03 Thread Robert Haas
On Mon, Apr 3, 2023 at 9:15 AM Daniel Gustafsson wrote: > > On 3 Apr 2023, at 15:09, Robert Haas wrote: > > On Mon, Apr 3, 2023 at 8:46 AM Daniel Gustafsson wrote: > >> All comments above addressed in the attached v5, thanks for review! > > > > I continue to think it's odd that the sense of this

Re: Infinite Interval

2023-04-03 Thread Ashutosh Bapat
Hi Joseph, thanks for addressing comments. On Sat, Apr 1, 2023 at 10:53 PM Joseph Koshakow wrote: > So I added a check for FLOAT8_FITS_IN_INT64() and a test with this > scenario. I like that. Thanks. > > For what it's worth I think that 2147483647 months only became a valid > interval in v15 as

Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

2023-04-03 Thread Pavel Borisov
Hi, Alexander! On 2023-04-02 03:37:19 +0300, Alexander Korotkov wrote: > On Sat, Apr 1, 2023 at 8:21 AM Andres Freund wrote: > > Given that the in-tree state has been broken for a week, I think it probably > > is time to revert the commits that already went in. > > The revised patch is attached.

Re: POC: Lock updated tuples in tuple_update() and tuple_delete()

2023-04-03 Thread Alexander Korotkov
On Sun, Apr 2, 2023 at 3:47 AM Andres Freund wrote: > On 2023-04-02 03:37:19 +0300, Alexander Korotkov wrote: > > On Sat, Apr 1, 2023 at 8:21 AM Andres Freund wrote: > > > Given that the in-tree state has been broken for a week, I think it > > > probably > > > is time to revert the commits that

Add missing copyright for pg_upgrade/t/* files

2023-04-03 Thread Hayato Kuroda (Fujitsu)
Dear hackers, While reading codes, I noticed that pg_upgrade/t/001_basic.pl and pg_upgrade/t/002_pg_upgrade.pl do not contain the copyright. I checked briefly and almost all files have that, so I thought they missed it. PSA the patch to fix them. Best Regards, Hayato Kuroda FUJITSU LIMITED ad

RE: Support logical replication of DDLs

2023-04-03 Thread Phil Florent
Hi, Sorry about the list. Since it was a question about the specifications I thought I had to ask it first in the general list. I will reply in the hackers list only for new features. Replicating from orcl to postgres was difficult. You mentionned renaming of columns, the ordinal position of a

Re: Is RecoveryConflictInterrupt() entirely safe in a signal handler?

2023-04-03 Thread Tom Lane
Thomas Munro writes: > I think this experiment worked out pretty well. I think it's a nice > side-effect that you can see what memory the regexp subsystem is > using, and that's likely to lead to more improvements. (Why is it > limited to caching 32 entries? Why is it a linear search, not a has

Re: daitch_mokotoff module

2023-04-03 Thread Dag Lem
Dag Lem writes: > I sincerely hope this resolves any blocking issues with copyright / > legalese / credits. > Can this now be considered ready for commiter, so that Paul or someone else can flip the bit? Best regards Dag Lem

Re: GUC for temporarily disabling event triggers

2023-04-03 Thread Daniel Gustafsson
> On 3 Apr 2023, at 15:09, Robert Haas wrote: > > On Mon, Apr 3, 2023 at 8:46 AM Daniel Gustafsson wrote: >> All comments above addressed in the attached v5, thanks for review! > > I continue to think it's odd that the sense of this is inverted as > compared with row_security. I'm not sure I f

Re: RFC: logical publication via inheritance root?

2023-04-03 Thread Aleksander Alekseev
Hi, > > Outside the scope of special TimescaleDB tables and the speculated > > pg_partman old-style table migration, will this proposed new feature > > have any other application? In other words, do you know if this > > proposal will be of any benefit to the *normal* users who just have > > native

Re: GUC for temporarily disabling event triggers

2023-04-03 Thread Robert Haas
On Mon, Apr 3, 2023 at 8:46 AM Daniel Gustafsson wrote: > All comments above addressed in the attached v5, thanks for review! I continue to think it's odd that the sense of this is inverted as compared with row_security. -- Robert Haas EDB: http://www.enterprisedb.com

Re: GUC for temporarily disabling event triggers

2023-04-03 Thread Daniel Gustafsson
> On 2 Apr 2023, at 21:48, Justin Pryzby wrote: > + gettext_noop("Disable event triggers for the duration > of the session."), > > Why does is it say "for the duration of the session" ? > > It's possible to disable ignoring, and within the same session. > GUCs are typical

Re: Sketch of a fix for that truncation data corruption issue

2023-04-03 Thread Tom Lane
Alvaro Herrera writes: > Has this problem been fixed? I was under the impression that it had > been, but I spent some 20 minutes now looking for code, commits, or > patches in the archives, and I can't find anything relevant. Maybe it > was fixed in some different way that's not so obviously con

Re: [PATCH] Clarify the behavior of the system when approaching XID wraparound

2023-04-03 Thread Aleksander Alekseev
Hi John, Many thanks for all the great feedback! > Okay, the changes look good. To go further, I think we need to combine into > two patches, one with 0001-0003 and one with 0004: > > 1. Correct false statements about "shutdown" etc. This should contain changes > that can safely be patched all

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

2023-04-03 Thread Tomas Vondra
On 4/3/23 00:40, Andres Freund wrote: > Hi, > > On 2023-03-28 19:17:21 -0700, Andres Freund wrote: >> 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. > > I'd welcome some review (

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-03 Thread Tom Lane
Quan Zongliang writes: > I found that the enable_hashjoin disables HashJoin completely. Well, yeah. It's what you asked for. > Instead, it should add a disable cost to the cost calculation of > hashjoin. Why? The disable-cost stuff is a crude hack that we use when turning off a particular pl

Re: Option to not use ringbuffer in VACUUM, using it in failsafe mode

2023-04-03 Thread David Rowley
I've now pushed up v8-0004. Can rebase the remaining 2 patches on top of master again and resend? On Mon, 3 Apr 2023 at 08:11, Melanie Plageman wrote: > I still have a few open questions: > - what the initial value of ring_size for autovacuum should be (see the > one remaining TODO in the code

Re: running logical replication as the subscription owner

2023-04-03 Thread Amit Kapila
On Thu, Mar 30, 2023 at 7:12 PM Robert Haas wrote: > > I don't think run_as_owner is terrible, despite the ambiguity. It's > talking about the owner of the object on which the property is being > set. > I find this justification quite reasonable to keep the option name as run_as_owner. So, +1 to

  1   2   >