Re: plpgsq_plugin's stmt_end() is not called when an error is caught

2022-12-14 Thread Kyotaro Horiguchi
At Thu, 15 Dec 2022 08:41:21 +0100, Pavel Stehule wrote in > čt 15. 12. 2022 v 8:25 odesílatel Masahiko Sawada > napsal: > > Is this a bug in plpgsql? > > > > I think it is by design. There is not any callback that is called after an > exception. > > It is true, so some callbacks on

Re: plpgsq_plugin's stmt_end() is not called when an error is caught

2022-12-14 Thread Pavel Stehule
čt 15. 12. 2022 v 8:25 odesílatel Masahiko Sawada napsal: > Hi, > > While investigating the issue reported on pg_hint_plan[1], I realized > that stmt_end() callback is not called if an error raised during the > statement execution is caught. I've attached the patch to check when > stmt_beg() and

plpgsq_plugin's stmt_end() is not called when an error is caught

2022-12-14 Thread Masahiko Sawada
Hi, While investigating the issue reported on pg_hint_plan[1], I realized that stmt_end() callback is not called if an error raised during the statement execution is caught. I've attached the patch to check when stmt_beg() and stmt_end() are called. Here is an example: postgres(1:3220232)=#

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-12-14 Thread Michael Paquier
On Wed, Dec 14, 2022 at 04:44:34PM -0600, David Christensen wrote: > I can get one sent in tomorrow. -XLogRecordHasFPW(XLogReaderState *record) +XLogRecordHasFPI(XLogReaderState *record) This still refers to a FPW, so let's leave that out as well as any renamings of this kind.. + if

Re: Error-safe user functions

2022-12-14 Thread Amul Sul
On Thu, Dec 15, 2022 at 11:16 AM Tom Lane wrote: > > Amul Sul writes: > > There are other a bunch of hard errors from get_multirange_io_data(), > > get_range_io_data() and its subroutine can hit, shouldn't we care > > about those? > > I think those are all "internal" errors, ie not reachable as

Re: Use get_call_result_type() more widely

2022-12-14 Thread Michael Paquier
On Wed, Dec 14, 2022 at 11:14:59AM +0530, Bharath Rupireddy wrote: > AFAICS, most of these functions have no direct source code callers, > they're user-facing functions and not in a hot code path. I measured > the test times of these functions and I don't see much difference [1]. Thanks for the

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

2022-12-14 Thread Kyotaro Horiguchi
At Thu, 15 Dec 2022 10:29:17 +0530, Amit Kapila wrote in > On Thu, Dec 15, 2022 at 10:11 AM Kyotaro Horiguchi > wrote: > > > > At Thu, 15 Dec 2022 09:18:55 +0530, Amit Kapila > > wrote in > > > On Thu, Dec 15, 2022 at 7:22 AM Kyotaro Horiguchi > > > wrote: > > > subscriber was busy enough

Re: Error-safe user functions

2022-12-14 Thread Tom Lane
Amul Sul writes: > There are other a bunch of hard errors from get_multirange_io_data(), > get_range_io_data() and its subroutine can hit, shouldn't we care > about those? I think those are all "internal" errors, ie not reachable as a consequence of bad input data. Do you see a reason to think

The drop-index-concurrently-1 isolation test no longer tests what it was meant to

2022-12-14 Thread David Rowley
I'm in the middle of working on making some adjustments to the costs of Incremental Sorts and I see the patch I wrote changes the plan in the drop-index-concurrently-1 isolation test. The particular plan changed currently expects: --- Sort Sort Key:

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

2022-12-14 Thread Masahiko Sawada
On Wed, Dec 14, 2022 at 3:48 PM Amit Kapila wrote: > > On Wed, Dec 14, 2022 at 9:50 AM houzj.f...@fujitsu.com > wrote: > > > > On Tuesday, December 13, 2022 11:25 PM Masahiko Sawada > > wrote: > > > > > > Here are comments on v59 0001, 0002 patches: > > > > Thanks for the comments! > > > > >

Re: Error-safe user functions

2022-12-14 Thread Amul Sul
On Thu, Dec 15, 2022 at 9:03 AM Tom Lane wrote: > > Here are some proposed patches for converting range_in and multirange_in. > > 0001 tackles the straightforward part, which is trapping syntax errors > and called-input-function errors. The only thing that I think might > be controversial here

