Re: Suspicious redundant assignment in COPY FROM

2023-09-07 Thread Jingtang Zhang
Michael Paquier 于2023年9月8日周五 13:42写道: Thanks, Michael~ > The assignment of num_phys_attrs could be kept at the same place as > on HEAD, a bit closer to the palloc0() where it is used. > Agreed with this principle. Patch is modified and attached. -- Jingtang

Re: Suspicious redundant assignment in COPY FROM

2023-09-07 Thread Michael Paquier
On Fri, Sep 08, 2023 at 12:23:17PM +0800, Jingtang Zhang wrote: > Hi all, I was reading code of COPY FROM and I found some suspicious > redundant assignment for tuple descriptor and number of attributes. Is > it a behavior on purpose, or an accidently involved by the refactor in > c532d15? Patch

Re: Eager page freeze criteria clarification

2023-09-07 Thread Andres Freund
Hi, On 2023-09-07 21:45:22 -0700, Andres Freund wrote: > In contrast to that, freezing will almost always trigger an FPI (except for > empty pages, but we imo ought to stop setting empty pages all frozen [1]). > > > Yep, a quick experiment confirms that: > > DROP TABLE IF EXISTS foo; > CREATE

Re: Eager page freeze criteria clarification

2023-09-07 Thread Peter Geoghegan
On Thu, Sep 7, 2023 at 9:45 PM Andres Freund wrote: > I.e. setting an, otherwise unmodified, page all-visible won't trigger an FPI > if checksums are disabled, but will FPI with checksums enabled. I think that's > a substantial difference in WAL volume for insert-only workloads... Note that all

Re: Eager page freeze criteria clarification

2023-09-07 Thread Andres Freund
Hi, On 2023-09-06 16:21:31 -0400, Robert Haas wrote: > On Wed, Sep 6, 2023 at 12:20 PM Peter Geoghegan wrote: > > If VACUUM freezes too aggressively, then (pretty much by definition) > > we can be sure that the next VACUUM will scan the same pages -- there > > may be some scope for VACUUM to

Re: Correct the documentation for work_mem

2023-09-07 Thread David Rowley
On Fri, 8 Sept 2023 at 15:24, Bruce Momjian wrote: > Adjusted patch attached. This looks mostly fine to me modulo "sort or hash". I do see many instances of "and/or" in the docs. Maybe that would work better. David

Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Thomas Munro
On Fri, Sep 8, 2023 at 4:22 PM Peter Geoghegan wrote: > This looks right to me. Thanks, pushed.

Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

2023-09-07 Thread Kyotaro Horiguchi
At Fri, 08 Sep 2023 14:17:16 +0900 (JST), Kyotaro Horiguchi wrote in > Ditching cmd.exe seems like a big hassle. So, on the flip side, I > tried to identify the postmaster PID using the shell's PID, and it > seem to work. The APIs used are avaiable from XP/2003 onwards. Cleaned it up a bit.

Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

2023-09-07 Thread Kyotaro Horiguchi
At Thu, 7 Sep 2023 10:53:41 +, "Hayato Kuroda (Fujitsu)" wrote in > My first idea is that to move the checking part to above, but this may not > handle > the case the postmaster is still alive (now sure this is real issue). Do we > have to > add a new indicator which ensures the identity

Re: Optimize planner memory consumption for huge arrays

2023-09-07 Thread Lepikhov Andrei
On Wed, Sep 6, 2023, at 8:09 PM, Ashutosh Bapat wrote: > Hi Lepikhov, > > Thanks for using my patch and I am glad that you found it useful. > > On Mon, Sep 4, 2023 at 10:56 AM Lepikhov Andrei > wrote: >> >> Hi, hackers, >> >> Looking at the planner behaviour with the memory consumption patch

Re: Eager page freeze criteria clarification

2023-09-07 Thread Andres Freund
Hi, On 2023-09-06 10:46:03 -0400, Robert Haas wrote: > On Fri, Sep 1, 2023 at 9:07 PM Peter Geoghegan wrote: > > Why not also avoid setting pages all-visible? The WAL records aren't > > too much smaller than most freeze records these days -- 64 bytes on > > most systems. I realize that the rules

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Michael Paquier
On Fri, Sep 08, 2023 at 09:14:59AM +0530, Amit Kapila wrote: > On Fri, Sep 8, 2023 at 9:00 AM Zhijie Hou (Fujitsu) > wrote: >>> I >>> mean that doing the latter is benefitial for the sake of any patch >>> committed and >>> as a long-term method to rely on. > > What is your worry here? Are you

Re: persist logical slots to disk during shutdown checkpoint

2023-09-07 Thread Michael Paquier
On Fri, Sep 08, 2023 at 09:04:43AM +0530, Amit Kapila wrote: > I have added something on these lines and also changed the other > comment pointed out by you. In the passing, I made minor cosmetic > changes as well. + * We can flush dirty replication slots at regular intervals by any + *

Suspicious redundant assignment in COPY FROM

