Generating code for query jumbling through gen_node_support.pl

2022-12-06 Thread Michael Paquier
Hi all, This thread is a follow-up of the recent discussion about query jumbling with DDL statements, where the conclusion was that we'd want to generate all this code automatically for all the nodes: https://www.postgresql.org/message-id/36e5bffe-e989-194f-85c8-06e7bc88e...@amazon.com What this

Re: Force streaming every change in logical decoding

2022-12-06 Thread Amit Kapila
On Wed, Dec 7, 2022 at 10:55 AM Masahiko Sawada wrote: > > On Wed, Dec 7, 2022 at 12:55 PM Amit Kapila wrote: > > > > > On one side having separate GUCs for publisher and subscriber seems to > > give better flexibility but having more GUCs also sometimes makes them > > less usable. Here, my

Re: add \dpS to psql

2022-12-06 Thread Pavel Luzanov
On 06.12.2022 22:36, Nathan Bossart wrote: As discussed elsewhere [0], \dp doesn't show privileges on system objects, and this behavior is not mentioned in the docs. I've attached a small patch that adds support for the S modifier (i.e., \dpS) and the adjusts the docs. Thoughts? [0]

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-06 Thread Amit Kapila
On Wed, Dec 7, 2022 at 10:10 AM Masahiko Sawada wrote: > > On Wed, Dec 7, 2022 at 1:29 PM Amit Kapila wrote: > > > > Right, but the leader will anyway exit at some point either due to an > > ERROR like "lost connection ... to parallel worker" or with a LOG > > like: "... will restart because of

Re: PGDOCS - Logical replication GUCs - added some xrefs

2022-12-06 Thread Peter Smith
On Tue, Dec 6, 2022 at 5:57 AM samay sharma wrote: > > Hi, > > On Mon, Oct 24, 2022 at 12:45 AM Peter Smith wrote: >> >> Hi hackers. >> >> There is a docs Logical Replication section "31.10 Configuration >> Settings" [1] which describes some logical replication GUCs, and >> details on how they

Re: ExecRTCheckPerms() and many prunable partitions

2022-12-06 Thread Amit Langote
On Wed, Dec 7, 2022 at 12:19 AM Alvaro Herrera wrote: > I have pushed this finally. Thanks a lot. > I made two further changes: > > 1. there was no reason to rename ExecCheckPerms_hook, since its >signature was changing anyway. I reverted it to the original name. Sure, that makes sense.

Re: Question regarding "Make archiver process an auxiliary process. commit"

2022-12-06 Thread Kyotaro Horiguchi
At Wed, 7 Dec 2022 11:28:23 +0530, Sravan Kumar wrote in > On Tue, Dec 6, 2022 at 5:24 PM Bharath Rupireddy < > bharath.rupireddyforpostg...@gmail.com> wrote: > > > On Tue, Dec 6, 2022 at 4:57 PM Sravan Kumar > > wrote: > > > > > > Thank you for the feedback. > > > > > > I'll be glad to help

Re: Question regarding "Make archiver process an auxiliary process. commit"

2022-12-06 Thread Kyotaro Horiguchi
At Tue, 6 Dec 2022 17:23:50 +0530, Bharath Rupireddy wrote in > Thanks. +1 for fixing this. > > I would like to quote recent discussions on reducing the useless > wakeups or increasing the sleep/hibernation times in various processes > to reduce the power savings [1] [2] [3] [4] [5]. With that

Re: Question regarding "Make archiver process an auxiliary process. commit"

2022-12-06 Thread Sravan Kumar
On Tue, Dec 6, 2022 at 5:24 PM Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Tue, Dec 6, 2022 at 4:57 PM Sravan Kumar > wrote: > > > > Thank you for the feedback. > > > > I'll be glad to help with the fix. Here's the patch for review. > > Thanks. +1 for fixing this. >>

Re: Force streaming every change in logical decoding

2022-12-06 Thread Masahiko Sawada
On Wed, Dec 7, 2022 at 12:55 PM Amit Kapila wrote: > > On Wed, Dec 7, 2022 at 7:31 AM Masahiko Sawada wrote: > > > > On Wed, Dec 7, 2022 at 8:46 AM Peter Smith wrote: > > > > > > > > > > > Yeah, I think this can also help in reducing the time for various > > > > tests in test_decoding/stream

RE: Time delayed LR (WAS Re: logical replication restrictions)

2022-12-06 Thread Takamichi Osumi (Fujitsu)
On Wednesday, December 7, 2022 12:00 PM Kyotaro Horiguchi wrote: > At Tue, 6 Dec 2022 11:08:43 -0800, Andres Freund wrote > in > > Hi, > > > > The tests fail on cfbot: > > https://cirrus-ci.com/task/4533866329800704 > > > > They only seem to fail on 32bit linux. > > > >

Re: Time delayed LR (WAS Re: logical replication restrictions)