Re: [PATCH] random_normal function

2022-12-14 Thread Michael Paquier
On Tue, Dec 13, 2022 at 03:51:11PM -0800, Paul Ramsey wrote: > Clearing up one CI failure. +-- normal values converge on stddev == 2.0 +SELECT round(stddev(random_normal(2, 2))) + FROM generate_series(1, 1); I am not sure that it is a good idea to make a test based on a random behavior that

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

2022-12-14 Thread Amit Kapila
On Thu, Dec 15, 2022 at 10:11 AM Kyotaro Horiguchi wrote: > > At Thu, 15 Dec 2022 09:18:55 +0530, Amit Kapila > wrote in > > On Thu, Dec 15, 2022 at 7:22 AM Kyotaro Horiguchi > > wrote: > > > > > > At Wed, 14 Dec 2022 16:30:28 +0530, Amit Kapila > > > wrote in > > > > On Wed, Dec 14, 2022 at

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

2022-12-14 Thread Kyotaro Horiguchi
At Thu, 15 Dec 2022 09:18:55 +0530, Amit Kapila wrote in > On Thu, Dec 15, 2022 at 7:22 AM Kyotaro Horiguchi > wrote: > > > > At Wed, 14 Dec 2022 16:30:28 +0530, Amit Kapila > > wrote in > > > On Wed, Dec 14, 2022 at 4:16 PM Hayato Kuroda (Fujitsu) > > > wrote: > > > > One idea to avoid

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

2022-12-14 Thread Kyotaro Horiguchi
At Thu, 15 Dec 2022 09:23:12 +0530, Amit Kapila wrote in > On Thu, Dec 15, 2022 at 7:16 AM Kyotaro Horiguchi > wrote: > > Allowing walsender to finish ignoring replication status > > wouldn't be great. > > > > Yes, that would be ideal. But do you know why that is a must? I believe a graceful

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

2022-12-14 Thread Amit Kapila
On Thu, Dec 15, 2022 at 7:16 AM Kyotaro Horiguchi wrote: > > At Wed, 14 Dec 2022 10:46:17 +, "Hayato Kuroda (Fujitsu)" > wrote in > > I have implemented and tested that workers wake up per > > wal_receiver_timeout/2 > > and send keepalive. Basically it works well, but I found two problems.

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

2022-12-14 Thread Amit Kapila
On Thu, Dec 15, 2022 at 7:22 AM Kyotaro Horiguchi wrote: > > At Wed, 14 Dec 2022 16:30:28 +0530, Amit Kapila > wrote in > > On Wed, Dec 14, 2022 at 4:16 PM Hayato Kuroda (Fujitsu) > > wrote: > > > One idea to avoid that is to send the min_apply_delay subscriber option > > > to publisher > > >

Re: Error-safe user functions

2022-12-14 Thread Tom Lane
Here are some proposed patches for converting range_in and multirange_in. 0001 tackles the straightforward part, which is trapping syntax errors and called-input-function errors. The only thing that I think might be controversial here is that I chose to change the signatures of the exposed

check_strxfrm_bug()

2022-12-14 Thread Thomas Munro
Hi While studying Jeff's new crop of collation patches I noticed in passing that check_strxfrm_bug() must surely by now be unnecessary. The buffer overrun bugs were fixed a decade ago, and the relevant systems are way out of support. If you're worried that the bugs might come back, then the test

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

2022-12-14 Thread Kyotaro Horiguchi
At Wed, 14 Dec 2022 16:30:28 +0530, Amit Kapila wrote in > On Wed, Dec 14, 2022 at 4:16 PM Hayato Kuroda (Fujitsu) > wrote: > > One idea to avoid that is to send the min_apply_delay subscriber option to > > publisher > > and compare them, but it may be not sufficient. Because XXX_timout GUC

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

2022-12-14 Thread Kyotaro Horiguchi
At Wed, 14 Dec 2022 10:46:17 +, "Hayato Kuroda (Fujitsu)" wrote in > I have implemented and tested that workers wake up per wal_receiver_timeout/2 > and send keepalive. Basically it works well, but I found two problems. > Do you have any good suggestions about them? > > 1) > > With this

