[PoC] pg_upgrade: allow to upgrade publisher node

2023-04-04 Thread Hayato Kuroda (Fujitsu)
Dear hackers, (CC: Amit and Julien) This is a fork thread of Julien's thread, which allows to upgrade subscribers without losing changes [1]. I briefly implemented a prototype for allowing to upgrade publisher node. IIUC the key lack was that replication slots used for logical replication could n

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-04 Thread Quan Zongliang
On 2023/4/3 19:44, Tomas Vondra wrote: On 4/3/23 12:23, Quan Zongliang wrote: Hi, I found that the enable_hashjoin disables HashJoin completely. It's in the function add_paths_to_joinrel: if (enable_hashjoin || jointype == JOIN_FULL) hash_inner_and_outer(root, joinrel, outerrel, innerr

Re: Minimal logical decoding on standbys

2023-04-04 Thread Masahiko Sawada
On Tue, Apr 4, 2023 at 10:55 AM Masahiko Sawada wrote: > > 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:

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

2023-04-04 Thread John Naylor
On Mon, Apr 3, 2023 at 7:33 PM Aleksander Alekseev wrote: > > Yes, the exact same text as it appeared in the [2] thread above, which prompted Robert's comment I quoted. I take the point to mean: All of these things need to be taken care of *first*, before vacuuming, so the hint should order thing

Re: Should vacuum process config file reload more often

2023-04-04 Thread Masahiko Sawada
On Tue, Apr 4, 2023 at 1:41 AM Melanie Plageman wrote: > > 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: > > >

Re: Minimal logical decoding on standbys

2023-04-04 Thread Drouvot, Bertrand
Hi, On 4/4/23 7:57 AM, Amit Kapila wrote: On Mon, Apr 3, 2023 at 8:51 PM Drouvot, Bertrand wrote: I made it as simple as: /* * If the slot is already invalid or is a non conflicting slot, we don't * need to do anything. */ islogical = xid

Re: Minimal logical decoding on standbys

2023-04-04 Thread Drouvot, Bertrand
Hi, On 4/4/23 9:48 AM, Masahiko Sawada wrote: On Tue, Apr 4, 2023 at 10:55 AM Masahiko Sawada wrote: Regarding 0004 patch: @@ -2626,6 +2626,12 @@ InitWalSenderSlot(void) walsnd->sync_standby_priority = 0; walsnd->latch = &MyProc->procLatch;

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

2023-04-04 Thread Pavel Borisov
Hi! I've looked into the patches v4. For 0001: I think long "not accepting commands that generate" is equivalent to more concise "can't generate". For 0003: I think double mentioning of Vacuum at each errhist i.e.: "Execute a database-wide VACUUM in that database" and "...or run a manual database-

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

2023-04-04 Thread Drouvot, Bertrand
Hi, On 4/3/23 11:47 PM, Gregory Stark (as CFM) wrote: 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/ Gen

[PATCH] Add statement_timeout in pg_stat_activity

2023-04-04 Thread Anthonin Bonnefoy
Hello hackers. This patch adds the backend's statement_timeout value to pg_stat_activity. This would provide some insights on clients that are disabling a default statement timeout or overriding it through a pgbouncer, messing with other sessions. pg_stat_activity seemed like the best place to h

Re: Patch proposal: New hooks in the connection path

2023-04-04 Thread Drouvot, Bertrand
Hi, On 4/4/23 12:08 AM, Gregory Stark (as CFM) wrote: 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

Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit

2023-04-04 Thread Etsuro Fujita
On Wed, Jan 18, 2023 at 8:06 PM Etsuro Fujita wrote: > I rebased the patch. Attached is an updated patch. The parallel-abort patch received a review from David, and I addressed his comments. Also, he tested with the patch, and showed that it reduces time taken to abort remote transactions. So,

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

2023-04-04 Thread Michael Paquier
On Tue, Apr 04, 2023 at 12:04:35PM +0200, Drouvot, Bertrand wrote: > I moved it to the next commitfest and marked the target version as > v17. Thanks for moving it. I think that we should be able to do a bit more work for the switch to macros in pgstatfuncs.c, but this is going to require more re

Re: SQL/JSON revisited

2023-04-04 Thread Amit Langote
Hi Alvaro, On Tue, Apr 4, 2023 at 2:16 AM Alvaro Herrera wrote: > On 2023-Mar-29, Alvaro Herrera wrote: > > In the meantime, here's the next two patches of the series: IS JSON and > > the "query" functions. I think this is as much as I can get done for > > this release, so the last two pieces of

