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

2023-01-23 Thread houzj.f...@fujitsu.com
On Monday, January 23, 2023 11:17 AM Amit Kapila wrote: > > On Fri, Jan 20, 2023 at 11:48 AM Masahiko Sawada > wrote: > > > > > > > > Yet another way is to use the existing parameter logical_decode_mode > > > [1]. If the value of logical_decoding_mode is 'immediate', then we > > > can immediate

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

2023-01-23 Thread Peter Smith
Here are my review comments for v19-0001. == Commit message 1. The combination of parallel streaming mode and min_apply_delay is not allowed. The subscriber in the parallel streaming mode applies each stream on arrival without the time of commit/prepare. So, the subscriber needs to depend on

Re: Support logical replication of DDLs

2023-01-23 Thread Amit Kapila
On Thu, Jan 19, 2023 at 11:24 PM Zheng Li wrote: > > On Thu, Jan 19, 2023 at 2:05 AM Amit Kapila wrote: > > > > > > > > Foreign Tables can also be considered replicated with DDL replication > > > because we > > > don't even need to replicate the data as it resides on the external > > > server. U

Re: Improve GetConfigOptionValues function

2023-01-23 Thread Nitin Jadhav
> The v2 patch looks good to me except the comment around > ConfigOptionIsShowable() which is too verbose. How about just "Return > whether the GUC variable is visible or not."? Sounds good. Updated in the v3 patch attached. > I think you can add it to CF, if not done, to not lose track of it.

Re: Polyphase merge is obsolete

2023-01-23 Thread Heikki Linnakangas
On 16/01/2023 12:23, Peter Eisentraut wrote: On 21.11.22 10:29, Peter Eisentraut wrote: On 21.11.22 00:57, Heikki Linnakangas wrote: On 19/11/2022 13:00, Peter Eisentraut wrote: AFAICT, this thread updated the API of LogicalTapeSetCreate() in PG15, but did not adequately update the function he

Re: pg_stats and range statistics

2023-01-23 Thread Egor Rogov
Hi, On 23.01.2023 02:21, Tomas Vondra wrote: On 1/22/23 22:33, Justin Pryzby wrote: On Sun, Jan 22, 2023 at 07:19:41PM +0100, Tomas Vondra wrote: On 1/21/23 19:53, Egor Rogov wrote: Hi Tomas, On 21.01.2023 00:50, Tomas Vondra wrote: This simply adds two functions, accepting/producing anyarr

RE: Logical replication timeout problem

2023-01-23 Thread houzj.f...@fujitsu.com
On Monday, January 23, 2023 8:51 AM Peter Smith wrote: > > Here are my review comments for patch v4-0001 > == > Commit message > > 2. > > The problem is when there is a DDL in a transaction that generates lots of > temporary data due to rewrite rules, these temporary data will not be > pro

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Jelte Fennema
I whipped up a pre-commit hook which automatically runs pgindent on the changed files in the commit. It won't add any changes automatically, but instead it fails the commit if it made any changes. That way you can add them manually if you want. Or if you don't, you can simply run git commit again w

Re: Improve GetConfigOptionValues function

2023-01-23 Thread Bharath Rupireddy
On Mon, Jan 23, 2023 at 3:29 PM Nitin Jadhav wrote: > > > The v2 patch looks good to me except the comment around > > ConfigOptionIsShowable() which is too verbose. How about just "Return > > whether the GUC variable is visible or not."? > > Sounds good. Updated in the v3 patch attached. > > > I t

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Andrew Dunstan
On 2023-01-22 Su 20:03, Andres Freund wrote: > Hi, > > On 2023-01-22 19:50:10 -0500, Andrew Dunstan wrote: >> On 2023-01-22 Su 18:14, Tom Lane wrote: >>> Jelte Fennema writes: Maybe I'm not understanding your issue correctly, but for such a case you could push two commits at the same t

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

2023-01-23 Thread Amit Kapila
On Mon, Jan 23, 2023 at 1:36 PM Peter Smith wrote: > > Here are my review comments for v19-0001. > ... > > 5. parse_subscription_options > > + /* > + * The combination of parallel streaming mode and min_apply_delay is not > + * allowed. The subscriber in the parallel streaming mode applies each >

Re: heapgettup refactoring

2023-01-23 Thread David Rowley
On Thu, 19 Jan 2023 at 00:04, Peter Eisentraut wrote: > In your v2 patch, you remove these assertions: > > - /* check that rs_cindex is in sync */ > - Assert(scan->rs_cindex < scan->rs_ntuples); > - Assert(lineoff == scan->rs_vistuples[scan->rs_cindex]); > > Is that intentional?