2022-12-06 Thread Amit Kapila
On Tue, Dec 6, 2022 at 5:44 PM Takamichi Osumi (Fujitsu) wrote: > > On Friday, December 2, 2022 4:05 PM Amit Kapila > wrote: > > On Tue, Nov 15, 2022 at 12:33 PM Amit Kapila > > wrote: > > > One more thing I would like you to consider is the point raised by me > > > related to this patch's

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-06 Thread Masahiko Sawada
On Wed, Dec 7, 2022 at 1:29 PM Amit Kapila wrote: > > On Wed, Dec 7, 2022 at 9:00 AM Masahiko Sawada wrote: > > > > On Thu, Dec 1, 2022 at 7:17 PM houzj.f...@fujitsu.com > > wrote: > > > > > > > --- > > > > if (am_parallel_apply_worker() && on_subinfo_change) { > > > > /* > > > > * If

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-06 Thread Amit Kapila
On Wed, Dec 7, 2022 at 9:00 AM Masahiko Sawada wrote: > > On Thu, Dec 1, 2022 at 7:17 PM houzj.f...@fujitsu.com > wrote: > > > > > --- > > > if (am_parallel_apply_worker() && on_subinfo_change) { > > > /* > > > * If a parallel apply worker exits due to the subscription > > > *

RE: Avoid streaming the transaction which are skipped (in corner cases)

2022-12-06 Thread shiy.f...@fujitsu.com
On Wed, Dec 7, 2022 12:01 PM Dilip Kumar wrote: > > On Wed, Dec 7, 2022 at 9:28 AM Amit Kapila > wrote: > > > > On Tue, Dec 6, 2022 at 11:55 AM shiy.f...@fujitsu.com > > wrote: > > > > > > On Mon, Dec 5, 2022 6:57 PM Amit Kapila > wrote: > > > > > > > > On Mon, Dec 5, 2022 at 3:41 PM Dilip

Re: Avoid streaming the transaction which are skipped (in corner cases)

2022-12-06 Thread Dilip Kumar
On Wed, Dec 7, 2022 at 9:28 AM Amit Kapila wrote: > > On Tue, Dec 6, 2022 at 11:55 AM shiy.f...@fujitsu.com > wrote: > > > > On Mon, Dec 5, 2022 6:57 PM Amit Kapila wrote: > > > > > > On Mon, Dec 5, 2022 at 3:41 PM Dilip Kumar wrote: > > > > > > > > I think we need something like this[1] so

Re: Avoid streaming the transaction which are skipped (in corner cases)

2022-12-06 Thread Amit Kapila
On Tue, Dec 6, 2022 at 11:55 AM shiy.f...@fujitsu.com wrote: > > On Mon, Dec 5, 2022 6:57 PM Amit Kapila wrote: > > > > On Mon, Dec 5, 2022 at 3:41 PM Dilip Kumar wrote: > > > > > > I think we need something like this[1] so that we can better control > > > the streaming. > > > > > > > +1. The

Re: Force streaming every change in logical decoding

2022-12-06 Thread Amit Kapila
On Wed, Dec 7, 2022 at 7:31 AM Masahiko Sawada wrote: > > On Wed, Dec 7, 2022 at 8:46 AM Peter Smith wrote: > > > > > > > > Yeah, I think this can also help in reducing the time for various > > > tests in test_decoding/stream and > > > src/test/subscription/t/*_stream_*.pl file by reducing the

Re: Perform streaming logical transactions by background workers and parallel apply

2022-12-06 Thread Masahiko Sawada
On Thu, Dec 1, 2022 at 7:17 PM houzj.f...@fujitsu.com wrote: > > On Thursday, December 1, 2022 3:58 PM Masahiko Sawada > wrote: > > > > On Wed, Nov 30, 2022 at 10:51 PM houzj.f...@fujitsu.com > > wrote: > > > > > > On Wednesday, November 30, 2022 9:41 PM houzj.f...@fujitsu.com > > wrote: > >

Re: [RFC] building postgres with meson - v13

2022-12-06 Thread Andres Freund
Hi, On 2022-09-26 14:15:35 -0700, Peter Geoghegan wrote: > On Mon, Sep 26, 2022 at 1:27 PM Andres Freund wrote: > > > Some feedback: > > > * I gather that "running" as it appears in commands like "meson test > > > --setup running" refers to a particular setup named "running", that > > > you

Re: ANY_VALUE aggregate

2022-12-06 Thread David G. Johnston
On Mon, Dec 5, 2022 at 10:40 PM Vik Fearing wrote: > On 12/6/22 05:57, David G. Johnston wrote: > > On Mon, Dec 5, 2022 at 9:48 PM Vik Fearing > wrote: > > > >> I can imagine an optimization that would remove an ORDER BY clause > >> because it isn't needed for any other aggregate. > > > > > >

Re: Commit fest 2022-11

2022-12-06 Thread Michael Paquier
On Wed, Dec 07, 2022 at 08:25:25AM +0530, vignesh C wrote: > The Commitfest 2022-11 status still shows as "In Progress", Shouldn't > the status be changed to "Closed" and the entries be moved to the next > commitfest. Yes, Ian has told me that he is on it this week. -- Michael signature.asc

Re: Using WaitEventSet in the postmaster

2022-12-06 Thread Thomas Munro
Oops, v5 was broken as visible on cfbot (a last second typo broke it). Here's a better one. From 07b04dc410118ad04fd0006edda7ba80f241357a Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Tue, 6 Dec 2022 15:21:11 +1300 Subject: [PATCH v6 1/4] Add WL_SOCKET_ACCEPT event to WaitEventSet API. To be

Re: meson PGXS compatibility

2022-12-06 Thread Andres Freund
Hi, On 2022-12-01 12:17:51 -0800, Andres Freund wrote: > I'll push 0001, 0002 shortly. I don't think 0002 is the most elegant approach, > but it's not awful. I'd still like some review for 0003, but will try to push > it in a few days if that's not forthcoming. Pushed 0003 (move export_dynamic

RE: Perform streaming logical transactions by background workers and parallel apply

2022-12-06 Thread houzj.f...@fujitsu.com
On Tue, Dec 6, 2022 7:57 AM Peter Smith wrote: > Here are my review comments for patch v55-0002 Thansk for your comments. > == > > .../replication/logical/applyparallelworker.c > > 1. pa_can_start > > @@ -276,9 +278,9 @@ pa_can_start(TransactionId xid) > /* > * Don't start a new

Re: Time delayed LR (WAS Re: logical replication restrictions)

2022-12-06 Thread Kyotaro Horiguchi
At Tue, 6 Dec 2022 11:08:43 -0800, Andres Freund wrote in > Hi, > > The tests fail on cfbot: > https://cirrus-ci.com/task/4533866329800704 > > They only seem to fail on 32bit linux. > >

Re: [DOCS] Stats views and functions not in order?

2022-12-06 Thread David G. Johnston
On Tue, Dec 6, 2022 at 6:36 PM Peter Smith wrote: > I'd like to "fix" this but IIUC there is no consensus yet about what > order is best for patch 0001, right? > > I'm planning on performing a more thorough review of 0003 and 0004 tomorrow. As for 0001 - go with Peter E.'s suggested ordering.

Re: Commit fest 2022-11

2022-12-06 Thread vignesh C
Hi, The Commitfest 2022-11 status still shows as "In Progress", Shouldn't the status be changed to "Closed" and the entries be moved to the next commitfest. Regards, Vignesh On Wed, 16 Nov 2022 at 18:30, Ian Lawrence Barwick wrote: > > 2022年11月14日(月) 22:38 Ian Lawrence Barwick : > > > >

Re: Transaction timeout

2022-12-06 Thread Kyotaro Horiguchi
At Mon, 5 Dec 2022 17:10:50 -0800, Andres Freund wrote in > I'm most concerned about the overhead when the timeouts are *not* > enabled. And this adds a branch to start_xact_command() and a function > call for get_timeout_active(TRANSACTION_TIMEOUT) in that case. On its > own, that's not a whole

Re: Force streaming every change in logical decoding

2022-12-06 Thread Amit Kapila
On Tue, Dec 6, 2022 at 7:18 PM Masahiko Sawada wrote: > > On Tue, Dec 6, 2022 at 7:29 PM Amit Kapila wrote: > > > > On Tue, Dec 6, 2022 at 11:53 AM shiy.f...@fujitsu.com > > wrote: > > > > > > Hi hackers, > > > > > > In logical decoding, when logical_decoding_work_mem is exceeded, the > > >

Re: Force streaming every change in logical decoding

2022-12-06 Thread Masahiko Sawada
On Wed, Dec 7, 2022 at 8:46 AM Peter Smith wrote: > > On Tue, Dec 6, 2022 at 9:29 PM Amit Kapila wrote: > > > > On Tue, Dec 6, 2022 at 11:53 AM shiy.f...@fujitsu.com > > wrote: > > > > > > Hi hackers, > > > > > > In logical decoding, when logical_decoding_work_mem is exceeded, the > > >

Re: [DOCS] Stats views and functions not in order?

2022-12-06 Thread Peter Smith
I'd like to "fix" this but IIUC there is no consensus yet about what order is best for patch 0001, right? -- Kind Regards, Peter Smith. Fujitsu Australia

Re: Using WaitEventSet in the postmaster

2022-12-06 Thread Andres Freund
Hi, On 2022-12-07 14:12:37 +1300, Thomas Munro wrote: > On Wed, Dec 7, 2022 at 12:12 PM Andres Freund wrote: > > On 2022-12-07 00:58:06 +1300, Thomas Munro wrote: > > > One way to fix that for the epoll version is to EPOLL_CTL_DEL and > > > EPOLL_CTL_ADD, whenever transitioning to/from a zero

Re: Force streaming every change in logical decoding

2022-12-06 Thread Peter Smith
On Tue, Dec 6, 2022 at 5:23 PM shiy.f...@fujitsu.com wrote: > > Hi hackers, > > In logical decoding, when logical_decoding_work_mem is exceeded, the changes > are > sent to output plugin in streaming mode. But there is a restriction that the > minimum value of logical_decoding_work_mem is 64kB.

Re: Using WaitEventSet in the postmaster

2022-12-06 Thread Thomas Munro
On Wed, Dec 7, 2022 at 2:08 PM Justin Pryzby wrote: > > + /* > > + * It would probably be safe to re-use the inherited signalfd > > since > > + * signalfds only see the current processes pending signals, > > but it > > I think you mean "current process's",

Re: Using WaitEventSet in the postmaster

2022-12-06 Thread Thomas Munro
On Wed, Dec 7, 2022 at 12:12 PM Andres Freund wrote: > On 2022-12-07 00:58:06 +1300, Thomas Munro wrote: > > One way to fix that for the epoll version is to EPOLL_CTL_DEL and > > EPOLL_CTL_ADD, whenever transitioning to/from a zero event mask. > > Tried like that in this version. Another

Re: Using WaitEventSet in the postmaster

2022-12-06 Thread Justin Pryzby
> From 61480441f67ca7fac96ca4bcfe85f27013a47aa8 Mon Sep 17 00:00:00 2001 > From: Thomas Munro > Date: Tue, 6 Dec 2022 16:13:36 +1300 > Subject: [PATCH v4 2/5] Don't leak a signalfd when using latches in the > postmaster. > > + /* > + * It would probably be safe to

Re: Query Jumbling for CALL and SET utility statements

2022-12-06 Thread Michael Paquier
On Tue, Oct 11, 2022 at 11:54:51AM +0900, Michael Paquier wrote: > On Mon, Oct 10, 2022 at 09:16:47PM +0800, Julien Rouhaud wrote: >> Unless I'm missing something both can be handled using pg_node_attr() >> annotations that already exists? > > Indeed, that should work for the locators. My

Collation DDL inconsistencies

2022-12-06 Thread Jeff Davis
When I looked at the bug: https://postgr.es/m/CALDQics_oBEYfOnu_zH6yw9WR1waPCmcrqxQ8+39hK3Op=z...@mail.gmail.com I noticed that the DDL around collations is inconsistent. For instance, CREATE COLLATION[1] uses LOCALE, LC_COLLATE, and LC_CTYPE parameters to specify either libc locales or an icu

Re: Generate pg_stat_get_* functions with Macros

2022-12-06 Thread Michael Paquier
On Tue, Dec 06, 2022 at 05:28:47AM +0100, Drouvot, Bertrand wrote: > Fields renaming was mandatory in the previous ones as there was > already a mix of with/without "n_" in the existing fields names. > > That said, I think it's better to rename the fields as you did (to > be "consistent" on the

Re: Force streaming every change in logical decoding

2022-12-06 Thread Peter Smith
On Tue, Dec 6, 2022 at 9:29 PM Amit Kapila wrote: > > On Tue, Dec 6, 2022 at 11:53 AM shiy.f...@fujitsu.com > wrote: > > > > Hi hackers, > > > > In logical decoding, when logical_decoding_work_mem is exceeded, the > > changes are > > sent to output plugin in streaming mode. But there is a

remove extra space from dumped ALTER DEFAULT PRIVILEGES commands

2022-12-06 Thread Nathan Bossart
Hi hackers, pg_dump adds an extra space in ALTER DEFAULT PRIVILEGES commands. AFAICT it's been this way since the command was first introduced (249724c). I've attached a patch to fix it. This is admittedly just a pet peeve, but maybe it is bothering others, too. -- Nathan Bossart Amazon Web

Re: Allow pageinspect's bt_page_stats function to return a set of rows instead of a single row

2022-12-06 Thread Andres Freund
Hi, On 2022-11-25 02:45:01 +0500, Hamid Akhtar wrote: > Rebasing the patch to the tip of the master branch. This doesn't pass tests on cfbot. Looks like possibly some files are missing?

Re: Using WaitEventSet in the postmaster

2022-12-06 Thread Andres Freund
On 2022-12-07 00:58:06 +1300, Thomas Munro wrote: > One way to fix that for the epoll version is to EPOLL_CTL_DEL and > EPOLL_CTL_ADD, whenever transitioning to/from a zero event mask. > Tried like that in this version. Another approach would be to > (finally) write DeleteWaitEvent() to do the

Re: Allow placeholders in ALTER ROLE w/o superuser

2022-12-06 Thread Pavel Borisov
Hi, Alexander! On Tue, 6 Dec 2022 at 19:01, Alexander Korotkov wrote: > > On Mon, Dec 5, 2022 at 10:32 PM Alexander Korotkov > wrote: > > On Mon, Dec 5, 2022 at 8:18 PM Tom Lane wrote: > > > Alvaro Herrera writes: > > > > I couldn't find any discussion of the idea of adding "(s)" to the > >

core dumps generated in archive / restore commands etc

2022-12-06 Thread Andres Freund
Hi, Occasionally I see core dumps for sh, cp etc when running the tests. I think this is mainly due to immediate shutdowns / crashes signalling the entire process group with SIGQUIT. If a sh/cp/... is running as part of an archive/restore command when the signal arrives, we'll trigger a coredump,

Re: New strategies for freezing, advancing relfrozenxid early

2022-12-06 Thread Peter Geoghegan
On Tue, Dec 6, 2022 at 10:42 AM Andres Freund wrote: > The docs don't build: > https://cirrus-ci.com/task/5456939761532928 > [20:00:58.203] postgres.sgml:52: element link: validity error : IDREF > attribute linkend references an unknown ID "vacuum-for-wraparound" Thanks for pointing this out.

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-06 Thread Nathan Bossart
On Tue, Dec 06, 2022 at 11:25:51AM -0800, Nathan Bossart wrote: > On Tue, Dec 06, 2022 at 07:44:46PM +0300, Melih Mutlu wrote: >> - When the state is SYNCDONE and the apply worker has to wake up to change >> the state to READY. >> >> I think we already call logicalrep_worker_wakeup_ptr wherever

Re: [PATCH] Infinite loop while acquiring new TOAST Oid

2022-12-06 Thread Nikita Malakhov
Hi hackers! Here's some update on the subject - I've made a branch based on master from 28/11 and introduced 64-bit TOAST value ID there. It is not complete now but is already working and has some features: - extended structure for TOAST pointer (varatt_long_external) with 64-bit TOAST value ID;

Re: Cygwin cleanup

2022-12-06 Thread Thomas Munro
On Fri, Jul 29, 2022 at 10:57 AM Thomas Munro wrote: > I wonder if these problems would go away as a nice incidental > side-effect if we used latches for postmaster wakeups. I don't > know... maybe, if the problem is just with the postmaster's pattern of > blocking/unblocking? Maybe backend

Re: Error-safe user functions

2022-12-06 Thread Tom Lane
Robert Haas writes: > I feel like this can go either way. If we pick a name that conveys a > specific intended behavior now, and then later we want to pass some > other sort of node for some purpose other than ignoring errors, it's > unpleasant to have a name that sounds like it can only ignore

Re: Error-safe user functions

2022-12-06 Thread Tom Lane
OK, here's a v3 responding to the comments from Andres. is preliminary refactoring of elog.c, with (I trust) no functional effect. It gets rid of some pre-existing code duplication as well as setting up to let 0001's additions be less duplicative. 0001 adopts use of Node pointers in place

Re: Temporary tables versus wraparound... again

2022-12-06 Thread Andres Freund
Hi, On 2022-12-06 14:50:34 -0500, Greg Stark wrote: > On Tue, 6 Dec 2022 at 13:59, Andres Freund wrote: > > On 2022-12-06 13:47:39 -0500, Greg Stark wrote: > > > So I talked about this patch with Ronan Dunklau and he had a good > > > question Why are we maintaining relfrozenxid and

Re: Temporary tables versus wraparound... again

2022-12-06 Thread Greg Stark
On Tue, 6 Dec 2022 at 13:59, Andres Freund wrote: > > Hi, > > On 2022-12-06 13:47:39 -0500, Greg Stark wrote: > > So I talked about this patch with Ronan Dunklau and he had a good > > question Why are we maintaining relfrozenxid and relminmxid in > > pg_class for temporary tables at all?

Re: predefined role(s) for VACUUM and ANALYZE

2022-12-06 Thread Nathan Bossart
On Tue, Dec 06, 2022 at 11:47:50AM +, Dagfinn Ilmari Mannsåker wrote: > These checks are getting rather repetitive, how about a data-driven > approach, along the lines of the below patch? I'm not quite happy with > the naming of the struct and its members (and maybe it should be in a >

Re: predefined role(s) for VACUUM and ANALYZE

2022-12-06 Thread Nathan Bossart
On Tue, Dec 06, 2022 at 04:57:37PM +0300, Pavel Luzanov wrote: > On 06.12.2022 03:04, Nathan Bossart wrote: >> I wonder why \dpS wasn't added. I wrote up a patch to add it and the >> corresponding documentation that other meta-commands already have. > > Yes, \dpS command and clarification in the

Re: 16: Collation versioning and dependency helpers

2022-12-06 Thread Jeff Davis
On Tue, 2022-12-06 at 10:53 -0800, Andres Freund wrote: > Perhaps worth posting a new version? Or are the remaining patches > abandoned in > favor of the other threads? Marked what is there as committed, and the remainder is abandoned in favor of other threads. Thanks, Jeff Davis

add \dpS to psql

2022-12-06 Thread Nathan Bossart
Hi hackers, As discussed elsewhere [0], \dp doesn't show privileges on system objects, and this behavior is not mentioned in the docs. I've attached a small patch that adds support for the S modifier (i.e., \dpS) and the adjusts the docs. Thoughts? [0]

Re: Cygwin cleanup

2022-12-06 Thread Andres Freund
Hi, On 2022-11-08 19:04:37 -0600, Justin Pryzby wrote: > From 2741472080eceac5cb6d002c39eaf319d7f72b50 Mon Sep 17 00:00:00 2001 > From: Justin Pryzby > Date: Fri, 30 Sep 2022 13:39:43 -0500 > Subject: [PATCH 1/3] meson: other fixes for cygwin > > XXX: what about HAVE_BUGGY_STRTOF ? What about

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-06 Thread Nathan Bossart
Thanks for reviewing! On Tue, Dec 06, 2022 at 07:44:46PM +0300, Melih Mutlu wrote: > Is it really necessary to wake logical workers up when renaming other than > subscription or publication? address.objectId will be a valid subid only > when renaming a subscription. Oops, that is a mistake. I

Re: Improve tab completion for ALTER FUNCTION/PROCEDURE/ROUTINE

2022-12-06 Thread vignesh C
On Tue, 6 Dec 2022 at 20:42, Melih Mutlu wrote: > > Hi Vignesh, > > Looks like the patch needs a rebase. Rebased > Also one little suggestion: > >> + if (ends_with(prev_wd, ')')) >> + COMPLETE_WITH(Alter_routine_options, "CALLED ON NULL INPUT", >> + "RETURNS NULL ON NULL INPUT", "STRICT",

Re: Time delayed LR (WAS Re: logical replication restrictions)

2022-12-06 Thread Andres Freund
Hi, The tests fail on cfbot: https://cirrus-ci.com/task/4533866329800704 They only seem to fail on 32bit linux. https://api.cirrus-ci.com/v1/artifact/task/4533866329800704/testrun/build-32/testrun/subscription/032_apply_delay/log/regress_log_032_apply_delay [06:27:10.628](0.138s) ok 2 - check

Re: generic plans and "initial" pruning

2022-12-06 Thread Alvaro Herrera
I find the API of GetCachedPlans a little weird after this patch. I think it may be better to have it return a pointer of a new struct -- one that contains both the CachedPlan pointer and the list of pruning results. (As I understand, the sole caller that isn't interested in the pruning results,

Re: Temporary tables versus wraparound... again

2022-12-06 Thread Andres Freund
Hi, On 2022-12-06 13:47:39 -0500, Greg Stark wrote: > So I talked about this patch with Ronan Dunklau and he had a good > question Why are we maintaining relfrozenxid and relminmxid in > pg_class for temporary tables at all? Autovacuum can't use them and > other sessions won't care about

Re: 16: Collation versioning and dependency helpers

2022-12-06 Thread Andres Freund
Hi, On 2022-10-31 16:36:54 -0700, Jeff Davis wrote: > Committed these two small changes. FWIW, as it stands cfbot can't apply the remaining changes: http://cfbot.cputube.org/patch_40_3977.log Perhaps worth posting a new version? Or are the remaining patches abandoned in favor of the other

Re: PATCH: Using BRIN indexes for sorted output

2022-12-06 Thread Andres Freund
Hi, On 2022-11-17 00:52:35 +0100, Tomas Vondra wrote: > Well, yeah. That's pretty much exactly what the last version of this > patch (from October 23) does. That version unfortunately doesn't build successfully: https://cirrus-ci.com/task/5108789846736896 [03:02:48.641] Duplicate OIDs detected:

Re: Temporary tables versus wraparound... again

2022-12-06 Thread Greg Stark
So I talked about this patch with Ronan Dunklau and he had a good question Why are we maintaining relfrozenxid and relminmxid in pg_class for temporary tables at all? Autovacuum can't use them and other sessions won't care about them. The only session that might care about them is the one

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2022-12-06 Thread Andres Freund
Hi, On 2022-11-11 17:16:36 +0100, Önder Kalacı wrote: > I rebased the changes to the current master branch, reflected pg_indent > suggestions and also made a few minor style changes. Needs another rebase, I think: https://cirrus-ci.com/task/559244463758 [05:44:22.102] FAILED:

Re: Removing unneeded self joins

2022-12-06 Thread Andres Freund
Hi, On 2022-10-05 17:25:18 +0500, Andrey Lepikhov wrote: > New version, rebased onto current master. > Nothing special, just rebase. This doesn't pass the main regression tests due to a plan difference. https://cirrus-ci.com/task/5537518245380096

Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.

2022-12-06 Thread Andres Freund
Hi, On 2022-09-19 01:29:21 +0300, Anton A. Melnikov wrote: > Corrected patch is attached (v2-0001-Fix-burst-checkpoint_req-growth.patch). This patch doesn't pass the main regression tests tests successfully: https://cirrus-ci.com/task/5502700019253248 diff -U3

Re: New strategies for freezing, advancing relfrozenxid early

2022-12-06 Thread Andres Freund
Hi, On 2022-11-23 15:06:52 -0800, Peter Geoghegan wrote: > Attached is v8. The docs don't build: https://cirrus-ci.com/task/5456939761532928 [20:00:58.203] postgres.sgml:52: element link: validity error : IDREF attribute linkend references an unknown ID "vacuum-for-wraparound" Greetings,

Re: RFC: Logging plan of the running query

2022-12-06 Thread Andres Freund
Hi, This patch does not currently build, due to a conflicting oid: https://cirrus-ci.com/task/4638460594618368?logs=build#L108 [17:26:44.602] /usr/bin/perl ../src/include/catalog/../../backend/catalog/genbki.pl --include-path=../src/include --set-version=16 --output=src/include/catalog

Re: Eliminating SPI from RI triggers - take 2

2022-12-06 Thread Andres Freund
Hi, On 2022-10-15 14:47:05 +0900, Amit Langote wrote: > Attached updated patches. These started to fail to build recently: [04:43:33.046] ccache cc -Isrc/backend/postgres_lib.a.p -Isrc/include -I../src/include -Isrc/include/storage -Isrc/include/utils -Isrc/include/catalog -Isrc/include/nodes

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

2022-12-06 Thread Brar Piening
On 06.12.2022 at 19:11, Brar Piening wrote: The current statistics for docbook elements with/without ids after applying the patch are the following: Somehow my e-mail client destroyed the table. That's how it was supposed to look like: name  | with_id | without_id | id_coverage |

Re: PATCH: AM-specific statistics, with an example implementation for BRIN (WIP)

2022-12-06 Thread Andres Freund
Hi, On 2022-10-18 13:33:59 +0200, Tomas Vondra wrote: > I mentioned I have some ideas how to improve this, and that I'll start a > separate thread to discuss this. So here we go ... This CF entry has been failing tests since it was submitted. Are you planning to work on this further? If not I

Re: Add the ability to limit the amount of memory that can be allocated to backends.

2022-12-06 Thread Andres Freund
Hi, On 2022-11-26 22:22:15 -0500, Reid Thompson wrote: > rebased/patched to current master && current > pg-stat-activity-backend-memory-allocated This version fails to build with msvc, and builds with warnings on other platforms. https://cirrus-ci.com/build/5410696721072128 msvc: [20:26:51.286]

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

2022-12-06 Thread Andres Freund
Hi, On 2022-11-25 11:41:45 +, Hayato Kuroda (Fujitsu) wrote: > Sorry for my late reply. I understood that we got agreement the basic design > of first version. Thanks! > I attached new version patches. This is failing on cfbot / CI, as have prior versions.

Re: Error-safe user functions

2022-12-06 Thread Corey Huinker
On Tue, Dec 6, 2022 at 6:46 AM Andrew Dunstan wrote: > > On 2022-12-05 Mo 20:06, Tom Lane wrote: > > Andres Freund writes: > > > >> But perhaps it's even worth having such a function properly exposed: > >> It's not at all rare to parse text data during ETL and quite often > >> erroring out

Re: Make EXPLAIN generate a generic plan for a parameterized query

2022-12-06 Thread Andres Freund
Hi, On 2022-10-29 10:35:26 +0200, Laurenz Albe wrote: > On Tue, 2022-10-25 at 19:03 +0800, Julien Rouhaud wrote: > > On Tue, Oct 25, 2022 at 11:08:27AM +0200, Laurenz Albe wrote: > > > Here is a patch that > > > implements it with an EXPLAIN option named GENERIC_PLAN. > > > > I only have a quick

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

2022-12-06 Thread Brar Piening
On 06.12.2022 at 18:59, Brar Piening wrote: On 06.12.2022 at 09:38, Alvaro Herrera wrote: I would welcome separate patches: one to add the IDs, another for the XSL/CSS stuff.  That allows us to discuss them separately. I'll send two patches in two separate e-mails in a moment. This is patch

Re: pg_upgrade test failure

2022-12-06 Thread Andres Freund
Hi, On 2022-11-08 01:16:09 +1300, Thomas Munro wrote: > So [1] on its own didn't fix this. My next guess is that the attached > might help. > > Hmm. Following Michael's clue that this might involve log files and > pg_ctl, I noticed one thing: pg_ctl implements > wait_for_postmaster_stop() by

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

2022-12-06 Thread Brar Piening
On 06.12.2022 at 09:38, Alvaro Herrera wrote: I care. The problem last time is that we were in the middle of the last commitfest, so we were (or at least I was) distracted by other stuff. Ok, thanks. That's appreciated and understood. Looking at the resulting psql page,

Re: Add tracking of backend memory allocated to pg_stat_activity

2022-12-06 Thread Andres Freund
Hi, On 2022-12-06 08:47:55 -0500, Reid Thompson wrote: > The intent was to capture and display all the memory allocated to the > backends, for admins/users/max_total_backend_memory/others to utilize. It's going to be far less accurate than that. For one, there's a lot of operating system

Re: Error-safe user functions

2022-12-06 Thread Robert Haas
On Tue, Dec 6, 2022 at 11:07 AM Tom Lane wrote: > > I originally chose InputFunctionCallContext as a more neutral name in > > case we wanted to be able to pass some other sort of node for the > > context in future. > > Maybe that was a little too forward looking. > > I didn't like that because it

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-06 Thread Melih Mutlu
Hi Nathan, @@ -410,6 +411,12 @@ ExecRenameStmt(RenameStmt *stmt) > stmt->newname); > table_close(catalog, RowExclusiveLock); > > + /* > + * Wake up the logical replication workers to handle this > + * change quickly. > + */ > + LogicalRepWorkersWakeupAtCommit(address.objectId); Is it

Re: Error-safe user functions

2022-12-06 Thread Tom Lane
Andrew Dunstan writes: > On 2022-12-06 Tu 09:42, Tom Lane wrote: >> I'm not sure this is any *better* than Safe ... it's longer, less >> mellifluous, and still subject to misinterpretation. But it's >> a possible alternative. > Yeah, I don't think there's terribly much to choose between 'safe'

Re: Error-safe user functions

2022-12-06 Thread Andrew Dunstan
On 2022-12-06 Tu 09:42, Tom Lane wrote: > [ continuing the naming quagmire... ] > > I wrote: >> Andres Freund writes: >>> Not that I have a suggestion for a better name, but I don't particularly >>> like "Safe" denoting non-erroring input function calls. There's too many >>> interpretations of

Re: ExecRTCheckPerms() and many prunable partitions

2022-12-06 Thread Alvaro Herrera
I have pushed this finally. I made two further changes: 1. there was no reason to rename ExecCheckPerms_hook, since its signature was changing anyway. I reverted it to the original name. 2. I couldn't find any reason to expose ExecGetRTEPermissionInfo, and given that it's a one-line

Re: Improve tab completion for ALTER FUNCTION/PROCEDURE/ROUTINE

2022-12-06 Thread Melih Mutlu
Hi Vignesh, Looks like the patch needs a rebase. Also one little suggestion: + if (ends_with(prev_wd, ')')) > + COMPLETE_WITH(Alter_routine_options, "CALLED ON NULL INPUT", > + "RETURNS NULL ON NULL INPUT", "STRICT", "SUPPORT"); What do you think about gathering FUNCTION options as you did

Re: Allow placeholders in ALTER ROLE w/o superuser

2022-12-06 Thread Alexander Korotkov
On Mon, Dec 5, 2022 at 10:32 PM Alexander Korotkov wrote: > On Mon, Dec 5, 2022 at 8:18 PM Tom Lane wrote: > > Alvaro Herrera writes: > > > I couldn't find any discussion of the idea of adding "(s)" to the > > > variable name in order to mark the variable userset in the catalog, and > > > I

Re: old_snapshot: add test for coverage

2022-12-06 Thread Dong Wook Lee
On Mon, Aug 8, 2022 at 2:37 PM Tom Lane wrote: > > Dong Wook Lee writes: > > I wrote a test of the old_snapshot extension for coverage. > > Hmm, does this really provide any meaningful coverage? The test > sure looks like it's not doing much. Previously written tests were simply test codes to

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-06 Thread Tom Lane
Ashutosh Bapat writes: > On Mon, Dec 5, 2022 at 8:13 PM Tom Lane wrote: >> I don't especially like "rel->nparts = 0" as a way of disabling >> partitionwise join ... > ... If we can not generate AppendPath for a > join relation, it means there is no way to compute child join > relations and thus

Re: Error-safe user functions

2022-12-06 Thread Tom Lane
[ continuing the naming quagmire... ] I wrote: > Andres Freund writes: >> Not that I have a suggestion for a better name, but I don't particularly >> like "Safe" denoting non-erroring input function calls. There's too many >> interpretations of safe - e.g. safe against privilege escalation

Re: Missing MaterialPath support in reparameterize_path_by_child

2022-12-06 Thread Ashutosh Bapat
On Mon, Dec 5, 2022 at 8:13 PM Tom Lane wrote: > > Ashutosh Bapat writes: > > partition-wise join should be willing to fallback to non-partitionwise > > join in such a case. After spending a few minutes with the code, I > > think generate_partitionwise_join_paths() should not call > >

Re: predefined role(s) for VACUUM and ANALYZE

2022-12-06 Thread Pavel Luzanov
On 06.12.2022 03:04, Nathan Bossart wrote: I wonder why \dpS wasn't added. I wrote up a patch to add it and the corresponding documentation that other meta-commands already have. Yes, \dpS command and clarification in the documentation is exactly what is needed. -- Pavel Luzanov Postgres

Re: Add tracking of backend memory allocated to pg_stat_activity

2022-12-06 Thread Reid Thompson
On Fri, 2022-12-02 at 09:18 -0800, Andres Freund wrote: > Hi, > > On 2022-12-02 11:09:30 -0500, Reid Thompson wrote: > > It appears to me that Postmaster populates the local variable that > > *my_allocated_bytes points to. That allocation is passed to forked > > children, and if not zeroed out,

Re: Force streaming every change in logical decoding

2022-12-06 Thread Masahiko Sawada
On Tue, Dec 6, 2022 at 7:29 PM Amit Kapila wrote: > > On Tue, Dec 6, 2022 at 11:53 AM shiy.f...@fujitsu.com > wrote: > > > > Hi hackers, > > > > In logical decoding, when logical_decoding_work_mem is exceeded, the > > changes are > > sent to output plugin in streaming mode. But there is a

Re: [PATCH] Check snapshot argument of index_beginscan and family

2022-12-06 Thread Pavel Borisov
On Tue, 6 Dec 2022 at 04:31, Alexander Korotkov wrote: > > On Fri, Dec 2, 2022 at 6:18 PM Alexander Korotkov > wrote: > > On Mon, Nov 28, 2022 at 1:30 PM Aleksander Alekseev > > wrote: > > > Thanks for the feedback! > > > > > > > I think it's a nice catch and worth fixing. The one thing I

Re: pg_basebackup: add test about zstd compress option

2022-12-06 Thread Dong Wook Lee
> The only thing that I can think of would be if $decompress_program > --test were failing, but actually trying to decompress succeeded. I > would be inclined to dismiss that particular scenario as not important > enough to be worth the additional CPU cycles. When I wrote this test, it was just

RE: Time delayed LR (WAS Re: logical replication restrictions)

2022-12-06 Thread Takamichi Osumi (Fujitsu)
On Friday, December 2, 2022 4:05 PM Amit Kapila wrote: > On Tue, Nov 15, 2022 at 12:33 PM Amit Kapila > wrote: > > One more thing I would like you to consider is the point raised by me > > related to this patch's interaction with the parallel apply feature as > > mentioned in the email [1]. I am

  1   2   >