Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Peter Eisentraut
On 23.02.23 07:36, Jim Jones wrote: On 23.02.23 02:52, Peter Smith wrote: Here are my review comments for patch v17-0001. == src/test/regress/sql/xml.sql The blank line(s) which previously separated the xmlserialize tests from the xml IS [NOT] DOCUMENT tests are now missing... v18 adds

Make some xlogreader messages more accurate

2023-02-22 Thread Peter Eisentraut
Here is a small patch to make some invalid-record error messages in xlogreader a bit more accurate (IMO). My starting point was that when you have some invalid WAL, you often get a message like "wanted 24, got 0". This is a bit incorrect, since it really wanted *at least* 24, not exactly 24.

Re: Add SHELL_EXIT_CODE to psql

2023-02-22 Thread Corey Huinker
On Wed, Feb 22, 2023 at 4:18 PM Thomas Munro wrote: > On Tue, Jan 31, 2023 at 9:23 AM Corey Huinker > wrote: > >> Unfortunately, there is a fail in FreeBSD > https://cirrus-ci.com/task/6466749487382528 > >> > >> Maybe, this patch is need to be rebased? > >> > > > > That failure is in

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Jim Jones
On 23.02.23 02:52, Peter Smith wrote: Here are my review comments for patch v17-0001. == src/test/regress/sql/xml.sql The blank line(s) which previously separated the xmlserialize tests from the xml IS [NOT] DOCUMENT tests are now missing... v18 adds a new line in the xml.sql file to

Re: pgindent vs. git whitespace check

2023-02-22 Thread Tom Lane
John Naylor writes: > On Thu, Feb 23, 2023 at 5:03 AM Andrew Dunstan wrote: >> I suspect not allowing // is at least a minor annoyance to any new >> developer we acquire under the age of about 40. > pgindent changes those to our style, so it's not much of an annoyance if > one prefers to type

RE: Allow logical replication to copy tables in binary format

2023-02-22 Thread Hayato Kuroda (Fujitsu)
Dear Jelte, > I don't think it's necessary to check versions. Yes, there are > situations where binary will fail across major versions. But in many > cases it does not. To me it seems the responsibility of the operator > to evaluate this risk. And if the operator chooses wrong and uses > binary

Re: pgindent vs. git whitespace check

2023-02-22 Thread John Naylor
On Thu, Feb 23, 2023 at 5:03 AM Andrew Dunstan wrote: > > I suspect not allowing // is at least a minor annoyance to any new developer we acquire under the age of about 40. pgindent changes those to our style, so it's not much of an annoyance if one prefers to type it that way during

Re: Improving inferred query column names

2023-02-22 Thread Tom Lane
Andres Freund writes: > On 2023-02-22 16:38:51 -0500, Tom Lane wrote: >> The proposal so far was just to handle a function call wrapped >> around something else by converting to the function name followed >> by whatever we'd emit for the something else. > SELECT sum(relpages), sum(reltuples),

Re: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes

2023-02-22 Thread Peter Smith
On Thu, Feb 23, 2023 at 11:28 AM Michael Paquier wrote: > > On Wed, Feb 22, 2023 at 10:21:51AM +, shiy.f...@fujitsu.com wrote: > > Thanks for your reply. Using two flags makes sense to me. > > Attach the updated patch. > > Fine by me as far as it goes. Any thoughts from others? > -- Should

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Peter Smith
Here are my review comments for patch v17-0001. == src/test/regress/sql/xml.sql The blank line(s) which previously separated the xmlserialize tests from the xml IS [NOT] DOCUMENT tests are now missing... e.g. -- indent different encoding (returns UTF-8) SELECT xmlserialize(DOCUMENT '' AS

Re: buildfarm + meson

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 18:23:44 -0500, Andrew Dunstan wrote: > Here's a progress report on adapting the buildfarm client to meson > > There is a development branch where I'm working on the changes. They can be > seen here: > > >

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

2023-02-22 Thread Peter Smith
Patch v6 LGTM. -- Kind Regards, Peter Smith. Fujitsu Australia

Re: XLogReadBufferExtended() vs disconnected segments

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 17:01:47 -0800, Andres Freund wrote: > One way to to defend against this would be to make mdextend(), whenever it > extends into the last block of a segment, unlink the next segment - it can't > be a validly existing contents. But it seems scary to just unlink entire >

XLogReadBufferExtended() vs disconnected segments

2023-02-22 Thread Andres Freund
Hi, I was trying to implement ExtendRelationBufferedTo(), responding to a review comment by Heikki, in https://www.postgresql.org/message-id/2023003152.rh4s75aedj65h...@awork3.anarazel.de Which lead me to stare at the P_NEW do while loop in XLogReadBufferExtended(). I first started to reply

Re: meson and sslfiles.mk in src/test/ssl/

2023-02-22 Thread Michael Paquier
On Wed, Feb 22, 2023 at 11:33:09AM -0800, Andres Freund wrote: > sslfiles.mk doesn't depend on the rest of the buildsystem, and is a rarely > executed command, so I don't see a problem with using make to update the > files. At least for a long while. Agreed to keep things simple for now, even if

Re: "out of relcache_callback_list slots" after multiple calls to pg_logical_slot_get_binary_changes

2023-02-22 Thread Michael Paquier
On Wed, Feb 22, 2023 at 10:21:51AM +, shiy.f...@fujitsu.com wrote: > Thanks for your reply. Using two flags makes sense to me. > Attach the updated patch. Fine by me as far as it goes. Any thoughts from others? -- Michael signature.asc Description: PGP signature

Re: buildfarm + meson

2023-02-22 Thread Michael Paquier
On Wed, Feb 22, 2023 at 06:23:44PM -0500, Andrew Dunstan wrote: > On my Linux box (Fedora 37, where crake runs) I can get a complete run. > There is work to do to make sure we pick up the right log files, and maybe > adjust a module or two. I have adopted a design where instead of trying to > know

Re: We shouldn't signal process groups with SIGQUIT

2023-02-22 Thread Michael Paquier
On Wed, Feb 22, 2023 at 09:39:55AM -0500, Tom Lane wrote: > Michael Paquier writes: >> What would be the advantage of doing that for groups other than >> -StartupPID and -PgArchPID? These are the two groups of processes we >> need to worry about, AFAIK. > > No, we have the issue for regular

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Jim Jones
On 22.02.23 23:45, Peter Smith wrote: src/backend/executor/execExprInterp.c 2. ExecEvalXmlExpr @@ -3829,7 +3829,8 @@ ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op) { Datum*argvalue = op->d.xmlexpr.argvalue; bool*argnull = op->d.xmlexpr.argnull; - + boolindent =

buildfarm + meson

2023-02-22 Thread Andrew Dunstan
Here's a progress report on adapting the buildfarm client to meson There is a development branch where I'm working on the changes. They can be seen here: On my Linux box (Fedora 37, where crake runs) I can get a complete

Re: PG 15 (and to a smaller degree 14) regression due to ExprEvalStep size

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 16:34:44 -0500, Tom Lane wrote: > I wrote: > > Andres Freund writes: > >> Maybe it's worth sticking a StaticAssert() for the struct size > >> somewhere. > > > Indeed. I thought we had one already. > > >> I'm a bit wary about that being too noisy, there are some machines with

Re: [PATCH] Add pretty-printed XML output option

2023-02-22 Thread Peter Smith
Here are some review comments for patch v16-0001. == > src/backend/executor/execExprInterp.c > > 2. ExecEvalXmlExpr > > @@ -3829,7 +3829,8 @@ ExecEvalXmlExpr(ExprState *state, ExprEvalStep *op) >{ >Datum*argvalue = op->d.xmlexpr.argvalue; >bool*argnull =

Re: Improving inferred query column names

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 16:38:51 -0500, Tom Lane wrote: > Vladimir Churyukin writes: > > It doesn't need to be perfect, but it needs to be consistent. So far you > > proposed a rule to replace () with _. What is the plan for expressions, how > > to convert them to names (with deduplication I guess?,

Re: Experiments with Postgres and SSL

2023-02-22 Thread Jacob Champion
On Wed, Feb 22, 2023 at 4:26 AM Heikki Linnakangas wrote: > On 20/01/2023 03:28, Jacob Champion wrote: > > If you want to multiplex protocols on a port, now is an excellent time > > to require clients to use ALPN on implicit-TLS connections. (There are > > no clients that can currently connect

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

2023-02-22 Thread Andres Freund
Hi, On 2023-02-21 11:22:26 -0800, Andres Freund wrote: > On 2023-02-21 18:18:02 +0200, Heikki Linnakangas wrote: > > Do other ReadBufferModes than RBM_ZERO_AND_LOCK make sense with > > ExtendRelationBuffered? > > Hm. That's a a good point. Probably not. Perhaps it could be useful to support >

Re: pgindent vs. git whitespace check

2023-02-22 Thread Andrew Dunstan
On 2023-02-22 We 09:52, Tom Lane wrote: pgindent has never been very kind to non-end-of-line comments, and I'm not excited about working on making it do so. As a thought experiment, what would happen if we reversed course and started allowing "//" comments? Naive conversion of this comment

Re: Improving inferred query column names

2023-02-22 Thread Tom Lane
Vladimir Churyukin writes: > It doesn't need to be perfect, but it needs to be consistent. So far you > proposed a rule to replace () with _. What is the plan for expressions, how > to convert them to names (with deduplication I guess?, because there could > be 2 similar expressions mapped to the

Re: PG 15 (and to a smaller degree 14) regression due to ExprEvalStep size

2023-02-22 Thread Tom Lane
I wrote: > Andres Freund writes: >> Maybe it's worth sticking a StaticAssert() for the struct size >> somewhere. > Indeed. I thought we had one already. >> I'm a bit wary about that being too noisy, there are some machines with >> odd alignment requirements. Perhaps worth restricting the

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

2023-02-22 Thread Melanie Plageman
Hi, So, I attached a rough implementation of both the autovacuum failsafe reverts to shared buffers and the vacuum option (no tests or docs or anything). The first three patches in the set are just for enabling use of shared buffers in failsafe mode for autovacuum. I haven't actually ensured it

Re: Improving inferred query column names

2023-02-22 Thread Vladimir Churyukin
On Wed, Feb 22, 2023, 12:40 PM Andres Freund wrote: > Hi, > > On 2023-02-11 12:47:04 -0800, Vladimir Churyukin wrote: > > That is a good idea for simple cases, I'm just curious how it would look > > like for more complex cases (you can have all kinds of expressions as > > parameters for

Re: Add SHELL_EXIT_CODE to psql

2023-02-22 Thread Thomas Munro
On Tue, Jan 31, 2023 at 9:23 AM Corey Huinker wrote: >> Unfortunately, there is a fail in FreeBSD >> https://cirrus-ci.com/task/6466749487382528 >> >> Maybe, this patch is need to be rebased? >> > > That failure is in postgres_fdw, which this code doesn't touch. > > I'm not able to get to >

Re: [PATCH] Fix unbounded authentication exchanges during PQconnectPoll()

2023-02-22 Thread Jacob Champion
On Wed, Feb 22, 2023 at 11:43 AM Heikki Linnakangas wrote: > I separated the earlier message-length checks so that you get "invalid > invalid authentication request" or "received invalid protocol > negotiation message", depending on whether it was an 'R' or 'v' message. > With that, "invalid

Re: pg_regress: Treat child process failure as test failure

2023-02-22 Thread Tom Lane
Daniel Gustafsson writes: >> On 22 Feb 2023, at 21:33, Andres Freund wrote: >> On 2023-02-22 15:10:11 +0100, Daniel Gustafsson wrote: >>> Rebased patch to handle breakage of v2 due to bd8d453e9b. >> I think we probably should just apply this? The current behaviour doesn't >> seem >> right, and

Re: Wrong query results caused by loss of join quals

2023-02-22 Thread Tom Lane
Richard Guo writes: > On Mon, Feb 20, 2023 at 4:56 AM Tom Lane wrote: >> * I suspect the other use of get_common_eclass_indexes, in >> have_relevant_eclass_joinclause, is broken as well. > It seems have_relevant_joinclause is broken for the presented case. It > does not get a change to call

Re: pg_regress: Treat child process failure as test failure

2023-02-22 Thread Daniel Gustafsson
> On 22 Feb 2023, at 21:33, Andres Freund wrote: > On 2023-02-22 15:10:11 +0100, Daniel Gustafsson wrote: >> Rebased patch to handle breakage of v2 due to bd8d453e9b. > > I think we probably should just apply this? The current behaviour doesn't seem > right, and I don't see a downside of the

Re: Improving inferred query column names

2023-02-22 Thread Andres Freund
Hi, On 2023-02-11 12:47:04 -0800, Vladimir Churyukin wrote: > That is a good idea for simple cases, I'm just curious how it would look > like for more complex cases (you can have all kinds of expressions as > parameters for aggregate function calls). > If it works only for simple cases, I think

Re: Improving inferred query column names

2023-02-22 Thread Andres Freund
Hi, On 2023-02-20 16:08:00 +0100, Peter Eisentraut wrote: > On 11.02.23 20:24, Andres Freund wrote: > I think we should just do it and not care about what breaks. There has > never been any guarantee about these. > > FWIW, "most" other SQL implementations appear to generate column names like >

Re: pg_regress: Treat child process failure as test failure

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 15:10:11 +0100, Daniel Gustafsson wrote: > > On 26 Nov 2022, at 22:46, Daniel Gustafsson wrote: > > > I've moved the statuses[i] check before the differ check, such that there > > is a > > separate block for this not mixed up with the differs check and printing. > > Rebased

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

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 11:18:57 +0200, Heikki Linnakangas wrote: > On 21/02/2023 21:22, Andres Freund wrote: > > On 2023-02-21 18:18:02 +0200, Heikki Linnakangas wrote: > > > Is it ever possible to call this without a relcache entry? WAL redo > > > functions do that with ReadBuffer, but they only

Re: Non-superuser subscription owners

2023-02-22 Thread Joe Conway
On 2/22/23 14:12, Mark Dilger wrote: On Feb 22, 2023, at 10:49 AM, Jeff Davis wrote: On Wed, 2023-02-22 at 09:27 -0800, Mark Dilger wrote: Another option is to execute under the intersection of their privileges, where both the definer and the invoker need the privileges in order for the action

Re: Add SHELL_EXIT_CODE to psql

2023-02-22 Thread Corey Huinker
> > > > The patch set seem to be in a good shape and pretty stable for quite a > while. > Could you add one more minor improvement, a new line after variables > declaration? > As you wish. Attached. > > After this changes, I think, we make this patch RfC, shall we? > > Fingers crossed. From

Re: Rework of collation code, extensibility

2023-02-22 Thread Peter Eisentraut
On 14.02.23 00:45, Jeff Davis wrote: Now the patches are: 0001: pg_strcoll/pg_strxfrm 0002: pg_locale_deterministic() 0003: cleanup a USE_ICU special case 0004: GUCs (only for testing, not for commit) I haven't read the whole thing again, but this arrangement looks good to

Re: [PATCH] Fix unbounded authentication exchanges during PQconnectPoll()

2023-02-22 Thread Heikki Linnakangas
On 22/02/2023 20:49, Jacob Champion wrote: On Tue, Feb 21, 2023 at 12:35 PM Heikki Linnakangas wrote: @@ -3370,6 +3389,7 @@ keep_going: /* We will come back to here until there is /* Get the type of request. */

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Nathan Bossart
On Wed, Feb 22, 2023 at 07:17:37PM +0100, Daniel Gustafsson wrote: >> On 22 Feb 2023, at 19:14, Heikki Linnakangas wrote: > >> How about a new backslash command or psql variable to show how long the >> previous statement took? Something like: >> >> postgres=# select >> ?column? >> --

Re: meson and sslfiles.mk in src/test/ssl/

2023-02-22 Thread Andres Freund
Hi, On 2023-02-22 09:42:54 -0800, Jacob Champion wrote: > I'm happy to contribute cycles to a Meson port when you're ready for > it. From a skim it seems like maybe in-source generation isn't a focus for > Meson [1]. They might encourage us to write custom Python for it anyway? You'd normally

Re: Reducing connection overhead in pg_upgrade compat check phase

2023-02-22 Thread Nathan Bossart
On Wed, Feb 22, 2023 at 10:37:35AM +0100, Daniel Gustafsson wrote: >> On 18 Feb 2023, at 06:46, Nathan Bossart wrote: >> The last 4 are for supported versions and, from a very >> quick glance, seem possible to consolidate. That would bring us to a total >> of 11 separate loops that we could

Re: Non-superuser subscription owners

2023-02-22 Thread Mark Dilger
> On Feb 22, 2023, at 10:49 AM, Jeff Davis wrote: > > On Wed, 2023-02-22 at 09:27 -0800, Mark Dilger wrote: >> Another option is to execute under the intersection of their >> privileges, where both the definer and the invoker need the >> privileges in order for the action to succeed. That

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Pavel Stehule
st 22. 2. 2023 v 18:59 odesílatel Nikolay Samokhvalov napsal: > On Wed, Feb 22, 2023 at 9:55 AM Tom Lane wrote: > >> On the whole I'd rather not eat more of the limited namespace for >> psql prompt codes for this. >> > > It depends on personal preferences. When I work on a large screen, I can >

Re: [PATCH] Fix unbounded authentication exchanges during PQconnectPoll()

2023-02-22 Thread Jacob Champion
On Tue, Feb 21, 2023 at 12:35 PM Heikki Linnakangas wrote: > I don't think the "overlong" or "truncated" bit is helpful. For example, > if the pre-v3.0 error message seems to be "overlong", it's not clear > that's really what happened. More likely, it's just garbage. I think this is maybe a

Re: Non-superuser subscription owners

2023-02-22 Thread Jeff Davis
On Wed, 2023-02-22 at 09:27 -0800, Mark Dilger wrote: > Another option is to execute under the intersection of their > privileges, where both the definer and the invoker need the > privileges in order for the action to succeed.  That would be more > permissive than the proposed SECURITY NONE,

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Kirk Wolak
On Wed, Feb 22, 2023 at 1:14 PM Heikki Linnakangas wrote: > On 22/02/2023 19:59, Nikolay Samokhvalov wrote: > > On Wed, Feb 22, 2023 at 9:55 AM Tom Lane > > wrote: > > > > On the whole I'd rather not eat more of the limited namespace for > > psql prompt codes

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Kirk Wolak
On Wed, Feb 22, 2023 at 12:55 PM Tom Lane wrote: > Kirk Wolak writes: > > Proposal: Simply add the %T (PROMPT variable) to output the current time > > (HH24:MI:SS) into the prompt. > > I'm not really convinced that %`date` isn't a usable solution for this, > especially since it seems like a

allow meson to find ICU in non-standard localtion

2023-02-22 Thread Jeff Davis
I attached a simple patch that allows meson to find ICU in a non- standard location if if you specify -Dextra_lib_dirs and -Dextra_include_dirs. I'm not sure it's the right thing to do though. One downside is that it doesn't output the version that it finds, it only outputs "YES". From

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Pavel Stehule
st 22. 2. 2023 v 19:14 odesílatel Heikki Linnakangas napsal: > On 22/02/2023 19:59, Nikolay Samokhvalov wrote: > > On Wed, Feb 22, 2023 at 9:55 AM Tom Lane > > wrote: > > > > On the whole I'd rather not eat more of the limited namespace for > > psql prompt

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Pavel Stehule
Hi st 22. 2. 2023 v 18:55 odesílatel Tom Lane napsal: > Kirk Wolak writes: > > Proposal: Simply add the %T (PROMPT variable) to output the current time > > (HH24:MI:SS) into the prompt. > > I'm not really convinced that %`date` isn't a usable solution for this, > especially since it seems

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Daniel Gustafsson
> On 22 Feb 2023, at 19:14, Heikki Linnakangas wrote: > How about a new backslash command or psql variable to show how long the > previous statement took? Something like: > > postgres=# select > ?column? > -- > 123 > (1 row) > > postgres=# \time > > Time: 14011.975 ms

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Heikki Linnakangas
On 22/02/2023 19:59, Nikolay Samokhvalov wrote: On Wed, Feb 22, 2023 at 9:55 AM Tom Lane > wrote: On the whole I'd rather not eat more of the limited namespace for psql prompt codes for this. It depends on personal preferences. When I work on a large screen,

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Nikolay Samokhvalov
On Wed, Feb 22, 2023 at 9:55 AM Tom Lane wrote: > On the whole I'd rather not eat more of the limited namespace for > psql prompt codes for this. > It depends on personal preferences. When I work on a large screen, I can afford to spend some characters in prompts, if it gives convenience – and

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Tom Lane
Kirk Wolak writes: > Proposal: Simply add the %T (PROMPT variable) to output the current time > (HH24:MI:SS) into the prompt. I'm not really convinced that %`date` isn't a usable solution for this, especially since it seems like a very niche requirement. The next person who wants it might well

Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Nikolay Samokhvalov
On Wed, Feb 22, 2023 at 9:18 AM Kirk Wolak wrote: > Proposal: Simply add the %T (PROMPT variable) to output the current time > (HH24:MI:SS) into the prompt. This has been in sqlplus since I can > remember, and I find it really useful when I forgot to time something, or > to review for Time

Re: meson and sslfiles.mk in src/test/ssl/

2023-02-22 Thread Jacob Champion
On Wed, Feb 22, 2023 at 5:40 AM Peter Eisentraut wrote: > I think the tradeoff here is, given how rarely those rules are used, is > it worth maintaining duplicate implementations or complicated bridging? > > It's clearly something to deal with eventually, but it's not high priority. Yeah... in

Re: wrong query result due to wang plan

2023-02-22 Thread Tom Lane
Richard Guo writes: > I'm thinking that maybe we can do the strip-the-outer-joins work only > when it's not the top JoinDomain. When we are in the top JoinDomain, it > seems to me that it's safe to push the qual to the top of the tree. Yeah, because there's nothing to commute with. Might as

Re: Allow tailoring of ICU locales with custom rules

2023-02-22 Thread Peter Eisentraut
On 20.02.23 17:30, Daniel Verite wrote: - pg_dump support need to be added for CREATE COLLATION / DATABASE I have added that. - there doesn't seem to be a way to add rules to template1. If someone wants to have icu rules and initial contents to their new databases, I think they need to

Re: Non-superuser subscription owners

2023-02-22 Thread Mark Dilger
> On Feb 22, 2023, at 9:18 AM, Jeff Davis wrote: > > Another option is having some kind SECURITY NONE that would run the > code as a very limited-privilege user that can basically only access > the catalog. That would be useful for running default expressions and > the like without the

Re: Raising the SCRAM iteration count

2023-02-22 Thread Jonathan S. Katz
On 2/22/23 8:39 AM, Daniel Gustafsson wrote: On 17 Dec 2022, at 04:27, Michael Paquier wrote: Superuser-only GUCs should be documented as such, or do you intend to make it user-settable like I suggested upthread :) ? I don't really have strong feelings, so I reverted to being

Re: Non-superuser subscription owners

2023-02-22 Thread Jeff Davis
On Mon, 2023-02-06 at 14:40 -0500, Robert Haas wrote: > On Mon, Feb 6, 2023 at 2:18 PM Andres Freund > wrote: > > It's decidedly not great, yes. I don't know if it's quite a CVE > > type issue, > > after all, the same is true for any other type of query the > > superuser > > executes. But at the

Proposal: %T Prompt parameter for psql for current time (like Oracle has)

2023-02-22 Thread Kirk Wolak
Proposal: Simply add the %T (PROMPT variable) to output the current time (HH24:MI:SS) into the prompt. This has been in sqlplus since I can remember, and I find it really useful when I forgot to time something, or to review for Time spent on a problem, or for how old my session is... I am

Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-22 Thread Nathan Bossart
On Wed, Feb 22, 2023 at 12:30:20PM +0900, Michael Paquier wrote: > Okay, applied and backpatched with a minimal test set, then. I have > kept the tweaks I did to the tests with extra comments. Thanks! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

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

2023-02-22 Thread Nathan Bossart
On Wed, Feb 22, 2023 at 12:40:07PM +, wangw.f...@fujitsu.com wrote: > On Wed, Feb 22, 2023 at 8:37 AM Nathan Bossart > wrote: >> So, even with your patch applied, I don't think the formulas are correct. >> I don't know if it's worth writing out the exact formula, though. It >> doesn't seem

Re: logical decoding and replication of sequences, take 2

2023-02-22 Thread Jonathan S. Katz
On 2/22/23 5:02 AM, Tomas Vondra wrote: On 2/22/23 03:28, Jonathan S. Katz wrote: Thanks for continuing to work on this patch! I tested the latest version and have some feedback/clarifications. Thanks! Also I should mention I've been testing with both async/sync logical replication. I

Re: pgindent vs. git whitespace check

2023-02-22 Thread Tom Lane
Peter Eisentraut writes: > Commit e4602483e95 accidentally introduced a situation where pgindent > disagrees with the git whitespace check. The code is > conn = libpqsrv_connect_params(keywords, values, > /* expand_dbname = */ false, >

Re: pgindent vs. git whitespace check

2023-02-22 Thread Alvaro Herrera
On 2023-Feb-22, Peter Eisentraut wrote: > In the meantime, I suggest we work around this, perhaps by > > conn = libpqsrv_connect_params(keywords, values, /* expand_dbname = > */ false, >PG_WAIT_EXTENSION); I suggest conn =

Re: Add SHELL_EXIT_CODE to psql

2023-02-22 Thread Maxim Orlov
On Mon, 30 Jan 2023 at 23:23, Corey Huinker wrote: > > > I rebased, but there are no code differences. > The patch set seem to be in a good shape and pretty stable for quite a while. Could you add one more minor improvement, a new line after variables declaration? + int

Re: LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Alvaro Herrera
On 2023-Feb-22, Tomas Vondra wrote: > > ... and in there, I wrote that we would first write the brin tuple in > > the regular page, unlock that, and then lock the revmap for the update, > > without holding lock on the data page. I don't remember why we do it > > differently now, but maybe the

Re: We shouldn't signal process groups with SIGQUIT

2023-02-22 Thread Tom Lane
Michael Paquier writes: > What would be the advantage of doing that for groups other than > -StartupPID and -PgArchPID? These are the two groups of processes we > need to worry about, AFAIK. No, we have the issue for regular backends too, since they could be executing COPY FROM PROGRAM or the

Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

2023-02-22 Thread Maxim Orlov
On Tue, 21 Feb 2023 at 16:59, Aleksander Alekseev wrote: > Hi, > > One thing that still bothers me is that during the upgrade we only > migrate the CLOG segments (i.e. pg_xact / pg_clog) and completely > ignore all the rest of SLRUs: > > * pg_commit_ts > * pg_multixact/offsets > *

Re: pg_regress: Treat child process failure as test failure

2023-02-22 Thread Daniel Gustafsson
> On 26 Nov 2022, at 22:46, Daniel Gustafsson wrote: > I've moved the statuses[i] check before the differ check, such that there is a > separate block for this not mixed up with the differs check and printing. Rebased patch to handle breakage of v2 due to bd8d453e9b. -- Daniel Gustafsson

Re: pg_rewind race condition just after promotion

2023-02-22 Thread Heikki Linnakangas
On 11/12/2022 02:01, Ian Lawrence Barwick wrote: 2021年11月9日(火) 20:31 Daniel Gustafsson : On 14 Jul 2021, at 14:03, Aleksander Alekseev wrote: The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested,

Unexpected abort at llvm::report_bad_alloc_error when load JIT library

2023-02-22 Thread Hugo Zhang
Hi hackers, I met a coredump when backend has no enough memory at dlopen which want to allocate memory for libLLVM-10.so.1. #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x7f10bde19859 in __GI_abort () at abort.c:79 #2 0x7f109c24cc33 in

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

2023-02-22 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thank you for reviewing! PSA new version. > I think it would be better to say: "The minimum delay, in > milliseconds, by the publisher before sending all the changes". If you > agree then similar change is required in below comment as well: > + /* > + * The minimum delay, in

Re: Missing cases from SPI_result_code_string()

2023-02-22 Thread Dean Rasheed
On Mon, 20 Feb 2023 at 19:49, Dean Rasheed wrote: > > On Mon, 20 Feb 2023 at 19:39, Tom Lane wrote: > > > > Ugh. Grepping around, it looks like pltcl_process_SPI_result > > is missing a case for SPI_OK_MERGE as well. > > Yes, I was about to post a patch for that too. That's the last case > that

Re: meson and sslfiles.mk in src/test/ssl/

2023-02-22 Thread Peter Eisentraut
On 21.02.23 00:54, Michael Paquier wrote: While playing with the SSL tests last week, I have noticed that we don't have a way to regenerate the SSL files with meson for its TAP suite. It seems to me that we had better transfer the rules currently stored in sslfiles.mk into something that meson

Re: Raising the SCRAM iteration count

2023-02-22 Thread Daniel Gustafsson
> On 17 Dec 2022, at 04:27, Michael Paquier wrote: > > On Thu, Dec 15, 2022 at 12:09:15PM +0100, Daniel Gustafsson wrote: >>> On 15 Dec 2022, at 00:52, Michael Paquier wrote: >>> conn->in_hot_standby = PG_BOOL_UNKNOWN; >>> + conn->scram_iterations = SCRAM_DEFAULT_ITERATIONS; >>> >>>

Re: Seek for helper documents to implement WAL with an FDW

2023-02-22 Thread Peter Eisentraut
On 20.02.23 10:53, Komal Habura wrote:         I have written an FDW, which is similar to the file_fdw. I need the support of WAL to perform logical and stream replication. I have knowledge about custom WAL but do not have clarity about implementing WAL(writing, redo, desc, identify, etc..)

Re: Improving inferred query column names

2023-02-22 Thread Peter Eisentraut
On 20.02.23 16:17, David G. Johnston wrote: I think we should just do it and not care about what breaks.  There has never been any guarantee about these. I'm going to toss a -1 into the ring but if this does go through a strong request that it be disabled via a GUC.  The ugliness of

Re: Ignoring BRIN for HOT updates (was: -udpates seems broken)

2023-02-22 Thread Matthias van de Meent
On Wed, 22 Feb 2023 at 13:15, Tomas Vondra wrote: > > On 2/20/23 19:15, Matthias van de Meent wrote: > > Thanks. Based on feedback, attached is v2 of the patch, with as > > significant changes: > > > > - We don't store the columns we mention in predicates of summarized > > indexes in the

Re: Allow ordered partition scans in more cases

2023-02-22 Thread Ronan Dunklau
Thank you for improving this optimization ! Le mardi 21 février 2023, 04:14:02 CET David Rowley a écrit : > I still need to look to see if there's some small amount of data that > can be loaded into the table to help coax the planner into producing > the ordered scan for this one. It works fine

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

2023-02-22 Thread Melih Mutlu
Hi Wang, Thanks for reviewing. Please see updated patches. [1] wangw.f...@fujitsu.com , 7 Şub 2023 Sal, 10:28 tarihinde şunu yazdı: > 1. In the function ApplyWorkerMain. > I think we need to keep the worker name as "leader apply worker" in the > comment > like the current HEAD. > Done. > I

Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans

2023-02-22 Thread Aleksander Alekseev
Hi, > I'm confused, what exactly is the benefit of this? What extension > performs a direct table scan bypassing the executor, searching for NULLs > or not-NULLs? Basically any extension that accesses the tables without SPI in order to avoid parsing and planning overhead for relatively simple

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

2023-02-22 Thread Melih Mutlu
Hi Shveta, Thanks for reviewing. Please see attached patches. shveta malik , 2 Şub 2023 Per, 14:31 tarihinde şunu yazdı: > On Wed, Feb 1, 2023 at 5:37 PM Melih Mutlu wrote: > for (int64 i = 1; i <= lastusedid; i++) > { > char

meson: Add equivalent of configure --disable-rpath option

2023-02-22 Thread Peter Eisentraut
The configure option --disable-rpath currently has no equivalent in meson. This option is used by packagers, so I think it would be good to have it in meson as well. I came up with the attached patch.From 2677bb5f7f808000e8a04e3b8c3193e3faa4de39 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut

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

2023-02-22 Thread Melih Mutlu
Hi, Melih Mutlu , 16 Şub 2023 Per, 14:37 tarihinde şunu yazdı: > I see that setting originname in the catalog before actually creating it > causes issues. My concern with setting originname when setting the state to > FINISHEDCOPY is that if worker waits until FINISHEDCOPY to update >

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

2023-02-22 Thread wangw.f...@fujitsu.com
On Wed, Feb 22, 2023 at 8:37 AM Nathan Bossart wrote: > On Wed, Feb 15, 2023 at 08:16:43AM +, wangw.f...@fujitsu.com wrote: > > When I refer to the GUC "max_locks_per_transaction", I find that the > description > > of the shared lock table size in pg-doc[1] is inconsistent with the code > >

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

2023-02-22 Thread Hayato Kuroda (Fujitsu)
Dear Katsuragi-san, Thank you for reviewing! New patch set can be available on [1]. > I rethought the pqSocketPoll part. Current interpretation of > arguments seems a little bit confusing because a specific pattern > of arguments has a different meaning. What do you think about > introducing a

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

2023-02-22 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thank you for reviewing! PSA new version. > 1. > PQconnCheck() function allows to check the status of the socket by polling > the socket. This function is currently available only on systems that > support the non-standard POLLRDHUP extension to the poll system call, > including

Re: Experiments with Postgres and SSL

2023-02-22 Thread Heikki Linnakangas
On 20/01/2023 03:28, Jacob Champion wrote: On Wed, Jan 18, 2023 at 7:16 PM Greg Stark wrote: * "Service Mesh" type tools that hide multiple services behind a single host/port ("Service Mesh" is just a new buzzword for "proxy"). If you want to multiplex protocols on a port, now is an

Re: Performance issues with parallelism and LIMIT

2023-02-22 Thread Tomas Vondra
On 2/20/23 19:18, David Geier wrote: > Hi, > > On 2/8/23 11:42, Tomas Vondra wrote: >> On 2/1/23 14:41, David Geier wrote: >> >> Yeah, this is a pretty annoying regression. We already can hit poor >> behavior when matching rows are not distributed uniformly in the tables >> (which is what LIMIT

Re: Ignoring BRIN for HOT updates (was: -udpates seems broken)

2023-02-22 Thread Tomas Vondra
On 2/20/23 19:15, Matthias van de Meent wrote: > Hi, > > On Sun, 19 Feb 2023 at 16:04, Tomas Vondra > wrote: >> >> Hi, >> >> On 2/19/23 02:03, Matthias van de Meent wrote: >>> On Thu, 16 Jun 2022 at 15:05, Tomas Vondra >>> wrote: I've pushed the revert. Let's try again for PG16. >>>

RE: Rework LogicalOutputPluginWriterUpdateProgress

2023-02-22 Thread wangw.f...@fujitsu.com
On Sun, Feb 19, 2023 at 21:06 PM Wang, Wei/王 威 wrote: > On Thur, Feb 14, 2023 at 2:03 AM Andres Freund wrote: > > On 2023-02-13 14:06:57 +0530, Amit Kapila wrote: > > > > > The patch calls update_progress in change_cb_wrapper and other > > > > > wrappers which will miss the case of DDLs that

Re: LWLock deadlock in brinRevmapDesummarizeRange

2023-02-22 Thread Tomas Vondra
On 2/22/23 12:35, Alvaro Herrera wrote: > On 2023-Feb-22, Tomas Vondra wrote: > >> But instead of I almost immediately ran into a LWLock deadlock :-( > > Ouch. > >> I've managed to reproduce this on PG13+, but I believe it's there since >> the brinRevmapDesummarizeRange was introduced in

  1   2   >