Re: pg_upgrade: Make testing different transfer modes easier

2022-12-14 Thread Kyotaro Horiguchi
At Wed, 14 Dec 2022 10:40:45 +0100, Daniel Gustafsson wrote in > > On 14 Dec 2022, at 08:04, Peter Eisentraut > > wrote: > > > > On 07.12.22 17:33, Peter Eisentraut wrote: > >> I think if we want to make this configurable on the fly, and environment > >> variable would be much easier, like

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Nathan Bossart
On Thu, Dec 15, 2022 at 09:12:26AM +0900, Michael Paquier wrote: > On Wed, Dec 14, 2022 at 03:29:39PM -0800, Nathan Bossart wrote: >> On Wed, Dec 14, 2022 at 11:05:13AM -0800, Jeff Davis wrote: >>> On Wed, 2022-12-14 at 10:16 -0800, Nathan Bossart wrote: Okay.  Should all the privileges

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Jeff Davis
On Wed, 2022-12-14 at 16:11 -0600, Justin Pryzby wrote: > Yeah, but: > > regression=> insert into p1 values (1); > ERROR:  permission denied for table p1 > regression=> select * from p1; > ERROR:  permission denied for table p1 Right, that's what I had in mind: a user is only granted operations

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Michael Paquier
On Wed, Dec 14, 2022 at 03:29:39PM -0800, Nathan Bossart wrote: > On Wed, Dec 14, 2022 at 11:05:13AM -0800, Jeff Davis wrote: >> On Wed, 2022-12-14 at 10:16 -0800, Nathan Bossart wrote: >>> Okay.  Should all the privileges governed by MAINTAIN apply to a >>> relation's >>> TOAST table as well? >>

Re: Raising the SCRAM iteration count

2022-12-14 Thread Jonathan S. Katz
On 12/14/22 6:52 PM, Michael Paquier wrote: On Wed, Dec 14, 2022 at 01:59:04PM -0500, Jonathan S. Katz wrote: HA-256 that we will just need to pick up? The attached v2 has the GUC rename and a change to GUC_REPORT such that the frontend can use the real value rather than the default. I kept

Re: Raising the SCRAM iteration count

2022-12-14 Thread Michael Paquier
On Wed, Dec 14, 2022 at 01:59:04PM -0500, Jonathan S. Katz wrote: > On 12/14/22 6:25 AM, Daniel Gustafsson wrote: >> I was thinking about it but opted for the simpler approach of a GUC name with >> the algorithm baked into it: scram_sha256_iterations. It doesn't seem all >> that >> likely that

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Nathan Bossart
On Wed, Dec 14, 2022 at 11:05:13AM -0800, Jeff Davis wrote: > On Wed, 2022-12-14 at 10:16 -0800, Nathan Bossart wrote: >> Okay.  Should all the privileges governed by MAINTAIN apply to a >> relation's >> TOAST table as well? > > Yes, I agree. This might be tricky, because AFAICT you have to scan

Re: Error-safe user functions

2022-12-14 Thread Tom Lane
I wrote: > Amul Sul writes: >> Attaching a complete set of the patches changing function till this >> except bpcharin, byteain jsonpath_in that Andrew is planning to look >> in. I have skipped reg* functions. > I'll take a look at these shortly, unless Andrew is already on it. I've gone through

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-14 Thread Nathan Bossart
On Wed, Dec 14, 2022 at 02:02:58PM -0500, Tom Lane wrote: > Maybe we could have workers that are exiting for that reason set a > flag saying "please restart me without delay"? That helps a bit, but there are still delays when starting workers for new subscriptions. I think we'd need to create a

Re: [PATCH] Enable using llvm jitlink as an alternative llvm jit linker of old Rtdyld.