2023-09-07 Thread Jingtang Zhang
Hi all, I was reading code of COPY FROM and I found some suspicious redundant assignment for tuple descriptor and number of attributes. Is it a behavior on purpose, or an accidently involved by the refactor in c532d15? Patch is attached. 0001-Remove-redundant-assignment-in-copyfrom.patch

Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Peter Geoghegan
On Thu, Sep 7, 2023 at 8:49 PM Thomas Munro wrote: > The code moved around quite a few times over several commits and quite > a lot since then, which is why I didn't go for straight revert, but > clearly the manual approach risked missing things. It's not a big deal, obviously. > I think the >

Re: Document that server will start even if it's unable to open some TCP/IP ports

2023-09-07 Thread Nathan Bossart
On Thu, Sep 07, 2023 at 07:13:44PM -0400, Bruce Momjian wrote: > On Thu, Sep 7, 2023 at 02:54:13PM -0700, Nathan Bossart wrote: >> IMO the phrase "open a port" is kind of nonstandard. I think we should say >> something along the lines of >> >> If listen_addresses is not empty, the server

Re: Eager page freeze criteria clarification

2023-09-07 Thread Andres Freund
Hi, On 2023-09-06 10:35:17 -0400, Robert Haas wrote: > On Wed, Sep 6, 2023 at 1:09 AM Andres Freund wrote: > > Yea, it'd be useful to have a reasonably approximate wall clock time for the > > last modification of a page. We just don't have infrastructure for > > determining > > that. We'd need

Re: Row pattern recognition

2023-09-07 Thread Tatsuo Ishii
Hi, > Hello! > >> (1) I completely changed the pattern matching engine so that it >> performs backtracking. Now the engine evaluates all pattern elements >> defined in PATTER against each row, saving matched pattern variables >> in a string per row. For example if the pattern element A and B >>

Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Thomas Munro
On Fri, Sep 8, 2023 at 2:00 PM Thomas Munro wrote: > On Fri, Sep 8, 2023 at 1:53 PM Peter Geoghegan wrote: > > Thanks for working on this. Though I wonder why you didn't do > > something closer to a straight revert of the feature. Why is nbtree > > still passing around snapshots needlessly? The

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Amit Kapila
On Fri, Sep 8, 2023 at 9:00 AM Zhijie Hou (Fujitsu) wrote: > > On Friday, September 8, 2023 10:58 AM Michael Paquier > wrote: > > > > On Fri, Sep 08, 2023 at 08:18:14AM +0530, Amit Kapila wrote: > > > This validation tries to ensure that we don't have any bugs/issues in > > > our patch. It may

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Michael Paquier
On Fri, Sep 08, 2023 at 03:30:23AM +, Zhijie Hou (Fujitsu) wrote: > I feel adding a check at pg_upgrade may not 100% detect the slot invalidation > if we check by querying the old cluster to get the slot info, because the > invalidation can happen before the first time we fetch the info or

Re: persist logical slots to disk during shutdown checkpoint

2023-09-07 Thread Amit Kapila
On Thu, Sep 7, 2023 at 3:38 PM Ashutosh Bapat wrote: > > On Thu, Sep 7, 2023 at 1:43 PM Amit Kapila wrote: > > > > On Thu, Sep 7, 2023 at 1:18 PM Michael Paquier wrote: > > > > > > On Thu, Sep 07, 2023 at 11:56:28AM +0530, Amit Kapila wrote: > > > > Thanks, the patch looks good to me as well. >

RE: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Zhijie Hou (Fujitsu)
On Friday, September 8, 2023 10:58 AM Michael Paquier wrote: > > On Fri, Sep 08, 2023 at 08:18:14AM +0530, Amit Kapila wrote: > > This validation tries to ensure that we don't have any bugs/issues in > > our patch. It may be a candidate for assert but I feel even if we > > encounter any bug it

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Michael Paquier
On Fri, Sep 08, 2023 at 08:18:14AM +0530, Amit Kapila wrote: > This validation tries to ensure that we don't have any bugs/issues in > our patch. It may be a candidate for assert but I feel even if we > encounter any bug it is better to fix the bug. My guess is that an elog-like error is more

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Amit Kapila
On Fri, Sep 8, 2023 at 5:37 AM Michael Paquier wrote: > > On Thu, Sep 07, 2023 at 03:33:52PM +0530, Amit Kapila wrote: > > I think if we just make max_slot_wal_keep_size to -1 that should be > > sufficient to not let any slots get invalidated during upgrade. Do you > > have anything else in mind?

Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Thomas Munro
On Fri, Sep 8, 2023 at 1:53 PM Peter Geoghegan wrote: > On Tue, Sep 5, 2023 at 12:58 AM Thomas Munro wrote: > > I hope we get "snapshot too old" back one day. > > Thanks for working on this. Though I wonder why you didn't do > something closer to a straight revert of the feature. Why is nbtree >

Re: old_snapshot_threshold bottleneck on replica