Re: Minimal logical decoding on standbys

2023-04-04 Thread Alvaro Herrera
Hi, On 2023-Apr-03, Andres Freund wrote: > Hm? That's what the _'s do. We build strings in parts in other places too. No, what _() does is mark each piece for translation separately. But a translation cannot be done on string pieces, and later have all the pieces appended together to form a ful

Re: Support logical replication of DDLs

2023-04-04 Thread shveta malik
On Tue, Apr 4, 2023 at 8:43 AM houzj.f...@fujitsu.com wrote: > Attach the new version patch set which did the following changes: > Hello, I tried below: pubnew=# ALTER PUBLICATION mypub2 SET (ddl = 'table'); ALTER PUBLICATION pubnew=# \dRp+ Publication m

Re: Minimal logical decoding on standbys

2023-04-04 Thread Amit Kapila
On Tue, Apr 4, 2023 at 3:14 PM Drouvot, Bertrand wrote: > +static inline bool +LogicalReplicationSlotXidsConflict(ReplicationSlot *s, TransactionId xid) +{ + TransactionId slot_xmin; + TransactionId slot_catalog_xmin; + + slot_xmin = s->data.xmin; + slot_catalog_xmin = s->data.catalog_xmin; + +

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

2023-04-04 Thread Michael Paquier
On Wed, Mar 29, 2023 at 07:44:20AM +0200, Drouvot, Bertrand wrote: > Please find a draft attached. This addition looks OK for me. Thanks for the patch! -- Michael signature.asc Description: PGP signature

Re: [BUG] pg_stat_statements and extended query protocol

2023-04-04 Thread Michael Paquier
On Tue, Apr 04, 2023 at 03:29:07AM +, Imseih (AWS), Sami wrote: >> 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: fairywren exiting in ecpg

2023-04-04 Thread Andrew Dunstan
On 2023-04-03 Mo 21:15, Andres Freund wrote: 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

Re: Minimal logical decoding on standbys

2023-04-04 Thread Drouvot, Bertrand
Hi, On 4/4/23 1:43 PM, Amit Kapila wrote: On Tue, Apr 4, 2023 at 3:14 PM Drouvot, Bertrand wrote: +static inline bool +LogicalReplicationSlotXidsConflict(ReplicationSlot *s, TransactionId xid) +{ + TransactionId slot_xmin; + TransactionId slot_catalog_xmin; + + slot_xmin = s->data.xmin; +

Re: SQL/JSON revisited

2023-04-04 Thread Alvaro Herrera
On 2023-Apr-04, Amit Langote wrote: > On Tue, Apr 4, 2023 at 2:16 AM Alvaro Herrera wrote: > > - the gram.y solution to the "ON ERROR/ON EMPTY" clauses is quite ugly. > > I think we could make that stuff use something similar to > > ConstraintAttributeSpec with an accompanying post-processin

Check whether binaries can be released for s390x

2023-04-04 Thread Namrata Bhave
Hi, We are looking forward to get help from community on publishing s390x binaries. As per downloads page, apt repo supports Ubuntu on amd,arm,i386 and ppc64le. We had reached out earlier and are ready to provide infra if needed. Wanted to check again if community is willing to help. Thank you

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

2023-04-04 Thread Aleksander Alekseev
Hi, > The proposed changes are in patchset v5. Pavel, John, thanks for your feedback. > I've looked into the patches v4. > For 0001: > I think long "not accepting commands that generate" is equivalent to > more concise "can't generate". Frankly I don't think this is a good change for this parti

Re: ICU locale validation / canonicalization

2023-04-04 Thread Peter Eisentraut
On 31.03.23 12:11, Jeff Davis wrote: On Thu, 2023-03-30 at 08:59 +0200, Peter Eisentraut wrote: I don't think we should show the notice when the canonicalization doesn't change anything.  This is not useful: +NOTICE:  using language tag "und-u-kf-upper" for locale "und-u-kf- upper" Done. Al

Re: Check whether binaries can be released for s390x

2023-04-04 Thread Jonathan S. Katz
Hi Namrata, On 4/4/23 8:56 AM, Namrata Bhave wrote: Hi, We are looking forward to get help from community on publishing s390x binaries. As per downloads page, apt repo supports Ubuntu on amd,arm,i386 and ppc64le. We had reached out earlier and are ready to provide infra if needed. Wanted t

Re: generic plans and "initial" pruning

2023-04-04 Thread Amit Langote
On Tue, Apr 4, 2023 at 6:41 AM Tom Lane wrote: > 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 i

RE: Check whether binaries can be released for s390x

2023-04-04 Thread Namrata Bhave
Hi Jonathan, Thank you for getting back. The request is mainly for the developer community to build and publish s390x binaries, apologies if I wasn't clear earlier. We can provide s390x VMs to build and test postgresql binaries if you feel infra is a blocker. Please let me know if any more inf

Re: Should vacuum process config file reload more often

2023-04-04 Thread Daniel Gustafsson
> On 4 Apr 2023, at 00:35, Melanie Plageman wrote: > > 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 discus

Re: Minimal logical decoding on standbys

2023-04-04 Thread Amit Kapila
On Tue, Apr 4, 2023 at 6:05 PM Drouvot, Bertrand wrote: > > On 4/4/23 1:43 PM, Amit Kapila wrote: > > On Tue, Apr 4, 2023 at 3:14 PM Drouvot, Bertrand > > wrote: > >> > > > > > > +static inline bool > > +LogicalReplicationSlotXidsConflict(ReplicationSlot *s, TransactionId xid) > > +{ > > + Transa

Re: Why enable_hashjoin Completely disables HashJoin

2023-04-04 Thread Robert Haas
On Tue, Apr 4, 2023 at 3:38 AM Quan Zongliang wrote: > Because someone noticed that when he set enable_hashjoin, > enable_mergejoin and enable_nestloop to off. The statement seemed to get > stuck (actually because it chose the NestedLoop path, which took a long > long time to run). > If enable_has

Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

2023-04-04 Thread Tom Lane
Pavel Stehule writes: > There is reduced patch + regress tests One more thing: I do not think it's appropriate to allow this in GET STACKED DIAGNOSTICS. That's about reporting the place where an error occurred, not the current location. Eventually it might be interesting to retrieve the OID of

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

2023-04-04 Thread Peter Eisentraut
On 29.03.23 18:03, Brar Piening wrote: On 29.03.2023 at 06:52, Hayato Kuroda (Fujitsu) wrote: FYI - my patch is pushed Thanks! Could you please rebase your patch? Done and tested. Patch is attached. I have committed the most recent patch that added some missing IDs. (I also added a mi

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-04-04 Thread Gregory Stark (as CFM)
On Sun, 26 Feb 2023 at 19:11, Melanie Plageman wrote: > > This is cool! Thanks for working on this. > I had a chance to review your patchset and I had some thoughts and > questions. It looks like this patch got a pretty solid review from Melanie Plageman in February just before the CF started. It

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

2023-04-04 Thread Pavel Borisov
On Tue, 4 Apr 2023 at 17:08, Aleksander Alekseev wrote: > > Hi, > > > The proposed changes are in patchset v5. > > Pavel, John, thanks for your feedback. > > > I've looked into the patches v4. > > For 0001: > > I think long "not accepting commands that generate" is equivalent to > > more concise "

Re: Minimal logical decoding on standbys

2023-04-04 Thread Drouvot, Bertrand
Hi, On 4/4/23 3:43 PM, Amit Kapila wrote: On Tue, Apr 4, 2023 at 6:05 PM Drouvot, Bertrand I think we might want to consider slot's effective_xmin instead of data.xmin as we use that to store xmin_horizon when we build the full snapshot. Oh, I did not know about the 'effective_xmin' and was

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

2023-04-04 Thread Peter Eisentraut
On 23.03.23 20:08, Brar Piening wrote: I've also attached the (unchanged)  make_html_ids_discoverable patch for convenience so this email now contains two patches for postgresql (ending with .postgresql.patch) and one patch for pgweb (ending with .pgweb.patch). Here is my view on this: First o

Re: Check whether binaries can be released for s390x

2023-04-04 Thread Robert Haas
On Tue, Apr 4, 2023 at 9:30 AM Namrata Bhave wrote: > Thank you for getting back. > > The request is mainly for the developer community to build and publish s390x > binaries, apologies if I wasn't clear earlier. > We can provide s390x VMs to build and test postgresql binaries if you feel > infra

Re: Commitfest 2023-03 starting tomorrow!

2023-04-04 Thread Gregory Stark (as CFM)
Only a few more days remain before feature freeze. We've now crossed over 100 patches committed according to the CF app: Status summary: March 15March 22March 28April 4 Needs review: 152 128 116 96 Waiting on Author: 42 36

Re: RFC: logical publication via inheritance root?

2023-04-04 Thread Jacob Champion
On Mon, Apr 3, 2023 at 8:53 PM Peter Smith wrote: > > FYI, the WIP patch does not seem to apply cleanly anymore using the latest > HEAD. Yes, sorry -- after 062a84442, the architecture needs to change in a way that I'm still working through. I've moved the patch to Waiting on Author while I figu

Re: Commitfest 2023-03 starting tomorrow!

2023-04-04 Thread Tom Lane
"Gregory Stark (as CFM)" writes: > However I tried to do a pass of the Needs Review patches and found > that a lot of them were really waiting for comment and seemed to be > useful features or bug fixes that already had a significant amount of > work put into them and seemed likely to get committe

Re: Improving btree performance through specializing by key shape, take 2

2023-04-04 Thread Gregory Stark (as CFM)
Hm. The cfbot has a fairly trivial issue with this with a unused variable: 18:36:17.405] In file included from ../../src/include/access/nbtree.h:1184, [18:36:17.405] from verify_nbtree.c:27: [18:36:17.405] verify_nbtree.c: In function ‘palloc_btree_page’: [18:36:17.405] ../../src/include/access/nb

Re: logical decoding and replication of sequences, take 2

2023-04-04 Thread Gregory Stark (as CFM)
Fwiw the cfbot seems to have some failing tests with this patch: [19:05:11.398] # Failed test 'initial test data replicated' [19:05:11.398] # at t/030_sequences.pl line 75. [19:05:11.398] # got: '1|0|f' [19:05:11.398] # expected: '132|0|t' [19:05:11.398] [19:05:11.398] # Failed test 'advance sequ

Re: Fix the description of GUC "max_locks_per_transaction" and "max_pred_locks_per_transaction" in guc_table.c

2023-04-04 Thread Tom Lane
Nathan Bossart writes: > On Wed, Feb 22, 2023 at 12:40:07PM +, wangw.f...@fujitsu.com wrote: >> After some rethinking, I think users can easily get exact value according to >> exact formula, and I think using accurate formula can help users adjust >> max_locks_per_transaction or max_predicate_

Re: running logical replication as the subscription owner

2023-04-04 Thread Robert Haas
On Mon, Apr 3, 2023 at 10:09 PM Noah Misch wrote: > I gather we agree on what to do for v16, which is good. I have committed the patches. -- Robert Haas EDB: http://www.enterprisedb.com

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

2023-04-04 Thread Tom Lane
"David G. Johnston" writes: > I've marked this Ready for Committer. Hmm ... not sure I like the proposed output. The 'a', 'i', 's' annotations are short but they don't have much else to recommend them. On the other hand, there's nearby precedent for single-letter abbreviations in ACL displays.

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

2023-04-04 Thread David G. Johnston
On Tue, Apr 4, 2023 at 9:13 AM Tom Lane wrote: > "David G. Johnston" writes: > > I've marked this Ready for Committer. > > Hmm ... not sure I like the proposed output. The 'a', 'i', 's' > annotations are short but they don't have much else to recommend them. > On the other hand, there's nearby

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

2023-04-04 Thread Robert Haas
On Tue, Apr 4, 2023 at 12:13 PM Tom Lane wrote: > Hmm ... not sure I like the proposed output. The 'a', 'i', 's' > annotations are short but they don't have much else to recommend them. Yeah, I don't like that, either. I'm not sure what the right thing to do is here. It's a problem to have new

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Tom Lane
Kirk Wolak writes: > Changed status to Ready for Committer. (100% Guessing here...) Basically, I want to reject this on the grounds that it's not useful enough to justify the overhead of marking the "role" GUC as GUC_REPORT. The problems with it not going to work properly with old servers are an

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

2023-04-04 Thread Hayato Kuroda (Fujitsu)
Dear Fujii-san, Tom, Thank you for giving a suggestion! PSA new version. > 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 POL

Re: Minimal logical decoding on standbys

2023-04-04 Thread Drouvot, Bertrand
Hi, On 4/4/23 1:21 PM, Alvaro Herrera wrote: Hi, On 2023-Apr-03, Andres Freund wrote: Hm? That's what the _'s do. We build strings in parts in other places too. No, what _() does is mark each piece for translation separately. But a translation cannot be done on string pieces, and later hav

Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

2023-04-04 Thread Pavel Stehule
út 4. 4. 2023 v 16:20 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > There is reduced patch + regress tests > > One more thing: I do not think it's appropriate to allow this in > GET STACKED DIAGNOSTICS. That's about reporting the place where > an error occurred, not the current locati

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

2023-04-04 Thread Tom Lane
Robert Haas writes: > I'm not sure what the right thing to do is here. It's a problem to > have new information in the catalogs that you can't view via > \d. But displaying that information as a string of > characters that will be gibberish to anyone but an expert doesn't > necessarily seem like i

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Pavel Stehule
út 4. 4. 2023 v 18:42 odesílatel Tom Lane napsal: > Kirk Wolak writes: > > Changed status to Ready for Committer. (100% Guessing here...) > > Basically, I want to reject this on the grounds that it's not > useful enough to justify the overhead of marking the "role" GUC > as GUC_REPORT. The prob

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

2023-04-04 Thread Robert Haas
On Tue, Apr 4, 2023 at 1:12 PM Tom Lane wrote: > I wonder if, while we're here, we should apply the idea of > joining-with-newlines-not-commas to the attributes column too. > That's another source of inconsistency in the proposed display. That would make the column narrower, which might be good,

Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

2023-04-04 Thread Tom Lane
Pavel Stehule writes: > út 4. 4. 2023 v 16:20 odesílatel Tom Lane napsal: >> If we do that, then the confusion you were concerned about upthread >> goes away and we could shorten the keyword back down to "pg_routine_oid", >> which seems like a good thing for our carpal tunnels. > has sense OK,

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

2023-04-04 Thread Tom Lane
Robert Haas writes: > On Tue, Apr 4, 2023 at 1:12 PM Tom Lane wrote: >> I wonder if, while we're here, we should apply the idea of >> joining-with-newlines-not-commas to the attributes column too. > That would make the column narrower, which might be good, because it > seems to me that listing t

Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

2023-04-04 Thread Pavel Stehule
út 4. 4. 2023 v 19:34 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > út 4. 4. 2023 v 16:20 odesílatel Tom Lane napsal: > >> If we do that, then the confusion you were concerned about upthread > >> goes away and we could shorten the keyword back down to > "pg_routine_oid", > >> which se

Re: Minimal logical decoding on standbys

2023-04-04 Thread Andres Freund
Hi, On 2023-04-04 13:21:38 +0200, Alvaro Herrera wrote: > On 2023-Apr-03, Andres Freund wrote: > > > Hm? That's what the _'s do. We build strings in parts in other places too. > > No, what _() does is mark each piece for translation separately. But a > translation cannot be done on string piece

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

2023-04-04 Thread Melanie Plageman
On Mon, Apr 3, 2023 at 8:37 PM David Rowley wrote: > > 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: Thanks for the review! Attached v10 addresses the review feedback below. Remaining TODOs: -

Re: Minimal logical decoding on standbys

2023-04-04 Thread Andres Freund
Hi, On 2023-04-04 18:54:33 +0200, Drouvot, Bertrand wrote: > if (check_on_xid) > { > if (terminating) > appendStringInfo(&err_msg, _("terminating process %d to release > replication slot \"%s\" because it conflicts with recovery"), > pid, >

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Tom Lane
Pavel Stehule writes: > út 4. 4. 2023 v 18:42 odesílatel Tom Lane napsal: >> Basically, I want to reject this on the grounds that it's not >> useful enough to justify the overhead of marking the "role" GUC >> as GUC_REPORT. The problems with it not going to work properly >> with old servers are

Re: Remove dead macro exec_subplan_get_plan

2023-04-04 Thread Gregory Stark (as CFM)
On Fri, 16 Sept 2022 at 03:33, Zhang Mingli wrote: > > On Sep 16, 2022, 14:47 +0800, Richard Guo , wrote: > > How about add it to the CF to not lose track of it? > > Will add it, thanks~ I guess not losing track of it is only helpful if we do eventually commit it. Otherwise we would rather lose t

Re: Minimal logical decoding on standbys

2023-04-04 Thread Jeff Davis
On Tue, 2023-04-04 at 11:42 +0200, Drouvot, Bertrand wrote: > Done in V58 and now this is as simple as: Minor comments on 0004 (address if you agree): * Consider static inline for WalSndWakeupProcessRequests()? * Is the WalSndWakeup() in KeepFileRestoredFromArchive() more like the flush case? Wh

Re: monitoring usage count distribution

2023-04-04 Thread Greg Stark
On Mon, 30 Jan 2023 at 18:31, Nathan Bossart wrote: > > My colleague Jeremy Schneider (CC'd) was recently looking into usage count > distributions for various workloads, and he mentioned that it would be nice > to have an easy way to do $SUBJECT. I've attached a patch that adds a > pg_buffercache

Re: monitoring usage count distribution

2023-04-04 Thread Robert Haas
On Mon, Jan 30, 2023 at 6:30 PM Nathan Bossart wrote: > My colleague Jeremy Schneider (CC'd) was recently looking into usage count > distributions for various workloads, and he mentioned that it would be nice > to have an easy way to do $SUBJECT. I've attached a patch that adds a > pg_buffercache

Re: Commitfest 2023-03 starting tomorrow!

2023-04-04 Thread Greg Stark
On Tue, 4 Apr 2023 at 11:18, Tom Lane wrote: > > > * clean up permission checks after 599b33b94 > > I believe that the actual bug fixes are in, and what's left is just a test > case that people weren't very excited about adding. So maybe this should > get closed out as committed. I'm not super c

Re: monitoring usage count distribution

2023-04-04 Thread Tom Lane
Robert Haas writes: > On Mon, Jan 30, 2023 at 6:30 PM Nathan Bossart > wrote: >> My colleague Jeremy Schneider (CC'd) was recently looking into usage count >> distributions for various workloads, and he mentioned that it would be nice >> to have an easy way to do $SUBJECT. > I'm skeptical that

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Pavel Stehule
út 4. 4. 2023 v 19:55 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > út 4. 4. 2023 v 18:42 odesílatel Tom Lane napsal: > >> Basically, I want to reject this on the grounds that it's not > >> useful enough to justify the overhead of marking the "role" GUC > >> as GUC_REPORT. The proble

fill_seq_fork_with_data() initializes buffer without lock

2023-04-04 Thread Andres Freund
Hi, Look at: static void fill_seq_fork_with_data(Relation rel, HeapTuple tuple, ForkNumber forkNum) { Buffer buf; Pagepage; sequence_magic *sm; OffsetNumber offnum; /* Initialize first page of relation with special magic number */

Re: Minimal logical decoding on standbys

2023-04-04 Thread Robert Haas
On Tue, Apr 4, 2023 at 5:44 AM Drouvot, Bertrand wrote: > Oh right, even better, thanks! > Done in V58 and now this is as simple as: > > + if (DoNotInvalidateSlot(s, xid, &oldestLSN)) > { > /* then, we are not forcing for invalidation */ Tha

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

2023-04-04 Thread David G. Johnston
On Tue, Apr 4, 2023 at 10:37 AM Tom Lane wrote: > Robert Haas writes: > > On Tue, Apr 4, 2023 at 1:12 PM Tom Lane wrote: > >> I wonder if, while we're here, we should apply the idea of > >> joining-with-newlines-not-commas to the attributes column too. > > > That would make the column narrower,

Re: proposal: psql: show current user in prompt

2023-04-04 Thread Pavel Stehule
út 4. 4. 2023 v 20:50 odesílatel Pavel Stehule napsal: > > > út 4. 4. 2023 v 19:55 odesílatel Tom Lane napsal: > >> Pavel Stehule writes: >> > út 4. 4. 2023 v 18:42 odesílatel Tom Lane napsal: >> >> Basically, I want to reject this on the grounds that it's not >> >> useful enough to justify th

Re: Parallel Full Hash Join

2023-04-04 Thread Tom Lane
Thomas Munro writes: > I committed the main patch. This left the following code in hash_inner_and_outer (joinpath.c): /* * If the joinrel is parallel-safe, we may be able to consider a * partial hash join. However, we can't handle JOIN_UNIQUE_OUTER, * because

Re: SQL/JSON revisited

2023-04-04 Thread Nikita Malakhov
Hi hackers! The latest SQL standard contains dot notation for JSON. Are there any plans to include it into Pg 16? Or maybe we should start a separate thread for it? Thanks! On Tue, Apr 4, 2023 at 3:36 PM Alvaro Herrera wrote: > On 2023-Apr-04, Amit Langote wrote: > > > On Tue, Apr 4, 2023 at

Re: SQL/JSON revisited

2023-04-04 Thread Jonathan S. Katz
On 4/4/23 3:40 PM, Nikita Malakhov wrote: Hi hackers! The latest SQL standard contains dot notation for JSON. Are there any plans to include it into Pg 16? Or maybe we should start a separate thread for it? I would recommend starting a new thread to discuss the dot notation. Thanks, Jonath

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

2023-04-04 Thread Brar Piening
On 04.04.2023 at 16:54, Peter Eisentraut wrote: First of all, it works very nicely and is very useful.  Very welcome. Thank you! The XSLT implementation looks sound to me.  It would be a touch better if it had some comments about which parts of the templates were copied from upstream styles

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

2023-04-04 Thread Robert Haas
On Tue, Apr 4, 2023 at 3:02 PM David G. Johnston wrote: > So, by way of example: > > regress_du_role1 | cannot login | regress_du_role0 granted by > regress_du_admin with admin, inherit, set | Description for regress_du_role1 > > ~140 character width with description That seems wider than necess

Re: Should vacuum process config file reload more often

2023-04-04 Thread Melanie Plageman
On Tue, Apr 4, 2023 at 4:27 AM Masahiko Sawada wrote: > The 0001 patch mostly looks good to me except for one > point: > > @@ -391,7 +389,7 @@ heap_vacuum_rel(Relation rel, VacuumParams *params, > Assert(params->index_cleanup != VACOPTVALUE_UNSPECIFIED); > Assert(params->truncate

Re: SQL/JSON revisited

2023-04-04 Thread Andrew Dunstan
On 2023-04-04 Tu 08:36, Alvaro Herrera wrote: Surely this can be made cleaner. By the way -- that comment about clauses being non-standard, can you spot exactly *which* clauses that comment applies to? Sadly, I don't think we're going to be able to make further progress before feature free

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

2023-04-04 Thread Pavel Luzanov
On 03.04.2023 23:50, Melanie Plageman wrote: Attached is a tiny patch to add standalone backend type to pg_stat_activity documentation (referenced by pg_stat_io). I mentioned both the bootstrap process and single user mode process in the docs, though I can't imagine that the bootstrap process is

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

2023-04-04 Thread Pavel Luzanov
On 04.04.2023 23:00, Robert Haas wrote: On Tue, Apr 4, 2023 at 3:02 PM David G. Johnston wrote: So, by way of example: regress_du_role1 | cannot login | regress_du_role0 granted by regress_du_admin with admin, inherit, set | Description for regress_du_role1 That seems wider than necessary.

Re: ICU locale validation / canonicalization

2023-04-04 Thread Thomas Munro
MSVC now says this on master: [17:48:12.446] c:\cirrus\src\backend\utils\adt\pg_locale.c(2912) : warning C4715: 'icu_language_tag': not all control paths return a value CI doesn't currently fail for MSVC warnings, so it's a bit hidden. FWIW cfbot does show this with a ⚠ sign with its new system f

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

2023-04-04 Thread Karl O. Pinc
On Tue, 4 Apr 2023 21:52:31 +0200 Brar Piening wrote: > On 04.04.2023 at 16:54, Peter Eisentraut wrote: > > The XSLT implementation looks sound to me.  It would be a touch > > better if it had some comments about which parts of the templates > > were copied from upstream stylesheets and which we

Re: [BUG] pg_stat_statements and extended query protocol

2023-04-04 Thread Imseih (AWS), Sami
> I was looking back at this thread, and the suggestion to use one field > in EState sounds fine to me. Sami, would you like to send a new > version of the patch (simplified version based on v1)? Here is v4. The "calls" tracking is removed from Estate. Unlike v1 however, I added a check for the o

Re: Parallel Full Hash Join

2023-04-04 Thread Thomas Munro
On Wed, Apr 5, 2023 at 7:37 AM Tom Lane wrote: > The comment is no longer in sync with the code: this if-test used to > reject JOIN_FULL and JOIN_RIGHT, and no longer does so, but the comment > still claims it should. Shouldn't we drop the sentence beginning > "Similarly"? (I see that there's no

Re: Check whether binaries can be released for s390x

2023-04-04 Thread Thomas Munro
On Wed, Apr 5, 2023 at 3:03 AM Robert Haas wrote: > On Tue, Apr 4, 2023 at 9:30 AM Namrata Bhave wrote: > > Thank you for getting back. > > > > The request is mainly for the developer community to build and publish > > s390x binaries, apologies if I wasn't clear earlier. > > We can provide s390x

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

2023-04-04 Thread Michael Paquier
On Tue, Apr 04, 2023 at 09:04:34PM +0900, Michael Paquier wrote: > This addition looks OK for me. Thanks for the patch! Okay, finally done. One part that was still not complete to me in light of the information ddfc2d9 has removed is that the number of physical reads could be lower than the repo

Re: monitoring usage count distribution

2023-04-04 Thread Melanie Plageman
On Tue, Apr 4, 2023 at 2:40 PM Tom Lane wrote: > > Robert Haas writes: > > On Mon, Jan 30, 2023 at 6:30 PM Nathan Bossart > > wrote: > >> My colleague Jeremy Schneider (CC'd) was recently looking into usage count > >> distributions for various workloads, and he mentioned that it would be nice >

Re: psql \watch 2nd argument: iteration count

2023-04-04 Thread Kirk Wolak
On Fri, Mar 24, 2023 at 10:32 PM Andrey Borodin wrote: > On Thu, Mar 23, 2023 at 10:15 PM Yugo NAGATA wrote: > > > > Here is my review on the v9 patch. > > > > + /* we do not prevent numerous names iterations like > i=1 i=1 i=1 */ > > + have_sleep = true; > >

Re: fill_seq_fork_with_data() initializes buffer without lock

2023-04-04 Thread Andres Freund
Hi, On 2023-04-04 11:55:01 -0700, Andres Freund wrote: > Look at: > > static void > fill_seq_fork_with_data(Relation rel, HeapTuple tuple, ForkNumber forkNum) > { > Buffer buf; > Pagepage; > sequence_magic *sm; > OffsetNumber offnum; > > /* Initia

Re: monitoring usage count distribution

2023-04-04 Thread Andres Freund
Hi, On 2023-04-04 14:14:36 -0400, Greg Stark wrote: > Tom expressed skepticism that there's wide interest here. It seems as > much from the lack of response. But perhaps that's just because people > don't understand what the importance of this info is -- I certainly > don't :) pg_buffercache has

Re: monitoring usage count distribution

2023-04-04 Thread Andres Freund
Hi, On 2023-04-04 14:31:36 -0400, Robert Haas wrote: > On Mon, Jan 30, 2023 at 6:30 PM Nathan Bossart > wrote: > > My colleague Jeremy Schneider (CC'd) was recently looking into usage count > > distributions for various workloads, and he mentioned that it would be nice > > to have an easy way to

CREATE SUBSCRIPTION -- add missing tab-completes

2023-04-04 Thread Peter Smith
There are some recent comment that added new options for CREATE SUBSCRIPTION "Add new predefined role pg_create_subscription." [1] This added a new "password_required" option. "Add a run_as_owner option to subscriptions." [2] This added a "run_as_owner" option. ~~ AFAICT the associated tab-comp

Comment typo in recent push

2023-04-04 Thread Peter Smith
There seems to be a comment typo in the recent commit "Perform logical replication actions as the table owner" [1]. /* * Switch back to the original user ID. * * If we created a new GUC nest level, also role back any changes that were * made within it. */ /role back/rollback/ ~~ PSA a tin

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

2023-04-04 Thread Andres Freund
Hi, On 2023-03-30 12:28:57 +0700, John Naylor wrote: > On Thu, Mar 30, 2023 at 10:02 AM Andres Freund wrote: > > Attached is v6. Changes: > > 0006: > > +ereport(ERROR, > +errcode_for_file_access(), > +errmsg("could not extend file \"%s\" with posix_fallocate(): >

Re: Minimal logical decoding on standbys

2023-04-04 Thread Jeff Davis
On Tue, 2023-04-04 at 14:55 -0400, Robert Haas wrote: > Thanks for your continued work on $SUBJECT. I just took a look at > 0004, and I think that at the very least the commit message needs > work. Nobody who is not a hacker is going to understand what problem > this is fixing, because it makes ref

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

2023-04-04 Thread Melanie Plageman
On Tue, Apr 4, 2023 at 4:35 PM Pavel Luzanov wrote: > > On 03.04.2023 23:50, Melanie Plageman wrote: > > Attached is a tiny patch to add standalone backend type to > > pg_stat_activity documentation (referenced by pg_stat_io). > > > > I mentioned both the bootstrap process and single user mode pro

Re: Minimal logical decoding on standbys

2023-04-04 Thread Andres Freund
Hi, On 2023-04-04 17:33:25 -0700, Jeff Davis wrote: > On Tue, 2023-04-04 at 14:55 -0400, Robert Haas wrote: > > That's presumably OK, in the > > sense that they'll go back to sleep and eventually wake up again, but > > it means they might end up chronically behind sending out WAL to > > cascading

Re: [PATCH] Add function to_oct

2023-04-04 Thread Kirk Wolak
On Thu, Feb 23, 2023 at 6:32 AM Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 20.12.22 23:08, Eric Radman wrote: > > This patch is a new function based on the implementation of to_hex(int). > > > > Since support for octal integer literals was added, to_oct(int) allows > > octal

  1   2   >