2022-12-14 Thread Thomas Munro
On Thu, Nov 24, 2022 at 12:08 AM David Rowley wrote: > On Wed, 23 Nov 2022 at 23:13, Alex Fan wrote: > > I am new to the postgres community and apologise for resending this as the > > previous one didn't include patch properly and didn't cc reviewers (maybe > > the reason it has been buried in

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-12-14 Thread David Christensen
Hi Bharath, I can get one sent in tomorrow. Thanks, David

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Isaac Morland
On Wed, 14 Dec 2022 at 15:57, Jeff Davis wrote: > On Wed, 2022-12-14 at 15:32 -0500, Isaac Morland wrote: > > > Is there a firm decision on the issue of changing the cluster index > > of a table? Re-clustering a table on the same index is clearly > > something that should be granted by MAINTAIN

Re: Error-safe user functions

2022-12-14 Thread Tom Lane
Andrew Dunstan writes: > Thanks, I have been looking at jsonpath, but I'm not quite sure how to > get the escontext argument to the yyerror calls in jsonath_scan.l. Maybe > I need to specify a lex-param setting? You want a parse-param option in jsonpath_gram.y, I think; adding that will persuade

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Justin Pryzby
On Thu, Dec 15, 2022 at 01:02:39AM +0300, Pavel Luzanov wrote: > On 14.12.2022 22:46, Jeff Davis wrote: > > The behavior is that MAINTAIN > > privileges on the partitioned table does not imply MAINTAIN privileges > > on the partitions. I believe that's fine and it's consistent with other > >

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Pavel Luzanov
On 14.12.2022 22:46, Jeff Davis wrote: The behavior is that MAINTAIN privileges on the partitioned table does not imply MAINTAIN privileges on the partitions. I believe that's fine and it's consistent with other privileges on partitioned tables, such as SELECT and INSERT. Sorry, I may have

Re: Inconsistency in reporting checkpointer stats

2022-12-14 Thread Michael Paquier
On Wed, Dec 14, 2022 at 04:54:53PM +0530, Bharath Rupireddy wrote: > Indeed PendingCheckpointerStats.buf_written_checkpoints needs to count > buffer writes in SlruInternalWritePage(). However, does it need to be > done immediately there? The stats will not be visible to the users > until the next

Re: Error-safe user functions

2022-12-14 Thread Andrew Dunstan
On 2022-12-14 We 11:00, Tom Lane wrote: > Amul Sul writes: >> Attaching a complete set of the patches changing function till this >> except bpcharin, byteain jsonpath_in that Andrew is planning to look >> in. I have skipped reg* functions. > I'll take a look at these shortly, unless Andrew is

Re: Temporary tables versus wraparound... again

2022-12-14 Thread Greg Stark
> You do have to lock a table in order to update its pg_class row, > though, whether the table is temporary or not. Otherwise, another > session could drop it while you're doing something with it, after > which bad things would happen. I was responding to this from Andres: > Is that actually

Re: Temporary tables versus wraparound... again

2022-12-14 Thread Robert Haas
On Wed, Dec 14, 2022 at 1:18 PM Greg Stark wrote: > So I don't see any evidence we skip any locking on pg_class when doing > updates on rows for temporary tables. I don't know what this means. You don't have to lock pg_class to update rows in any table, whether temporary or otherwise. You do

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Jeff Davis
On Wed, 2022-12-14 at 15:32 -0500, Isaac Morland wrote: > Is there a firm decision on the issue of changing the cluster index > of a table? Re-clustering a table on the same index is clearly > something that should be granted by MAINTAIN as I imagine it, but > changing the cluster index, strictly

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Isaac Morland
On Wed, 14 Dec 2022 at 14:47, Jeff Davis wrote: Furthermore, MAINTAIN privileges on the partitioned table do not grant > the ability to create new partitions. There's a comment in tablecmds.c > alluding to a possible "UNDER" privilege: > > /* >* We should have an UNDER permission flag for

Re: Refactor SCRAM code to dynamically handle hash type and key length

2022-12-14 Thread Michael Paquier
On Wed, Dec 14, 2022 at 02:39:43PM +0100, Peter Eisentraut wrote: > On 14.12.22 03:38, Michael Paquier wrote: >> While investigating on what it would take to extend SCRAM to use new >> hash methods (say like the RFC draft for SCRAM-SHA-512), I have been >> quickly reminded of the limitations

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Jeff Davis
On Wed, 2022-12-14 at 12:07 +0300, Pavel Luzanov wrote: > After a fresh install, including the patch for \dpS [1], > I found that granting MAINTAIN privilege does not allow the TOAST > table > to be vacuumed. I wanted to also mention partitioning. The behavior is that MAINTAIN privileges on the

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Jeff Davis
On Wed, 2022-12-14 at 10:16 -0800, Nathan Bossart wrote: > Okay.  Should all the privileges governed by MAINTAIN apply to a > relation's > TOAST table as well? Yes, I agree. -- Jeff Davis PostgreSQL Contributor Team - AWS

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-14 Thread Tom Lane
Nathan Bossart writes: > On Wed, Dec 14, 2022 at 01:23:18PM -0500, Tom Lane wrote: >> Oh. What in the world is the rationale for that? > My assumption is that this is meant to avoid starting workers as fast as > possible if they repeatedly crash. I can see the point of rate-limiting if the

Re: Raising the SCRAM iteration count

2022-12-14 Thread Jonathan S. Katz
On 12/14/22 6:25 AM, Daniel Gustafsson wrote: On 14 Dec 2022, at 02:00, Michael Paquier wrote: On Tue, Dec 13, 2022 at 12:17:58PM +0100, Daniel Gustafsson wrote: It does raise an interesting point though, if we in the future add suppprt for SCRAM-SHA-512 (which seems reasonable to do) it's

Re: collect_corrupt_items_vacuum.patch

2022-12-14 Thread Nikita Malakhov
Hi hackers! Just to bump this thread, because the problem seems to be still actual: Please correct me if I am wrong. I've checked another discussion related to pg_visibility [1]. According to discussion: if using latest completed xid is not right for checking visibility, than it should be the

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-14 Thread Nathan Bossart
On Wed, Dec 14, 2022 at 01:23:18PM -0500, Tom Lane wrote: > Nathan Bossart writes: >> I'm reasonably certain the launcher is already signaled like you describe. >> It'll just wait to start new workers if it's been less than >> wal_retrieve_retry_interval milliseconds since the last time it

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-14 Thread Tom Lane
Nathan Bossart writes: > I'm reasonably certain the launcher is already signaled like you describe. > It'll just wait to start new workers if it's been less than > wal_retrieve_retry_interval milliseconds since the last time it started > workers. Oh. What in the world is the rationale for that?

Re: Temporary tables versus wraparound... again

2022-12-14 Thread Greg Stark
On Sat, 5 Nov 2022 at 15:34, Tom Lane wrote: > > Greg Stark writes: > > Simple Rebase > > I took a little bit of a look through these. > > * I find 0001 a bit scary, specifically that it's decided it's > okay to apply extract_autovac_opts, pgstat_fetch_stat_tabentry_ext, > and especially

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Nathan Bossart
On Wed, Dec 14, 2022 at 07:05:34PM +0100, Alvaro Herrera wrote: > On 2022-Dec-14, Nathan Bossart wrote: >> On Wed, Dec 14, 2022 at 12:07:13PM +0300, Pavel Luzanov wrote: >> > I found that granting MAINTAIN privilege does not allow the TOAST table to >> > be vacuumed. >> >> Hm. My first thought

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Alvaro Herrera
On 2022-Dec-14, Nathan Bossart wrote: > On Wed, Dec 14, 2022 at 12:07:13PM +0300, Pavel Luzanov wrote: > > I found that granting MAINTAIN privilege does not allow the TOAST table to > > be vacuumed. > > Hm. My first thought is that this is the appropriate behavior. WDYT? It seems wrong to me.

Re: Minimal logical decoding on standbys

2022-12-14 Thread Robert Haas
On Wed, Dec 14, 2022 at 12:35 PM Andres Freund wrote: > > typedef struct xl_heap_prune > > > > I think this is unsafe on alignment-picky machines. I think it will > > cause the offset numbers to be aligned at an odd address. > > heap_xlog_prune() doesn't copy the data into aligned memory, so I >

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-14 Thread Nathan Bossart
On Wed, Dec 14, 2022 at 12:42:32PM -0500, Tom Lane wrote: > Nathan Bossart writes: >> My first thought is that the latter two uses should be moved to a new >> parameter, and the apply launcher should store the last start time for each >> apply worker like the apply workers do for the table-sync

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-14 Thread Tom Lane
Nathan Bossart writes: > My first thought is that the latter two uses should be moved to a new > parameter, and the apply launcher should store the last start time for each > apply worker like the apply workers do for the table-sync workers. In any > case, it probably makes sense to lower this

Re: Common function for percent placeholder replacement

2022-12-14 Thread Tom Lane
Justin Pryzby writes: > On Wed, Dec 14, 2022 at 08:31:02AM +0100, Peter Eisentraut wrote: >> +return replace_percent_placeholders(base_command, "df", (const char >> *[]){target_detail, filename}); > This is a "compound literal", which I gather is required by C99. > But I don't think that's

Re: Minimal logical decoding on standbys

2022-12-14 Thread Andres Freund
Hi, On 2022-12-14 10:55:31 -0500, Robert Haas wrote: > I read through 0001 again and I noticed this: > > typedef struct xl_heap_prune > { > TransactionId snapshotConflictHorizon; > uint16 nredirected; > uint16 ndead; > +bool

Re: fix and document CLUSTER privileges

2022-12-14 Thread Nathan Bossart
On Thu, Dec 08, 2022 at 04:08:40PM -0500, Robert Haas wrote: > On Thu, Dec 8, 2022 at 1:13 PM Nathan Bossart > wrote: >> Currently, CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX (minus REINDEX >> SCHEMA|DATABASE|SYSTEM) require ownership of the relation or superuser. In >> fact, all three use

Re: Amcheck verification of GiST and GIN

2022-12-14 Thread Robert Haas
On Wed, Dec 14, 2022 at 7:19 AM Jose Arthur Benetasso Villanova wrote: > I'm a bit lost here. I tried your patch again and indeed the > heapallindexed inside gin_check_parent_keys_consistency has a TODO > comment, but it's unclear to me if you are going to implement it or if the > patch "needs

Re: Rework confusing permissions for LOCK TABLE

2022-12-14 Thread Nathan Bossart
On Tue, Dec 13, 2022 at 06:59:48PM -0800, Jeff Davis wrote: > I can't think of any reason for this behavior, and I didn't find an > obvious answer in the last commits to touch that (2ad36c4e44, > fa2642438f). I can't think of a reason, either. > Patch attached to simplify it. It uses the

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Nathan Bossart
On Wed, Dec 14, 2022 at 12:07:13PM +0300, Pavel Luzanov wrote: > I found that granting MAINTAIN privilege does not allow the TOAST table to > be vacuumed. Hm. My first thought is that this is the appropriate behavior. WDYT? > So, the patch for \dpS works as expected and can be committed.

Re: wake up logical workers after ALTER SUBSCRIPTION

2022-12-14 Thread Nathan Bossart
On Tue, Dec 13, 2022 at 04:41:05PM -0800, Nathan Bossart wrote: > On Tue, Dec 13, 2022 at 07:20:14PM -0500, Tom Lane wrote: >> I certainly don't think that "wake the apply launcher every 1ms" >> is a sane configuration. Unless I'm missing something basic about >> its responsibilities, it should

Re: Common function for percent placeholder replacement

2022-12-14 Thread Justin Pryzby
On Wed, Dec 14, 2022 at 08:31:02AM +0100, Peter Eisentraut wrote: > + return replace_percent_placeholders(base_command, "df", (const char > *[]){target_detail, filename}); This is a "compound literal", which I gather is required by C99. But I don't think that's currently being exercised, so

Re: Common function for percent placeholder replacement

2022-12-14 Thread Robert Haas
On Wed, Dec 14, 2022 at 2:31 AM Peter Eisentraut wrote: > There are a number of places where a shell command is constructed with > percent-placeholders (like %x). First, it's obviously cumbersome to > have to open-code this several times. Second, each of those pieces of > code silently encodes

Re: Error-safe user functions

2022-12-14 Thread Tom Lane
Amul Sul writes: > Attaching a complete set of the patches changing function till this > except bpcharin, byteain jsonpath_in that Andrew is planning to look > in. I have skipped reg* functions. I'll take a look at these shortly, unless Andrew is already on it. regards,

Re: Minimal logical decoding on standbys

2022-12-14 Thread Robert Haas
On Wed, Dec 14, 2022 at 8:06 AM Drouvot, Bertrand wrote: > Please find attached v31 with the changes mentioned above (except that I put > your wording into the commit message instead of a README: I think it helps to > make > clear what the "design" for the patch series is). Thanks, I think

Re: static assert cleanup

2022-12-14 Thread Peter Eisentraut
On 11.12.22 23:18, Peter Smith wrote: +StaticAssertDecl(SysCacheSize == (int) lengthof(cacheinfo), + "SysCacheSize does not match syscache.c's array"); + static CatCache *SysCache[SysCacheSize]; In almost every example I found of StaticAssertXXX, the lengthof(arr) part came first in the

Re: Refactor SCRAM code to dynamically handle hash type and key length

2022-12-14 Thread Peter Eisentraut
On 14.12.22 03:38, Michael Paquier wrote: This patch passes check-world and the CI is green. I have tested as well the patch with SCRAM verifiers coming from a server initially on HEAD, so it looks pretty solid seen from here, being careful of memory leaks in the frontend, mainly. The changes

Re: Allow batched insert during cross-partition updates

2022-12-14 Thread Amit Langote
On Wed, Dec 14, 2022 at 6:45 PM Etsuro Fujita wrote: > On Thu, Dec 8, 2022 at 8:01 PM Etsuro Fujita wrote: > > On Thu, Dec 8, 2022 at 5:00 PM Amit Langote wrote: > > > Updated patch attached. > > > > I will review the patch a bit more, but I think > > it would be committable. > > One thing I

Re: Minimal logical decoding on standbys

2022-12-14 Thread Drouvot, Bertrand
Hi, On 12/13/22 5:37 PM, Drouvot, Bertrand wrote: Hi, On 12/13/22 2:50 PM, Robert Haas wrote: On Tue, Dec 13, 2022 at 5:49 AM Drouvot, Bertrand It seems kind of unfortunate to have to add payload to a whole bevy of record types for this feature. I think it's worth it, both because the

Re: Amcheck verification of GiST and GIN

2022-12-14 Thread Jose Arthur Benetasso Villanova
On Sun, 27 Nov 2022, Andrey Borodin wrote: On Sun, Nov 27, 2022 at 1:29 PM Andrey Borodin wrote: I was wrong. GIN check does similar gin_refind_parent() to lock pages in bottom-up manner and truly verify downlink-child_page invariant. Does this mean that we need the adjustment in docs?

Re: Force streaming every change in logical decoding

2022-12-14 Thread Amit Kapila
On Wed, Dec 14, 2022 at 2:15 PM shiy.f...@fujitsu.com wrote: > > Please see the attached patch. I also fix Peter's comments[1]. The GUC name > and > design are still under discussion, so I didn't modify them. > Let me summarize the discussion on name and design till now. As per my

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-12-14 Thread Bharath Rupireddy
On Thu, Nov 17, 2022 at 10:02 PM David Christensen wrote: > > On Wed, Nov 16, 2022 at 3:30 AM Bharath Rupireddy > wrote: > > 1. > > -if (config.filter_by_fpw && !XLogRecordHasFPW(xlogreader_state)) > > +if (config.filter_by_fpw && !XLogRecordHasFPI(xlogreader_state)) > > These

Re: Raising the SCRAM iteration count

2022-12-14 Thread Daniel Gustafsson
> On 14 Dec 2022, at 02:00, Michael Paquier wrote: > > On Tue, Dec 13, 2022 at 12:17:58PM +0100, Daniel Gustafsson wrote: >> It does raise an interesting point though, if we in the future add suppprt >> for >> SCRAM-SHA-512 (which seems reasonable to do) it's not good enough to have a >> single

Re: Inconsistency in reporting checkpointer stats

2022-12-14 Thread Bharath Rupireddy
On Wed, Dec 14, 2022 at 1:02 PM Nitin Jadhav wrote: > > Hi, > > While working on checkpoint related stuff, I have encountered that > there is some inconsistency while reporting checkpointer stats. When a > checkpoint gets completed, a checkpoint complete message gets logged. > This message has a

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

2022-12-14 Thread Amit Kapila
On Wed, Dec 14, 2022 at 4:16 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Horiguchi-san, Amit, > > > > On Tue, Dec 13, 2022 at 7:35 AM Kyotaro Horiguchi > > > wrote: > > > > > > > > At Mon, 12 Dec 2022 18:10:00 +0530, Amit Kapila > > wrote in > > > Yeah, I think ideally it will timeout but if we

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

2022-12-14 Thread Amit Kapila
On Fri, Dec 9, 2022 at 10:49 AM Hayato Kuroda (Fujitsu) wrote: > > Hi Vignesh, > > > In the case of physical replication by setting > > recovery_min_apply_delay, I noticed that both primary and standby > > nodes were getting stopped successfully immediately after the stop > > server command. In

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

2022-12-14 Thread Hayato Kuroda (Fujitsu)
Dear Horiguchi-san, Amit, > > On Tue, Dec 13, 2022 at 7:35 AM Kyotaro Horiguchi > > wrote: > > > > > > At Mon, 12 Dec 2022 18:10:00 +0530, Amit Kapila > wrote in > > Yeah, I think ideally it will timeout but if we have a solution like > > during delay, we keep sending ping messages

Re: slab allocator performance issues

2022-12-14 Thread John Naylor
On Tue, Dec 13, 2022 at 7:50 AM David Rowley wrote: > > Thanks for testing the patch. > > On Mon, 12 Dec 2022 at 20:14, John Naylor wrote: > > While allocation is markedly improved, freeing looks worse here. The proportion is surprising because only about 2% of nodes are freed during the load,

Re: Allow batched insert during cross-partition updates

2022-12-14 Thread Etsuro Fujita
On Thu, Dec 8, 2022 at 8:01 PM Etsuro Fujita wrote: > On Thu, Dec 8, 2022 at 5:00 PM Amit Langote wrote: > > Updated patch attached. > > I will review the patch a bit more, but I think > it would be committable. One thing I noticed is this bit: -- Clean up -DROP TABLE batch_table,

Re: pg_upgrade: Make testing different transfer modes easier

2022-12-14 Thread Daniel Gustafsson
> On 14 Dec 2022, at 08:04, Peter Eisentraut > wrote: > > On 07.12.22 17:33, Peter Eisentraut wrote: >> I think if we want to make this configurable on the fly, and environment >> variable would be much easier, like >> my $mode = $ENV{PG_TEST_PG_UPGRADE_MODE} || '--copy'; > > Here is an

Allow tailoring of ICU locales with custom rules

2022-12-14 Thread Peter Eisentraut
This patch exposes the ICU facility to add custom collation rules to a standard collation. This would allow users to customize any ICU collation to whatever they want. A very simple example from the documentation/tests: CREATE COLLATION en_custom (provider = icu, locale = 'en', rules =

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

2022-12-14 Thread Masahiko Sawada
On Wed, Dec 14, 2022 at 1:20 PM houzj.f...@fujitsu.com wrote: > > On Tuesday, December 13, 2022 11:25 PM Masahiko Sawada > wrote: > > > > On Sun, Dec 11, 2022 at 8:45 PM houzj.f...@fujitsu.com > > wrote: > > > > > > On Friday, December 9, 2022 3:14 PM Amit Kapila > > wrote: > > > > > > > > On

Re: allow granting CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX

2022-12-14 Thread Pavel Luzanov
After a fresh install, including the patch for \dpS [1], I found that granting MAINTAIN privilege does not allow the TOAST table to be vacuumed. postgres@postgres(16.0)=# GRANT MAINTAIN ON pg_type TO alice; GRANT postgres@postgres(16.0)=# \c - alice You are now connected to database "postgres"

RE: Force streaming every change in logical decoding

2022-12-14 Thread shiy.f...@fujitsu.com
On Sat, Dec 10, 2022 2:03 PM Dilip Kumar 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: generic plans and "initial" pruning

2022-12-14 Thread Amit Langote
On Tue, Dec 13, 2022 at 2:24 AM Alvaro Herrera wrote: > On 2022-Dec-12, Amit Langote wrote: > > I started feeling like putting all the new logic being added > > by this patch into plancache.c at the heart of GetCachedPlan() and > > tweaking its API in kind of unintuitive ways may not have been