2023-09-07 Thread Peter Geoghegan
On Tue, Sep 5, 2023 at 12:58 AM Thomas Munro wrote: > I hope we get "snapshot too old" back one day. Thanks for working on this. Though I wonder why you didn't do something closer to a straight revert of the feature. Why is nbtree still passing around snapshots needlessly? Also, why are there

Re: SQL:2011 application time

2023-09-07 Thread jian he
On Sat, Sep 2, 2023 at 5:58 AM Paul Jungwirth wrote: > > > I don't quite understand this part: > > >> Also, your implementation > >> requires at least one non-overlaps column, which also seems like a > >> confusing restriction. > > That's just a regular non-temporal constraint. Right? If I'm

Re: Simple CustomScan example

2023-09-07 Thread Michael Paquier
On Thu, Sep 07, 2023 at 06:29:27PM +0200, Drouvot, Bertrand wrote: > You may find the one in this repo: > https://github.com/bdrouvot/pg_directpaths simple enough. I'll repeat a remark I have made exactly yesterday on a different thread: having a test module for custom scans in src/test/modules/

Re: [BackendXidGetPid] only access allProcs when xid matches

2023-09-07 Thread Michael Paquier
On Thu, Sep 07, 2023 at 04:34:20PM +0530, Ashutosh Bapat wrote: > I would still love to see some numbers. It's not that hard. Either > using my micro benchmark or Michael's. We may or may not see an > improvement. But at least we tried. But Michael feels otherwise, > changing it to RoC is fine. I

Re: psql help message contains excessive indentations