Re: New strategies for freezing, advancing relfrozenxid early

2023-01-23 Thread Dilip Kumar
On Wed, Jan 18, 2023 at 1:47 PM Dilip Kumar wrote: > > On Tue, Jan 17, 2023 at 10:05 AM Peter Geoghegan wrote: My final set of comments for 0002 1. +struct vmsnapshot +{ +/* Target heap rel */ +Relationrel; +/* Scanning strategy used by VACUUM operation */ +vmstrategystr

Re: TAP output format in pg_regress

2023-01-23 Thread Daniel Gustafsson
> On 19 Jan 2023, at 12:14, vignesh C wrote: > The patch does not apply on top of HEAD as in [1], please post a rebased > patch: The attached v16 is a rebase on top of current master which resolves the conflict which came from the recent commit removing the "ignore" functionality. It also fixes

Re: TAP output format in pg_regress

2023-01-23 Thread Daniel Gustafsson
> On 23 Jan 2023, at 12:42, Daniel Gustafsson wrote: > >> On 19 Jan 2023, at 12:14, vignesh C wrote: > >> The patch does not apply on top of HEAD as in [1], please post a rebased >> patch: > > The attached v16 is a rebase on top of current master which resolves the > conflict which came fro

Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16

2023-01-23 Thread Dean Rasheed
On Mon, 23 Jan 2023 at 05:06, John Naylor wrote: > > According to Agner's instruction tables [1], integer division on Skylake (for > example) has a latency of 26 cycles for 32-bit operands, and 42-95 cycles for > 64-bit. > > [1] https://www.agner.org/optimize/instruction_tables.pdf > Thanks, th

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

2023-01-23 Thread Amit Kapila
On Sun, Jan 22, 2023 at 6:12 PM Takamichi Osumi (Fujitsu) wrote: > > > Attached the updated patch v19. > Few comments: = 1. } + + +/* Only one empty line is sufficient between different functions. 2. + if (IsSet(supported_opts, SUBOPT_MIN_APPLY_DELAY) && + opts->min_apply_delay > 0

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Andrew Dunstan
On 2023-01-22 Su 11:18, Tom Lane wrote: > Andrew Dunstan writes: >>> ... btw, can we get away with making the diff run be "diff -upd" >>> not just "diff -u"? I find diff output for C files noticeably >>> more useful with those options, but I'm unsure about their >>> portability. >> I think they

Re: [PATCH] Use 128-bit math to accelerate numeric division, when 8 < divisor digits <= 16

2023-01-23 Thread Dean Rasheed
On Sun, 22 Jan 2023 at 22:49, Joel Jacobson wrote: > > Many thanks for feedback. Nice catch! New patch attached. > Cool, that resolves the performance issues I was seeing for smaller divisors (which also had a noticeable impact on the numeric_big regression test). After some more testing, the ga

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

2023-01-23 Thread Hayato Kuroda (Fujitsu)
Dear Hou, Thank you for updating the patch! Followings are my comments. 1. guc_tables.c ``` static const struct config_enum_entry logical_decoding_mode_options[] = { - {"buffered", LOGICAL_DECODING_MODE_BUFFERED, false}, - {"immediate", LOGICAL_DECODING_MODE_IMMEDIATE, false}, +

Fix incorrect comment reference

2023-01-23 Thread James Coleman
Hello, See the attached for a simple comment fix -- the referenced generate_useful_gather_paths call isn't in grouping_planner it's in apply_scanjoin_target_to_paths. Thanks, James Coleman v1-0001-Fixup-incorrect-comment.patch Description: Binary data

Re: Generating code for query jumbling through gen_node_support.pl

2023-01-23 Thread Peter Eisentraut
On 21.01.23 04:35, Michael Paquier wrote: I'll read the 0003 again more carefully. I haven't studied the new 0004 yet. Thanks, again. Rebased version attached. A couple of small fixes are attached. There is something weird in _jumbleNode(). There are two switch (nodeTag(expr)) statements

Re: Add a test to ldapbindpasswd

2023-01-23 Thread Andrew Dunstan
On 2023-01-04 We 17:33, Andrew Dunstan wrote: > >> This version factors out the creation of the LDAP server into a separate >> perl Module. That makes both the existing test script and the new test >> script a lot shorter, and will be useful for the nearby patch for a hook >> for the ldapbindpass

Re: Parallelize correlated subqueries that execute within each worker

2023-01-23 Thread James Coleman
On Sat, Jan 21, 2023 at 10:07 PM James Coleman wrote: > ... > While working through Tomas's comment about a conditional in the > max_parallel_hazard_waker being guaranteed true I realized that in the > current version of the patch the safe_param_ids tracking in > is_parallel_safe isn't actually ne

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Andrew Dunstan
On 2023-01-23 Mo 05:44, Jelte Fennema wrote: > I whipped up a pre-commit hook which automatically runs pgindent on the > changed files in the commit. It won't add any changes automatically, but > instead it fails the commit if it made any changes. That way you can add > them manually if you want.

Re: Schema variables - new implementation for Postgres 15 (typo)

2023-01-23 Thread Dmitry Dolgov
> On Sun, Jan 22, 2023 at 07:47:07PM +0100, Pavel Stehule wrote: > pá 20. 1. 2023 v 21:35 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > napsal: > > > * I think it was already mentioned in the thread, there seems to be not a > > single usage of CHECK_FOR_INTERRUPTS in session_variable.c . But

old_snapshot_threshold bottleneck on replica

2023-01-23 Thread Maxim Orlov
Hi! One of our customers stumble onto a significant performance degradation while running multiple OLAP-like queries on a replica. After some investigation, it became clear that the problem is in accessing old_snapshot_threshold parameter. Accessing old_snapshot_threshold parameter is guarded by

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Jelte Fennema
Indeed the flags you added are enough. Attached is a patch that adds an updated pre-commit hook with the same behaviour as the one before. I definitely think having a pre-commit hook in the repo is beneficial, since writing one that works in all cases definitely takes some time. > as it's possible

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Tom Lane
I wrote: > Cool. I'll take a look at doing this later (probably after the current > CF) unless somebody beats me to it. Thinking about that (importing pg_bsd_indent into our main source tree) a bit harder: 1. I'd originally thought vaguely that we could teach pgindent how to build pg_bsd_indent

Re: CREATEROLE users vs. role properties

2023-01-23 Thread tushar
On Thu, Jan 19, 2023 at 8:34 PM Robert Haas wrote: > On Thu, Jan 19, 2023 at 6:15 AM tushar > wrote: > > postgres=# create role fff with createrole; > > CREATE ROLE > > postgres=# create role xxx; > > CREATE ROLE > > postgres=# set role fff; > > SET > > postgres=> alter role xxx with createrole;

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

2023-01-23 Thread Melih Mutlu
Hi, Thanks for your review. Attached updated versions of the patches. wangw.f...@fujitsu.com , 17 Oca 2023 Sal, 14:15 tarihinde şunu yazdı: > On Wed, Jan 11, 2023 4:31 PM Melih Mutlu wrote: > v3-0001* patch > === > > 1. typedefs.list > I think we also need to add "walrcv_slot_snapsh

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

2023-01-23 Thread Reid Thompson
On Thu, 2023-01-19 at 16:50 +0530, vignesh C wrote: > > The patch does not apply on top of HEAD as in [1], please post a rebased > patch: > > Regards, > Vignesh rebased patch attached Thanks, Reid From b32a346d6e0e00c568e9a285ad15fc2703998c26 Mon Sep 17 00:00:00 2001 From: Reid Thompson Date

WARNING: outfuncs/readfuncs failed to produce an equal rewritten parse tree

2023-01-23 Thread Pavel Stehule
Hi Last time I wrote new tests for session variables. One is create variable :"DBNAME".public.var as int; On platform with enabled WRITE_READ_PARSE_PLAN_TREES I got warning "WARNING: outfuncs/readfuncs failed to produce an equal rewritten parse tree" After some investigation, I found a probl

Re: Non-decimal integer literals

2023-01-23 Thread Peter Eisentraut
On 13.01.23 11:01, Dean Rasheed wrote: So I'm feeling quite good about the end result -- I set out hoping not to make performance noticeably worse, but ended up making it significantly better. This is great! How do you want to proceed? You also posted an updated patch in the "underscores" th

Re: Improve GetConfigOptionValues function

2023-01-23 Thread Tom Lane
Bharath Rupireddy writes: > LGTM. I've marked it RfC. After looking at this, it seemed to me that the factorization wasn't quite right after all: specifically, the new function could be used in several more places if it confines itself to being a privilege check and doesn't consider GUC_NO_SHOW_A

Re: Non-decimal integer literals

2023-01-23 Thread Dean Rasheed
On Mon, 23 Jan 2023 at 15:55, Peter Eisentraut wrote: > > On 13.01.23 11:01, Dean Rasheed wrote: > > So I'm feeling quite good about the end result -- I set out hoping not > > to make performance noticeably worse, but ended up making it > > significantly better. > > This is great! How do you want

Re: WARNING: outfuncs/readfuncs failed to produce an equal rewritten parse tree

2023-01-23 Thread Tom Lane
Pavel Stehule writes: > After some investigation, I found a problem in the RangeVar node. > The field "catalogname" is setted to NULL in _readRangeVar, but it is > compared in _equalRangeVar function. > I thought so it is problem in my patch, but it looks like generic issue: > create table post

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Sat, Jan 21, 2023 at 5:01 PM Andres Freund wrote: > There are good reasons to have 'peer' authentication set up for the user > running postgres, so admin scripts can connect without issues. Which > unfortunately then also means that postgres_fdw etc can connect to the current > database as supe

Re: WARNING: outfuncs/readfuncs failed to produce an equal rewritten parse tree

2023-01-23 Thread Pavel Stehule
po 23. 1. 2023 v 17:31 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > After some investigation, I found a problem in the RangeVar node. > > > The field "catalogname" is setted to NULL in _readRangeVar, but it is > > compared in _equalRangeVar function. > > > I thought so it is problem i

Re: MERGE ... RETURNING

2023-01-23 Thread Dean Rasheed
On Sun, 22 Jan 2023 at 19:08, Alvaro Herrera wrote: > > > diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c > > new file mode 100644 > > index e34f583..aa3cca0 > > --- a/src/backend/commands/copy.c > > +++ b/src/backend/commands/copy.c > > @@ -274,12 +274,6 @@ DoCopy(ParseStat

Re: real/float example for testlibpq3

2023-01-23 Thread Mark Wong
On Fri, Jan 20, 2023 at 01:12:07PM -0500, Robert Haas wrote: > On Fri, Jan 20, 2023 at 12:58 PM Tom Lane wrote: > > I don't mind if you write something like > > > > A float4 value is a 4-byte IEEE single-precision floating point > > number. It is transmitted in network byte order, so you must

Re: CREATEROLE users vs. role properties

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 10:25 AM tushar wrote: > Please refer to this scenario where I am able to give createrole privileges > but not replication privilege to role > > postgres=# create role t1 createrole; > CREATE ROLE > postgres=# create role t2 replication; > CREATE ROLE > postgres=# create

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread David Geier
Hi, On 1/21/23 05:14, Andres Freund wrote: The elapsed time is already inherently unstable, so we shouldn't have any test output showing the time. But I doubt showing it in every explain is a good idea - we use instr_time in plenty of other places. Why show it in explain, but not in all those o

Re: wake up logical workers after ALTER SUBSCRIPTION

2023-01-23 Thread Nathan Bossart
On Sun, Jan 22, 2023 at 02:12:54PM -0500, Tom Lane wrote: > I pushed v17 with some mostly-cosmetic changes, including more comments. Thanks! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 10:09:06 -0500, Tom Lane wrote: > 1. I'd originally thought vaguely that we could teach pgindent > how to build pg_bsd_indent automatically. But with a little > more consideration, I doubt that would work transparently. > It's common (at least for me) to run pgindent in a distcl

Re: [BUG] Autovacuum not dynamically decreasing cost_limit and cost_delay

2023-01-23 Thread Alvaro Herrera
On 2021-Feb-08, Mead, Scott wrote: > Hello, >I recently looked at what it would take to make a running autovacuum > pick-up a change to either cost_delay or cost_limit. Users frequently > will have a conservative value set, and then wish to change it when > autovacuum initiates a freeze on a

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Sun, Jan 22, 2023 at 8:52 PM Andres Freund wrote: > > Perhaps we should have a way to directly turn on/off authentication > > methods in libpq through API functions and/or options? > > Yes. There's an in-progress patch adding, I think, pretty much what is > required here: > https://www.postgres

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 18:23:17 +0100, David Geier wrote: > On 1/21/23 05:14, Andres Freund wrote: > > The elapsed time is already inherently unstable, so we shouldn't have any > > test > > output showing the time. > > > > But I doubt showing it in every explain is a good idea - we use instr_time >

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Alvaro Herrera
On 2023-Jan-23, Tom Lane wrote: > 1. [...] So now I think that we should > stick to the convention that it's on the user to install > pg_bsd_indent somewhere in their PATH; all we'll be doing with > this change is eliminating the step of fetching pg_bsd_indent's > source files from somewhere else.

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread David Geier
Hi, On 1/21/23 05:12, Andres Freund wrote: We do currently do the conversion quite frequently. Admittedly I was partially motivated by trying to get the per-loop overhead in pg_test_timing down ;) But I think it's a real issue. Places where we do, but shouldn't, convert: - ExecReScan() - quit

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread David Geier
Hi, On 1/21/23 06:31, Andres Freund wrote: I pushed the int64-ification commits. Great. I started rebasing. One thing I was wondering about: why did you chose to use a signed instead of an unsigned 64-bit integer for the ticks? If you have time to look at the pg_test_timing part, it'd be ap

Re: Add LZ4 compression in pg_dump

2023-01-23 Thread Justin Pryzby
On Mon, Jan 23, 2023 at 05:31:55PM +, gkokola...@pm.me wrote: > Please find attached v23 which reintroduces the split. > > 0001 is reworked to have a reduced footprint than before. Also in an attempt > to facilitate the readability, 0002 splits the API's and the uncompressed > implementation i

Re: New strategies for freezing, advancing relfrozenxid early

2023-01-23 Thread Peter Geoghegan
On Mon, Jan 23, 2023 at 3:17 AM Dilip Kumar wrote: > My final set of comments for 0002 Thanks for the review! > I do not understand much use of maintaining these two > 'scanned_pages_lazy' and 'scanned_pages_eager' variables. I think > just maintaining 'scanned_pages' should be sufficient. I d

Re: Schema variables - new implementation for Postgres 15 (typo)

2023-01-23 Thread Pavel Stehule
po 23. 1. 2023 v 15:25 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Sun, Jan 22, 2023 at 07:47:07PM +0100, Pavel Stehule wrote: > > pá 20. 1. 2023 v 21:35 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > > napsal: > > > > > * I think it was already mentioned in the thread, the

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Sat, Jan 21, 2023 at 5:11 PM Andres Freund wrote: > > + /* For all these parameters, the value is a local filename. */ > > + if (strcmp(opt->keyword, "passfile") == 0 || > > + strcmp(opt->keyword, "sslcert") == 0 || > > + strcmp(op

Re: Fix incorrect comment reference

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > See the attached for a simple comment fix -- the referenced > generate_useful_gather_paths call isn't in grouping_planner it's in > apply_scanjoin_target_to_paths. The intended reading of the comment is not clear. Is it telling you to look at

Re: Non-superuser subscription owners

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 11:34:32 -0500, Robert Haas wrote: > I will admit that this is not an open-and-shut case, because a > passwordless login back to the bootstrap superuser account from the > local machine is a pretty common scenario and doesn't feel > intrinsically unreasonable to me, and I hadn't

Re: Non-superuser subscription owners

2023-01-23 Thread Jacob Champion
On Mon, Jan 23, 2023 at 8:35 AM Robert Haas wrote: > I will admit that this is not an open-and-shut case, because a > passwordless login back to the bootstrap superuser account from the > local machine is a pretty common scenario and doesn't feel > intrinsically unreasonable to me, and I hadn't th

Re: Non-superuser subscription owners

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 12:39:50 -0500, Robert Haas wrote: > On Sun, Jan 22, 2023 at 8:52 PM Andres Freund wrote: > > > Perhaps we should have a way to directly turn on/off authentication > > > methods in libpq through API functions and/or options? > > > > Yes. There's an in-progress patch adding, I th

Re: Authentication fails for md5 connections if ~/.postgresql/postgresql.{crt and key} exist

2023-01-23 Thread Jacob Champion
On Sat, Jan 21, 2023 at 4:35 AM Jim Jones wrote: > Well, I see there is indeed a significant overlap between our patches - > but yours has a much more comprehensive approach! If I got it right, > the new slcertmode=disable would indeed cancel the existing certs in > '~/.postgresql/ in case they ex

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 1:26 PM Andres Freund wrote: > > If I'm asked to attempt to connect to a PostgreSQL server, and I > > choose to do that, and the connection succeeds, all I know is that the > > connection actually succeeded. > > Well, there is PQconnectionUsedPassword()... Not that it's a g

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Andrew Dunstan
On 2023-01-23 Mo 09:49, Jelte Fennema wrote: > Attached is a patch > that adds an updated pre-commit hook with the same behaviour > as the one before. I definitely think having a pre-commit hook > in the repo is beneficial, since writing one that works in all > cases definitely takes some time.

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Nikita Malakhov
Hi! I've ran pdindent on the whole Postgres and it'd changed an awful lot of source files. Won't it create a lot of merge conflicts? On Mon, Jan 23, 2023 at 8:48 PM Alvaro Herrera wrote: > On 2023-Jan-23, Tom Lane wrote: > > > 1. [...] So now I think that we should > > stick to the convention t

Re: Add SHELL_EXIT_CODE to psql

2023-01-23 Thread Corey Huinker
On Fri, Jan 20, 2023 at 8:54 AM Robert Haas wrote: > On Wed, Jan 4, 2023 at 2:09 AM Corey Huinker > wrote: > > 2. There are now two psql variables, SHELL_EXIT_CODE, which has the > return code, and SHELL_ERROR, which is a true/false flag based on whether > the exit code was nonzero. These variab

Re: Non-superuser subscription owners

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 10:27:27 -0800, Jacob Champion wrote: > On Mon, Jan 23, 2023 at 8:35 AM Robert Haas wrote: > > I will admit that this is not an open-and-shut case, because a > > passwordless login back to the bootstrap superuser account from the > > local machine is a pretty common scenario and

Re: Add a hook to allow modification of the ldapbindpasswd

2023-01-23 Thread Andrew Dunstan
On 2022-12-19 Mo 11:29, Andrew Dunstan wrote: > This patch, mostly the work of John Naylor, provides a hook whereby a > module can modify the ldapbindpasswd before it is handed to the ldap > server. This is similar in concept to the ssl_passphrase_callback > feature, and allows the user not to hav

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 1:27 PM Jacob Champion wrote: > On Mon, Jan 23, 2023 at 8:35 AM Robert Haas wrote: > > I will admit that this is not an open-and-shut case, because a > > passwordless login back to the bootstrap superuser account from the > > local machine is a pretty common scenario and d

Re: Non-superuser subscription owners

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 2:47 PM Robert Haas wrote: > Second, the reason why I described it as a manufactured issue is > because it's a bit like asking someone to stand under a ladder and > then complaining when they get hit in the head by a falling object. > It's not that I think it's good for peo

Re: Add SHELL_EXIT_CODE to psql

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 1:59 PM Corey Huinker wrote: > SHELL_ERROR is helpful in that it is a ready-made boolean that works for \if > tests in the same way that ERROR is set to true any time SQLSTATE is nonzero. > We don't yet have inline expressions for \if so the ready-made boolean is a > con

Re: Non-decimal integer literals

2023-01-23 Thread Joel Jacobson
On Fri, Jan 13, 2023, at 07:01, Dean Rasheed wrote: > Attachments: > * 0001-Add-non-decimal-integer-support-to-type-numeric.patch Nice! This also simplifies when dealing with non-negative integers represented as byte arrays, common in e.g. cryptography code. Before, one had to implement numeric_

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Tom Lane
Nikita Malakhov writes: > I've ran pdindent on the whole Postgres and it'd changed > an awful lot of source files. Won't it create a lot of merge conflicts? Well, yeah, you've rediscovered the fact that a lot of commits are sloppy about this, and it's been awhile since our last tree-wide pgindent

v16 GRANT role TO role needs a multi-option setting capability

2023-01-23 Thread David G. Johnston
Hey, GRANT role_name [, ...] TO role_specification [, ...] [ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ] [ GRANTED BY role_specification ] It would be really nice to complete this new feature of INHERIT/SET FALSE/TRUE with a multi-specification capability. GRANT role_name

Re: Fix incorrect comment reference

2023-01-23 Thread James Coleman
On Mon, Jan 23, 2023 at 1:26 PM Robert Haas wrote: > > On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > > See the attached for a simple comment fix -- the referenced > > generate_useful_gather_paths call isn't in grouping_planner it's in > > apply_scanjoin_target_to_paths. > > The intended

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 18:49:37 +0100, David Geier wrote: > On 1/21/23 05:12, Andres Freund wrote: > > We do currently do the conversion quite frequently. Admittedly I was > > partially motivated by trying to get the per-loop overhead in pg_test_timing > > down ;) > > > > But I think it's a real issu

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 18:52:44 +0100, David Geier wrote: > One thing I was wondering about: why did you chose to use a signed instead > of an unsigned 64-bit integer for the ticks? That's been the case since my first post in the thread :). Mainly, it seems easier to detect underflow cases during subt

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

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 10:48:38 -0500, Reid Thompson wrote: > On Thu, 2023-01-19 at 16:50 +0530, vignesh C wrote: > > > > The patch does not apply on top of HEAD as in [1], please post a rebased > > patch: > > > > Regards, > > Vignesh > > rebased patch attached I think it's basically still waiting

Re: Add SHELL_EXIT_CODE to psql

2023-01-23 Thread Corey Huinker
On Mon, Jan 23, 2023 at 2:53 PM Robert Haas wrote: > On Mon, Jan 23, 2023 at 1:59 PM Corey Huinker > wrote: > > SHELL_ERROR is helpful in that it is a ready-made boolean that works for > \if tests in the same way that ERROR is set to true any time SQLSTATE is > nonzero. We don't yet have inline

Re: Fix incorrect comment reference

2023-01-23 Thread Robert Haas
On Mon, Jan 23, 2023 at 3:19 PM James Coleman wrote: > On Mon, Jan 23, 2023 at 1:26 PM Robert Haas wrote: > > On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > > > See the attached for a simple comment fix -- the referenced > > > generate_useful_gather_paths call isn't in grouping_planner i

Re: Underscores in numeric literals

2023-01-23 Thread Dean Rasheed
On Wed, 4 Jan 2023 at 09:28, Dean Rasheed wrote: > > In addition, I think that strip_underscores() could then go away if > numeric_in() were made to handle underscores. > > Essentially then, that would move all responsibility for parsing > underscores and non-decimal integers to the datatype input

Re: Non-superuser subscription owners

2023-01-23 Thread Jeff Davis
On Fri, 2023-01-20 at 11:08 -0500, Robert Haas wrote: > On Fri, Jan 20, 2023 at 8:25 AM Robert Haas > wrote: > > I still think you're talking about a different problem here. I'm > > talking about the problem of knowing whether local files are going > > to > > be accessed by the connection string.

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Jelte Fennema
> Not sure if this should go in the git repo or in the developer wiki. I would say the git repo is currently the most fitting place, since it has all the existing docs for pgindent. The wiki even links to the pgindent source directory: https://wiki.postgresql.org/wiki/Developer_FAQ#What.27s_the_fo

Re: Fix incorrect comment reference

2023-01-23 Thread James Coleman
On Mon, Jan 23, 2023 at 3:41 PM Robert Haas wrote: > > On Mon, Jan 23, 2023 at 3:19 PM James Coleman wrote: > > On Mon, Jan 23, 2023 at 1:26 PM Robert Haas wrote: > > > On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > > > > See the attached for a simple comment fix -- the referenced > > >

Re: v16 GRANT role TO role needs a multi-option setting capability

2023-01-23 Thread Pavel Luzanov
On 23.01.2023 23:09, David G. Johnston wrote: GRANT role_name [, ...] TO role_specification [, ...]     [ WITH { ADMIN | INHERIT | SET } { OPTION | TRUE | FALSE } ]     [ GRANTED BY role_specification ] It would be really nice to complete this new feature of INHERIT/SET FALSE/TRUE with a multi-

Re: run pgindent on a regular basis / scripted manner

2023-01-23 Thread Bruce Momjian
On Mon, Jan 23, 2023 at 09:31:36AM -0800, Andres Freund wrote: > As long as we need typedefs.list, I think it'd be good for such a target to > add new typedefs found in the local build to typedefs.list (but *not* remove > old ones, due to platform dependent code). But that's a separate enough > top

Re: Non-decimal integer literals

2023-01-23 Thread Dean Rasheed
On Mon, 23 Jan 2023 at 20:00, Joel Jacobson wrote: > > Nice! This also simplifies when dealing with non-negative integers > represented as byte arrays, > common in e.g. cryptography code. > Ah, interesting. I hadn't thought of that use-case. > create function numeric_from_bytes(bytea) returns n

Re: recovery modules

2023-01-23 Thread Nathan Bossart
On Mon, Jan 23, 2023 at 11:44:57AM +0900, Michael Paquier wrote: > Thanks for the rebase. Thanks for the detailed review. > The final state of the documentation is as follows: > 51. Archive and Recovery Modules > 51.1. Archive Module Initialization Functions > 51.2. Archive Module Callbac

Re: Add SHELL_EXIT_CODE to psql

2023-01-23 Thread Corey Huinker
> > Thanks! But CF bot still not happy. I think, we should address issues from > here https://cirrus-ci.com/task/5391002618298368 > Sure enough, exit codes are shell dependent...adjusted the tests to reflect that. From 237b892e5efe739bc8e75d4af30140520d445491 Mon Sep 17 00:00:00 2001 From: coreyhu

Monotonic WindowFunc support for ntile(), percent_rank() and cume_dist()

2023-01-23 Thread David Rowley
9d9c02ccd [1] added infrastructure in the query planner and executor so that the executor would know to stop processing a monotonic WindowFunc when its value went beyond what some qual in the outer query could possibly match in future evaluations due to the WindowFunc's monotonic nature. In that c

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

2023-01-23 Thread Peter Smith
On Mon, Jan 23, 2023 at 9:44 PM Amit Kapila wrote: > > On Mon, Jan 23, 2023 at 1:36 PM Peter Smith wrote: > > > > Here are my review comments for v19-0001. > > > ... > > > > 5. parse_subscription_options > > > > + /* > > + * The combination of parallel streaming mode and min_apply_delay is not >

Re: Minimal logical decoding on standbys

2023-01-23 Thread Melanie Plageman
I'm new to this thread and subject, but I had a few basic thoughts about the first patch in the set. On Mon, Jan 23, 2023 at 12:03:35PM +0100, Drouvot, Bertrand wrote: > > Please find V42 attached. > > From 3c206bd77831d507f4f95e1942eb26855524571a Mon Sep 17 00:00:00 2001 > From: bdrouvotAWS >

Re: Cygwin cleanup

2023-01-23 Thread Justin Pryzby
On Thu, Jan 12, 2023 at 10:17:55PM -0600, Justin Pryzby wrote: > On Thu, Jan 12, 2023 at 06:43:54PM -0800, Andres Freund wrote: > > > It looks like logical decoding may be the "most wrong" place that > > > wal_sync_method is being used, so maybe my change is reasonable to > > > consider, and not ju

Re: Improve LATERAL join case in test memoize.sql

2023-01-23 Thread David Rowley
On Mon, 16 Jan 2023 at 22:27, Richard Guo wrote: > I happened to notice we have the case in memoize.sql that tests for > memoize node with LATERAL joins, which is > > -- Try with LATERAL joins > SELECT explain_memoize(' > SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1, > LATERAL (SELECT t2.unique1

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

2023-01-23 Thread Euler Taveira
On Sun, Jan 22, 2023, at 9:42 AM, Takamichi Osumi (Fujitsu) wrote: > On Saturday, January 21, 2023 3:36 AM I wrote: > > Kindly have a look at the patch v18. > I've conducted some refactoring for v18. > Now the latest patch should be tidier and > the comments would be clearer and more aligned as a w

Re: Fix incorrect comment reference

2023-01-23 Thread James Coleman
On Mon, Jan 23, 2023 at 4:07 PM James Coleman wrote: > > On Mon, Jan 23, 2023 at 3:41 PM Robert Haas wrote: > > > > On Mon, Jan 23, 2023 at 3:19 PM James Coleman wrote: > > > On Mon, Jan 23, 2023 at 1:26 PM Robert Haas wrote: > > > > On Mon, Jan 23, 2023 at 8:31 AM James Coleman wrote: > > > >

Re: Non-superuser subscription owners

2023-01-23 Thread Jacob Champion
On 1/23/23 11:05, Andres Freund wrote: > There's not enough documentation for SYSTEM_USER imo. If we were to make use of SYSTEM_USER programmatically (and based on what Robert wrote downthread, that's probably not what's desired), I think we'd have to make more guarantees about how it can be parse

Re: Non-superuser subscription owners

2023-01-23 Thread Jacob Champion
On 1/23/23 11:52, Robert Haas wrote: > On Mon, Jan 23, 2023 at 2:47 PM Robert Haas wrote: >> Second, the reason why I described it as a manufactured issue is >> because it's a bit like asking someone to stand under a ladder and >> then complaining when they get hit in the head by a falling object.

Re: Monotonic WindowFunc support for ntile(), percent_rank() and cume_dist()

2023-01-23 Thread Melanie Plageman
On Tue, Jan 24, 2023 at 11:01:08AM +1300, David Rowley wrote: > 9d9c02ccd [1] added infrastructure in the query planner and executor > so that the executor would know to stop processing a monotonic > WindowFunc when its value went beyond what some qual in the outer > query could possibly match in f

Re: Logical replication timeout problem

2023-01-23 Thread Peter Smith
Hi Hou-san, Here are my review comments for v5-0001. == src/backend/replication/logical/reorderbuffer.c 1. @@ -2446,6 +2452,23 @@ ReorderBufferProcessTXN(ReorderBuffer *rb, ReorderBufferTXN *txn, elog(ERROR, "tuplecid value in changequeue"); break; } + + /* + * Sending keepalive message

Re: Cygwin cleanup

2023-01-23 Thread Andres Freund
Hi, On 2023-01-23 17:28:14 -0600, Justin Pryzby wrote: > On Thu, Jan 12, 2023 at 10:17:55PM -0600, Justin Pryzby wrote: > > On Thu, Jan 12, 2023 at 06:43:54PM -0800, Andres Freund wrote: > > > > It looks like logical decoding may be the "most wrong" place that > > > > wal_sync_method is being used

Re: Minimal logical decoding on standbys

2023-01-23 Thread Andres Freund
Hi, On 2023-01-19 10:43:27 +0100, Drouvot, Bertrand wrote: > > > With a reload in place in my testing, now I notice that the catalog_xmin > > > is updated on the primary physical slot after logical slots invalidation > > > when reloading hot_standby_feedback from "off" to "on". > > > > > > This i

  1   2   >