2023-09-07 Thread Kyotaro Horiguchi
At Thu, 7 Sep 2023 13:06:35 +0200, Alvaro Herrera wrote in > On 2023-Sep-07, Yugo NAGATA wrote: > > + HELP0(" \\watch [[i=]SEC] [c=N] [m=MIN]\n" > > + " execute query every SEC seconds, up > > to N times\n" > > + " stop

Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?

2023-09-07 Thread Thomas Munro
On Fri, Sep 8, 2023 at 11:48 AM Michael Paquier wrote: > On Thu, Sep 07, 2023 at 01:44:11PM +0200, Daniel Gustafsson wrote: > > Sadly I wouldn't be the least bit surprised if there are 1.0.2 users on > > modern > > operating systems, especially given its LTS status (which OpenSSL hasn't > >

Re: Correct the documentation for work_mem

2023-09-07 Thread Bruce Momjian
On Fri, Apr 21, 2023 at 01:15:01PM -0400, Tom Lane wrote: > Peter Eisentraut writes: > > On 21.04.23 16:28, Imseih (AWS), Sami wrote: > >> I suggest a small doc fix: > >> “Note that for a complex query, several sort or hash operations might be > >> running simultaneously;” > > > Here is a

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Michael Paquier
On Thu, Sep 07, 2023 at 03:33:52PM +0530, Amit Kapila wrote: > I think if we just make max_slot_wal_keep_size to -1 that should be > sufficient to not let any slots get invalidated during upgrade. Do you > have anything else in mind? Forcing wal_keep_size while on it may be a good thing. > If we

Re: Row pattern recognition

2023-09-07 Thread Jacob Champion
Hello! > (1) I completely changed the pattern matching engine so that it > performs backtracking. Now the engine evaluates all pattern elements > defined in PATTER against each row, saving matched pattern variables > in a string per row. For example if the pattern element A and B > evaluated to

Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?

2023-09-07 Thread Michael Paquier
On Thu, Sep 07, 2023 at 01:44:11PM +0200, Daniel Gustafsson wrote: > Sadly I wouldn't be the least bit surprised if there are 1.0.2 users on modern > operating systems, especially given its LTS status (which OpenSSL hasn't even > capped but sells by "for as long as it remains commercially viable

Re: Document that server will start even if it's unable to open some TCP/IP ports

2023-09-07 Thread Bruce Momjian
On Thu, Sep 7, 2023 at 02:54:13PM -0700, Nathan Bossart wrote: > Thanks for picking this up. > > On Thu, Sep 07, 2023 at 03:33:57PM -0400, Bruce Momjian wrote: > > The default value is > class="systemname">localhost, > > which allows only local TCP/IP loopback > >

Re: Add 'worker_type' to pg_stat_subscription

2023-09-07 Thread Nathan Bossart
On Thu, Sep 07, 2023 at 12:36:29PM +1200, Peter Smith wrote: > Modified as suggested. PSA v3. Thanks. I've attached v4 with a couple of small changes. Notably, I've moved the worker_type column to before the pid column, as it felt more natural to me to keep the PID columns together. I've also

Re: Eliminate redundant tuple visibility check in vacuum

2023-09-07 Thread Melanie Plageman
On Thu, Sep 7, 2023 at 3:30 PM Robert Haas wrote: > > On Thu, Sep 7, 2023 at 3:10 PM Melanie Plageman > wrote: > > I can fix it by changing the type of PruneResult->off_loc to be an > > OffsetNumber pointer. This does mean that PruneResult will be > > initialized partially by heap_page_prune()

Re: Possibility to disable `ALTER SYSTEM`

2023-09-07 Thread Joe Conway
On 9/7/23 15:51, Gabriele Bartolini wrote: I would like to propose a patch that allows administrators to disable `ALTER SYSTEM` via either a runt-time option to pass to the Postgres server process at startup (e.g. `--disable-alter-system=true`, false by default) or a new GUC (or even both),

Re: Document that server will start even if it's unable to open some TCP/IP ports

2023-09-07 Thread Nathan Bossart
Thanks for picking this up. On Thu, Sep 07, 2023 at 03:33:57PM -0400, Bruce Momjian wrote: > The default value is class="systemname">localhost, > which allows only local TCP/IP loopback connections > to be > - made. While client authentication ( + made. If

Re: Possibility to disable `ALTER SYSTEM`

2023-09-07 Thread Tom Lane
Gabriele Bartolini writes: > I would like to propose a patch that allows administrators to disable > `ALTER SYSTEM` via either a runt-time option to pass to the Postgres server > process at startup (e.g. `--disable-alter-system=true`, false by default) > or a new GUC (or even both), without

Re: Possibility to disable `ALTER SYSTEM`

2023-09-07 Thread Gabriele Bartolini
Hi Joe, On Thu, 7 Sept 2023 at 21:57, Joe Conway wrote: > Without trying to debate the particulars, a huge +1 for the concept of > allowing ALTER SYSTEM to be disabled. FWIW I would vote the same for > control over COPY PROGRAM. > Oh ... another one of my favourite security friendly features!

Possibility to disable `ALTER SYSTEM`

2023-09-07 Thread Gabriele Bartolini
Hi everyone, I would like to propose a patch that allows administrators to disable `ALTER SYSTEM` via either a runt-time option to pass to the Postgres server process at startup (e.g. `--disable-alter-system=true`, false by default) or a new GUC (or even both), without changing the current

Re: Document that server will start even if it's unable to open some TCP/IP ports

2023-09-07 Thread Bruce Momjian
On Mon, Jun 12, 2023 at 11:57:45PM -0700, Gurjeet Singh wrote: > On Mon, Jun 12, 2023 at 10:59 PM Nathan Bossart > wrote: > > On Sat, May 27, 2023 at 03:17:21PM -0700, Gurjeet Singh wrote: > > > If listen_addresses is empty, then server won't try to open any TCP/IP > > > ports. The patch does not

Re: Eliminate redundant tuple visibility check in vacuum

2023-09-07 Thread Robert Haas
On Thu, Sep 7, 2023 at 3:10 PM Melanie Plageman wrote: > I can fix it by changing the type of PruneResult->off_loc to be an > OffsetNumber pointer. This does mean that PruneResult will be > initialized partially by heap_page_prune() callers. I wonder if you > think that undermines the case for

Re: Should consider materializing the cheapest inner path in consider_parallel_nestloop()

2023-09-07 Thread Robert Haas
On Tue, Sep 5, 2023 at 8:07 AM Richard Guo wrote: > Yeah, this seems an omission in commit 45be99f8. It's been a while, but I think I omitted this deliberately because I didn't really understand the value of it and wanted to keep the planning cost down. The example query provided here seems

Re: Eliminate redundant tuple visibility check in vacuum

2023-09-07 Thread Melanie Plageman
On Thu, Sep 7, 2023 at 1:37 PM Robert Haas wrote: > > On Wed, Sep 6, 2023 at 5:21 PM Melanie Plageman > wrote: > > Yeah, I think this is a fair concern. I have addressed it in the > > attached patches. > > > > I thought a lot about whether or not adding a PruneResult which > > contains only the

Re: GUC for temporarily disabling event triggers

2023-09-07 Thread Robert Haas
On Thu, Sep 7, 2023 at 1:57 AM Michael Paquier wrote: > + GUC_NOT_IN_SAMPLE | GUC_DISALLOW_IN_FILE > > I am a bit surprised by these two additions. Setting this GUC at > file-level can be useful, as is documenting it in the control file if > it provides some control of how a statement

Re: A minor adjustment to get_cheapest_path_for_pathkeys

2023-09-07 Thread Robert Haas
On Thu, Sep 7, 2023 at 5:32 AM Aleksander Alekseev wrote: > v2 LGTM. Committed. -- Robert Haas EDB: http://www.enterprisedb.com

Re: MergeJoin beats HashJoin in the case of multiple hash clauses

2023-09-07 Thread Bruce Momjian
Does anyone else have an opinion on this patch? It looks promising. --- On Wed, Jun 28, 2023 at 04:53:06PM +0300, Alena Rybakina wrote: > Hi! > > On 15.06.2023 11:30, Andrey Lepikhov wrote: > > Hi, all. > >

Re: pg_upgrade instructions involving "rsync --size-only" might lead to standby corruption?

2023-09-07 Thread Bruce Momjian
On Mon, Jul 10, 2023 at 02:37:24PM -0700, Nikolay Samokhvalov wrote: > Maybe. It will require changes in other parts of this doc. > Thinking (here:  > https://gitlab.com/postgres/postgres/-/merge_requests/18/diffs) > > Meanwhile, attached is v2 > > thanks for the comments I looked over this

Re: Wrong command name in writeable-CTE related error messages

2023-09-07 Thread Markus Winand
> On 23.05.2023, at 19:40, Tom Lane wrote: > > Markus Winand writes: >> I noticed that errors due to writable CTEs in read-only or non-volatile >> context say the offensive command is SELECT. > > Good point. > >> My first thought was that these error messages should mention INSERT, but >>

Re: Eliminate redundant tuple visibility check in vacuum

2023-09-07 Thread Robert Haas
On Wed, Sep 6, 2023 at 5:21 PM Melanie Plageman wrote: > Yeah, I think this is a fair concern. I have addressed it in the > attached patches. > > I thought a lot about whether or not adding a PruneResult which > contains only the output parameters and result of heap_page_prune() is > annoying

Re: [PATCH] pgrowlocks: Make mode names consistent with docs

2023-09-07 Thread Bruce Momjian
On Fri, Jun 30, 2023 at 10:45:57AM -0500, David Cook wrote: > I noticed that pgrowlocks will use different names for shared locks depending > on whether the locks are intermediated by a multixact or not. Particularly, if > a single transaction has locked a row, it may return "For Key Share" or

Re: Simple CustomScan example

2023-09-07 Thread Drouvot, Bertrand
Hi, On 9/6/23 9:32 PM, Chris Cleveland wrote: I'm trying to write a custom scan. It's pretty confusing. I've read the documentation at https://www.postgresql.org/docs/current/custom-scan.html , and I've scanned the code in Citus

Build the docs if there are changes in docs and don't run other tasks if the changes are only in docs

2023-09-07 Thread Nazir Bilal Yavuz
Hi, There is an old work item about building the docs if there are changes in the docs, otherwise don't build the docs. I wanted to make an addition to that idea; if the changes are only in the docs, don't run all tasks except building the docs task; this could help to save more CI times. I

Re: Fix bogus Asserts in calc_non_nestloop_required_outer

2023-09-07 Thread Aleksander Alekseev
Hi Richard, > As stated in [1], all paths arriving here are parameterized by top > parents, so we should check against top_parent_relids if it exists in > the two Asserts. > > Attached is a patch fixing that. Probably it's just because of my limited experience with the optimizer but I don't find

Re: Output affected rows in EXPLAIN

2023-09-07 Thread Damir Belyalov
> This creates a bug, not fixes one. It's intentional that "insert into a" > is shown as returning zero rows, because that's what it did. If you'd > written "insert ... returning", you'd have gotten a different result: > Maybe I didn't understand you correctly, but I didn't touch the number of

Re: Subscription statistics are not dropped at DROP SUBSCRIPTION in some cases

2023-09-07 Thread Masahiko Sawada
On Tue, Sep 5, 2023 at 11:32 AM Zhijie Hou (Fujitsu) wrote: > > On Monday, September 4, 2023 10:42 PM Masahiko Sawada > wrote: > > Hi, > > > On Mon, Sep 4, 2023 at 9:38 PM Zhijie Hou (Fujitsu) > > wrote: > > > > > > On Wednesday, July 5, 2023 2:53 PM Masahiko Sawada > > wrote: > > > > > > >

Re: persist logical slots to disk during shutdown checkpoint

2023-09-07 Thread Amit Kapila
On Thu, Sep 7, 2023 at 4:30 PM Ashutosh Bapat wrote: > > On Thu, Sep 7, 2023 at 4:11 PM Amit Kapila wrote: > > > > On Thu, Sep 7, 2023 at 3:38 PM Ashutosh Bapat > > wrote: > > > > > > * This needn't actually be part of a checkpoint, but it's a convenient > > > - * location. > > > + *

Re: psql help message contains excessive indentations

2023-09-07 Thread Yugo NAGATA
On Thu, 7 Sep 2023 13:06:35 +0200 Alvaro Herrera wrote: > On 2023-Sep-07, Yugo NAGATA wrote: > > > Yes. So, I mean how about fixing \watch description as the attached patch. > > > diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c > > index 38c165a627..12280c0e54 100644 > > ---

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-07 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thank you for reviewing! PSA new version. > == > src/bin/pg_upgrade/check.c > > 1. check_new_cluster_logical_replication_slots > > + res = executeQueryOrDie(conn, "SHOW max_replication_slots;"); > + max_replication_slots = atoi(PQgetvalue(res, 0, 0)); > + > + if (PQntuples(res)

Re: add (void) cast inside advance_aggregates for function ExecEvalExprSwitchContext

2023-09-07 Thread Daniel Gustafsson
> On 3 Sep 2023, at 05:16, jian he wrote: > In src/backend/executor/nodeAgg.c > 817: advance_aggregates(AggState *aggstate) > > Do we need to add "(void)" before ExecEvalExprSwitchContext? I don't think we need to, but we could since we are in fact discardnig the return value. Did you get a

Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?

2023-09-07 Thread Daniel Gustafsson
> On 7 Sep 2023, at 13:30, Thomas Munro wrote: > I don't like the idea that our *next* release's library version > horizon is controlled by Red Hat's "ELS" phase. Agreed. If we instead fence it by "only non-EOL version" then 1.1.1 is also on the chopping block for v17 as it goes EOL in 4 days

Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?

2023-09-07 Thread Thomas Munro
On Wed, May 24, 2023 at 11:03 PM Daniel Gustafsson wrote: > > On 24 May 2023, at 11:52, Michael Paquier wrote: > > On Wed, May 24, 2023 at 11:36:56AM +0200, Daniel Gustafsson wrote: > >> 1.0.2 is also an LTS version available commercially for premium support > >> customers of OpenSSL (1.1.1 will

Re: Add resource intensiveness as a reason to not running tests by default

2023-09-07 Thread Daniel Gustafsson
> On 7 Sep 2023, at 13:09, Nazir Bilal Yavuz wrote: > With f47ed79cc8, the test suite doesn't run 'wal_consistency_checking' > as default because it is resource intensive; but regress docs doesn't > state resource intensiveness as a reason for not running tests by > default. So, I created a

Add resource intensiveness as a reason to not running tests by default

2023-09-07 Thread Nazir Bilal Yavuz
Hi, With f47ed79cc8, the test suite doesn't run 'wal_consistency_checking' as default because it is resource intensive; but regress docs doesn't state resource intensiveness as a reason for not running tests by default. So, I created a patch for updating the docs. Any kind of feedback would be

Re: psql help message contains excessive indentations

2023-09-07 Thread Alvaro Herrera
On 2023-Sep-07, Yugo NAGATA wrote: > Yes. So, I mean how about fixing \watch description as the attached patch. > diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c > index 38c165a627..12280c0e54 100644 > --- a/src/bin/psql/help.c > +++ b/src/bin/psql/help.c > @@ -200,9 +200,9 @@

Re: [BackendXidGetPid] only access allProcs when xid matches

2023-09-07 Thread Ashutosh Bapat
On Thu, Sep 7, 2023 at 3:05 PM Junwang Zhao wrote: > > On Thu, Sep 7, 2023 at 5:07 PM Ashutosh Bapat > wrote: > > > > Forgot to attach the patch. > > LGTM > > Should I change the status to ready for committer now? > I would still love to see some numbers. It's not that hard. Either using my

Re: missing privilege check after not-null constraint rework

2023-09-07 Thread Alvaro Herrera
On 2023-Sep-05, Alvaro Herrera wrote: > On 2023-Sep-05, Alvaro Herrera wrote: > > > Here's a fix to move the privilege check on constraint dropping from > > ATExecDropConstraint to dropconstraint_internal. I have pushed this. It's just a fixup for an embarrasing bug in b0e96f311985. --

Re: persist logical slots to disk during shutdown checkpoint

2023-09-07 Thread Ashutosh Bapat
On Thu, Sep 7, 2023 at 4:11 PM Amit Kapila wrote: > > On Thu, Sep 7, 2023 at 3:38 PM Ashutosh Bapat > wrote: > > > > * This needn't actually be part of a checkpoint, but it's a convenient > > - * location. > > + * location. is_shutdown is true in case of a shutdown checkpoint. > > > > Relying

RE: pg_ctl start may return 0 even if the postmaster has been already started on Windows

2023-09-07 Thread Hayato Kuroda (Fujitsu)
Dear Michael, Thank you for replying! > Not failing on `pg_ctl start` if the command is run on a data folder > that has already been started previously by a different command with a > postmaster still alive feels like cheating, because pg_ctl is lying > about its result. If pg_ctl wants to

Re: persist logical slots to disk during shutdown checkpoint

2023-09-07 Thread Amit Kapila
On Thu, Sep 7, 2023 at 3:38 PM Ashutosh Bapat wrote: > > * This needn't actually be part of a checkpoint, but it's a convenient > - * location. > + * location. is_shutdown is true in case of a shutdown checkpoint. > > Relying on the first sentence, if we decide to not persist the > replication

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Dilip Kumar
On Thu, Sep 7, 2023 at 3:34 PM Amit Kapila wrote: > > On Thu, Sep 7, 2023 at 12:55 PM Michael Paquier wrote: > > > > (Just dumping what I have in mind while reading the thread.) > > > > On Sat, Sep 02, 2023 at 10:08:51AM +0530, Amit Kapila wrote: > > > During pg_upgrade, we start the server for

Re: persist logical slots to disk during shutdown checkpoint

2023-09-07 Thread Ashutosh Bapat
On Thu, Sep 7, 2023 at 1:43 PM Amit Kapila wrote: > > On Thu, Sep 7, 2023 at 1:18 PM Michael Paquier wrote: > > > > On Thu, Sep 07, 2023 at 11:56:28AM +0530, Amit Kapila wrote: > > > Thanks, the patch looks good to me as well. > > > > + /* This is used to track the last saved confirmed_flush

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Amit Kapila
On Thu, Sep 7, 2023 at 12:55 PM Michael Paquier wrote: > > (Just dumping what I have in mind while reading the thread.) > > On Sat, Sep 02, 2023 at 10:08:51AM +0530, Amit Kapila wrote: > > During pg_upgrade, we start the server for the old cluster which can > > allow the checkpointer to remove

Re: Should consider materializing the cheapest inner path in consider_parallel_nestloop()

2023-09-07 Thread tender wang
Richard Guo 于2023年9月5日周二 18:51写道: > > On Tue, Sep 5, 2023 at 4:52 PM tender wang wrote: > >>I recently run benchmark[1] on master, but I found performance problem >> as below: >> ... >> >> I debug the code and find consider_parallel_nestloop() doesn't consider >> materialized form of the

Re: information_schema and not-null constraints

2023-09-07 Thread Alvaro Herrera
On 2023-Sep-06, Alvaro Herrera wrote: > On 2023-Sep-04, Alvaro Herrera wrote: > > > In reference to [1], 0001 attached to this email contains the updated > > view definitions that I propose. > > Given the downthread discussion, I propose the attached. There are no > changes to v2, other than

Re: [BackendXidGetPid] only access allProcs when xid matches

2023-09-07 Thread Junwang Zhao
On Thu, Sep 7, 2023 at 5:07 PM Ashutosh Bapat wrote: > > Forgot to attach the patch. LGTM Should I change the status to ready for committer now? > > On Thu, Sep 7, 2023 at 1:22 PM Ashutosh Bapat > wrote: > > > > Hi Junwang, > > We leave a line blank after variable declaration as in the

Re: A minor adjustment to get_cheapest_path_for_pathkeys

2023-09-07 Thread Aleksander Alekseev
Hi, >> I agree. I don't think the patch submitter is obliged to try to write >> a good commit message, but people who contribute regularly or are >> posting large stacks of complex patches are probably well-advised to >> try. It makes life easier for committers and even for reviewers trying >> to

Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500

2023-09-07 Thread Jian Guo
Hi Jian He, Thanks for fixing the compiler warnings, seems the CI used a little old compiler and complained: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] But later C standard have relaxed the requirements for this, ISO C99 and later standard allow

Re: [BackendXidGetPid] only access allProcs when xid matches

2023-09-07 Thread Ashutosh Bapat
Forgot to attach the patch. On Thu, Sep 7, 2023 at 1:22 PM Ashutosh Bapat wrote: > > Hi Junwang, > We leave a line blank after variable declaration as in the attached patch. > > Otherwise the patch looks good to me. > > The function modified by the patch is only used by extension > pgrowlocks.

Re: Create shorthand for including all extra tests

2023-09-07 Thread Daniel Gustafsson
> On 4 Sep 2023, at 23:09, Noah Misch wrote: > I could imagine categories for filesystem bytes and RAM bytes. Also, while > needs-private-lo has a bounded definition, "slow" doesn't. If today's one > "slow" test increases check-world duration by 1.1x, we may not let a > 100x-increase test use

Re: psql - pager support - using invisible chars for signalling end of report

2023-09-07 Thread Daniel Gustafsson
> On 6 Sep 2023, at 05:07, Thomas Munro wrote: > This sounds better than the QUERY_SEPARATOR hack from commit > 664d757531e, and similar kludges elsewhere. I think Pavel and David > are right about NUL being impossible in psql query output, no? +1, I would love to be able to rip out that hack.

Re: Obsolete reference to pg_relation in comment

2023-09-07 Thread Daniel Gustafsson
> On 6 Sep 2023, at 21:13, Bruce Momjian wrote: > On Wed, Jul 26, 2023 at 05:14:08PM -0400, Tom Lane wrote: >> I think we should reword this to just generically claim that holding >> the Relation reference open for the whole transaction reduces overhead. > > How is this attached patch? Reads

Re: A failure in 031_recovery_conflict.pl on Debian/s390x

2023-09-07 Thread Christoph Berg
Re: Thomas Munro > I have now disabled the test in 15 and 16 (like the older branches). > I'll see about getting the fixes into master today, and we can > contemplate back-patching later, after we've collected a convincing > volume of test results from the build farm, CI and hopefully your > s390x

Re: [BackendXidGetPid] only access allProcs when xid matches

2023-09-07 Thread Junwang Zhao
On Thu, Sep 7, 2023 at 4:04 PM Michael Paquier wrote: > > On Thu, Sep 07, 2023 at 01:22:07PM +0530, Ashutosh Bapat wrote: > > Otherwise the patch looks good to me. > > > > The function modified by the patch is only used by extension > > pgrowlocks. Given that the function will be invoked as many

Re: persist logical slots to disk during shutdown checkpoint

2023-09-07 Thread Amit Kapila
On Thu, Sep 7, 2023 at 1:18 PM Michael Paquier wrote: > > On Thu, Sep 07, 2023 at 11:56:28AM +0530, Amit Kapila wrote: > > Thanks, the patch looks good to me as well. > > + /* This is used to track the last saved confirmed_flush LSN value */ > + XLogRecPtr last_saved_confirmed_flush; > >

Re: [BackendXidGetPid] only access allProcs when xid matches

2023-09-07 Thread Michael Paquier
On Thu, Sep 07, 2023 at 01:22:07PM +0530, Ashutosh Bapat wrote: > Otherwise the patch looks good to me. > > The function modified by the patch is only used by extension > pgrowlocks. Given that the function will be invoked as many times as > the number of locked rows in the relation, the patch

Re: psql help message contains excessive indentations

2023-09-07 Thread Kyotaro Horiguchi
At Thu, 7 Sep 2023 16:08:10 +0900, Yugo NAGATA wrote in > On Thu, 07 Sep 2023 15:36:10 +0900 (JST) > Kyotaro Horiguchi wrote: > > > At Thu, 7 Sep 2023 15:02:49 +0900, Yugo NAGATA wrote > > in > > > I wonder this better to fix this in similar way to other places where the > > > description

Re: SLRUs in the main buffer pool - Page Header definitions

2023-09-07 Thread Bagga, Rishu
Alekseev, Aleksander (aleksan...@timescale.com) wrote: > It looks like the patch in *this* thread was never registered on the > commitfest and/or tested by CF bot, unless I'm missing something. > Unfortunately it's a bit late to register it for the September CF > especially considering the fact

Re: CHECK Constraint Deferrable

2023-09-07 Thread Himanshu Upadhyaya
Attached is v2 of the patch, rebased against the latest HEAD. Thanks, Himanshu From cf6057ebeffd026ae075ec43d573eca1164eff5b Mon Sep 17 00:00:00 2001 From: Himanshu Upadhyaya Date: Thu, 7 Sep 2023 13:19:14 +0530 Subject: [PATCH v2] Implementation of "CHECK Constraint" to make it Deferrable. ---

Re: [BackendXidGetPid] only access allProcs when xid matches

2023-09-07 Thread Ashutosh Bapat
Hi Junwang, We leave a line blank after variable declaration as in the attached patch. Otherwise the patch looks good to me. The function modified by the patch is only used by extension pgrowlocks. Given that the function will be invoked as many times as the number of locked rows in the

Re: persist logical slots to disk during shutdown checkpoint

2023-09-07 Thread Michael Paquier
On Thu, Sep 07, 2023 at 11:56:28AM +0530, Amit Kapila wrote: > Thanks, the patch looks good to me as well. + /* This is used to track the last saved confirmed_flush LSN value */ + XLogRecPtr last_saved_confirmed_flush; This does not feel sufficient, as the comment explaining what this

Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

2023-09-07 Thread Michael Paquier
On Thu, Sep 07, 2023 at 07:07:36AM +, Hayato Kuroda (Fujitsu) wrote: > # Problem > > The "pg_ctl start" command returns 0 (succeeded) even if the cluster has > already been started. This occurs on Windows environment, and when the command > is executed just after postmaster starts. Not

Re: Can a role have indirect ADMIN OPTION on another role?

2023-09-07 Thread Ashutosh Sharma
On Thu, Sep 7, 2023 at 3:43 AM David G. Johnston wrote: > > On Wed, Sep 6, 2023 at 1:55 PM Ashutosh Sharma wrote: >> >> But what if roleB doesn't want to give roleA access to >> the certain objects it owns. > > > Not doable - roleA can always pretend they are roleB one way or another since >

Re: Can a role have indirect ADMIN OPTION on another role?

2023-09-07 Thread Ashutosh Sharma
On Thu, Sep 7, 2023 at 12:20 AM Robert Haas wrote: > > On Wed, Sep 6, 2023 at 1:33 PM Ashutosh Sharma wrote: > > Actually I have one more question. With this new design, assuming that > > createrole_self_grant is set to 'set, inherit' in postgresql.conf and > > if roleA creates roleB. So, in

Re: Impact of checkpointer during pg_upgrade

2023-09-07 Thread Michael Paquier
(Just dumping what I have in mind while reading the thread.) On Sat, Sep 02, 2023 at 10:08:51AM +0530, Amit Kapila wrote: > During pg_upgrade, we start the server for the old cluster which can > allow the checkpointer to remove the WAL files. It has been noticed > that we do generate certain

Re: psql help message contains excessive indentations

2023-09-07 Thread Yugo NAGATA
On Thu, 07 Sep 2023 15:36:10 +0900 (JST) Kyotaro Horiguchi wrote: > At Thu, 7 Sep 2023 15:02:49 +0900, Yugo NAGATA wrote in > > On Thu, 07 Sep 2023 14:29:56 +0900 (JST) > > Kyotaro Horiguchi wrote: > > > > \q quit psql > > > > \watch [[i=]SEC] [c=N] [m=MIN] > > > !>

  1   2   >