Re: pg_upgrade and logical replication

2023-03-03 Thread Amit Kapila
On Thu, Mar 2, 2023 at 4:21 PM Julien Rouhaud wrote: > > On Thu, Mar 02, 2023 at 03:47:53PM +0530, Amit Kapila wrote: > > > > Why don't we try to support the direct upgrade of logical replication > > nodes? Have you tried to analyze what are the obstacles and whether we > > can have solutions for

Re: Move defaults toward ICU in 16?

2023-03-03 Thread Jeff Davis
On Thu, 2023-03-02 at 10:37 +0100, Peter Eisentraut wrote: > I would skip this.  There was a brief discussion about this at [0], > where I pointed out that if we are going to do something like that, > there would be other candidates among the optional dependencies to > promote, such as

Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()

2023-03-03 Thread Bharath Rupireddy
On Sat, Mar 4, 2023 at 8:14 AM Bharath Rupireddy wrote: > > On Sat, Mar 4, 2023 at 8:00 AM Michael Paquier wrote: > > > > On Fri, Mar 03, 2023 at 04:33:39PM -0800, Nathan Bossart wrote: > > > Given both Bharath and I missed this, perhaps we should add a comment > > > about > > > this behavior.

Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()

2023-03-03 Thread Bharath Rupireddy
On Sat, Mar 4, 2023 at 8:00 AM Michael Paquier wrote: > > On Fri, Mar 03, 2023 at 04:33:39PM -0800, Nathan Bossart wrote: > > Given both Bharath and I missed this, perhaps we should add a comment about > > this behavior. > > Makes sense to me to document that in a better way. What about the >

Re: [PoC] Let libpq reject unexpected authentication requests

2023-03-03 Thread Michael Paquier
On Tue, Feb 28, 2023 at 03:38:21PM -0800, Jacob Champion wrote: > 0001 and 0002 are the core features. 0003 is a more future-looking > refactoring of the internals, to make it easier to handle more SASL > mechanisms, but it's not required and contains some unexercised code. I was refreshing my

Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()

2023-03-03 Thread Michael Paquier
On Fri, Mar 03, 2023 at 04:33:39PM -0800, Nathan Bossart wrote: > Given both Bharath and I missed this, perhaps we should add a comment about > this behavior. Makes sense to me to document that in a better way. What about the addition of a short paragraph at the top of XLogFileReadAnyTLI() that

Re: RADIUS tests and improvements

2023-03-03 Thread Thomas Munro
New improved version: * fixed stupid misuse of PG_FINALLY() (oops, must have been thinking of another language) * realised that it was strange to have a GUC for the timeout, and made a new HBA parameter instead * added documentation for that * used TimestampDifferenceMilliseconds() instead of

Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()

2023-03-03 Thread Nathan Bossart
On Fri, Mar 03, 2023 at 01:38:38PM +0530, Bharath Rupireddy wrote: > On Wed, Mar 1, 2023 at 1:46 PM Michael Paquier wrote: >> Well, did you notice 4d894b41? It introduced this change: >> >> - readFile = XLogFileReadAnyTLI(readSegNo, DEBUG2, >> currentSource); >> +

Re: generate_series for timestamptz and time zone problem

2023-03-03 Thread Andreas 'ads' Scherbaum
On 31/01/2023 08:50, Gurjeet Singh wrote: On Mon, Jan 30, 2023 at 4:07 PM Tom Lane wrote: Gurjeet Singh writes: [ generate_series_with_timezone.v6.patch ] The cfbot isn't terribly happy with this. It looks like UBSan is detecting some undefined behavior. Possibly an uninitialized

Re: running logical replication as the subscription owner

2023-03-03 Thread Jelte Fennema
I'm definitely in favor of making it easier to use logical replication in a safe manner. In Citus we need to logically replicate and we're currently using quite some nasty and undocumented hacks to do so: We're creating a subscription per table owner, where each subscription is owned by a

Re: Raising the SCRAM iteration count

2023-03-03 Thread Daniel Gustafsson
> On 27 Feb 2023, at 08:06, Michael Paquier wrote: > + conn->scram_sha_256_iterations = atoi(value); > + } > This should match on "scram_iterations", which is the name of the > GUC. Fixed. > Would the long-term plan be to use multiple variables in conn if > we ever get to : that would

Re: Making empty Bitmapsets always be NULL

2023-03-03 Thread Tom Lane
David Rowley writes: > On Fri, 3 Mar 2023 at 15:17, Tom Lane wrote: >> Another point here is that I'm pretty sure that just about all >> bitmapsets we deal with are only one or two words, so I'm not >> convinced you're going to get any performance win to justify >> the added management overhead.

Re: odd buildfarm failure - "pg_ctl: control file appears to be corrupt"

2023-03-03 Thread Thomas Munro
On Fri, Feb 24, 2023 at 11:12 PM Anton A. Melnikov wrote: > On 17.02.2023 06:21, Thomas Munro wrote: > > BTW there are at least two other places where PostgreSQL already knows > > that concurrent reads and writes are possibly non-atomic (and we also > > don't even try to get the alignment right,

Re: zstd compression for pg_dump

2023-03-03 Thread Jacob Champion
On Fri, Mar 3, 2023 at 10:55 AM Justin Pryzby wrote: > Thanks for looking. If your zstd library is compiled with thread > support, could you also try with :workers=N ? I believe this is working > correctly, but I'm going to ask for help verifying that... Unfortunately not (Ubuntu 20.04):

Re: Schema variables - new implementation for Postgres 15

2023-03-03 Thread Dmitry Dolgov
> On Tue, Feb 28, 2023 at 06:12:50AM +0100, Pavel Stehule wrote: > > fresh rebase I'm continuing to review, this time going through shadowing stuff in transformColumnRef, IdentifyVariable etc. Well, that's a lot of leg work for rather little outcome :) I guess all attempts to simplify this part

Re: SQL JSON path enhanced numeric literals

2023-03-03 Thread Dean Rasheed
On Tue, 28 Feb 2023 at 07:44, Peter Eisentraut wrote: > > Attached is a patch to add nondecimal integer literals and underscores > in numeric literals to the SQL JSON path language. This matches the > recent additions to the core SQL syntax. It follows ECMAScript in > combination with the

Re: Evaluate arguments of correlated SubPlans in the referencing ExprState

2023-03-03 Thread Tom Lane
Andres Freund writes: > On 2023-03-02 13:00:31 -0800, Andres Freund wrote: >> I'm not opposed to EXPR_PARAM_SET, to be clear. I'll send an updated >> version later. I was just thinking about the correctness in the current >> world. > Attached. I've looked through this, and it looks basically OK

Re: meson: Optionally disable installation of test modules

2023-03-03 Thread Andrew Dunstan
On 2023-03-03 Fr 01:47, Peter Eisentraut wrote: On 02.03.23 08:09, Nazir Bilal Yavuz wrote: On Wed, 1 Mar 2023 at 22:21, Peter Eisentraut wrote: Looks good to me.  I did a small pass over it to adjust some namings. For example, I renamed test_install_files to test_install_data, so it's

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Jeroen Vermeulen
Interested, yes. But there may be reasons not to do that. Last time I looked the binary format wasn't documented. Anyway, I tried re-implementing pqGetCopyData3() using the callback. Wasn't hard, but I did have to add a way for the callback to return an error. Kept it pretty dumb for now,

Re: zstd compression for pg_dump

2023-03-03 Thread Justin Pryzby
On Fri, Mar 03, 2023 at 10:32:53AM -0800, Jacob Champion wrote: > On Sat, Feb 25, 2023 at 5:22 PM Justin Pryzby wrote: > > This resolves cfbot warnings: windows and cppcheck. > > And refactors zstd routines. > > And updates docs. > > And includes some fixes for earlier patches that these patches

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Tom Lane
Jeroen Vermeulen writes: > The printf() is just the simplest example that sprang to mind though. > There may be other use-cases out there involving libraries that require > zero-terminated strings, and I figured an ability to set a sentinel could > help those. Well, since it won't help for

Re: libpq-fe.h should compile *entirely* standalone

2023-03-03 Thread Tom Lane
I wrote: > We can easily do better, as attached, but I wonder which other > headers should get the same treatment. After a bit of further research I propose the attached. I'm not sure exactly what subset of ECPG headers is meant to be exposed to clients, but we can adjust these patterns if new

Re: zstd compression for pg_dump

2023-03-03 Thread Jacob Champion
On Sat, Feb 25, 2023 at 5:22 PM Justin Pryzby wrote: > This resolves cfbot warnings: windows and cppcheck. > And refactors zstd routines. > And updates docs. > And includes some fixes for earlier patches that these patches conflicts > with/depends on. This'll need a rebase (cfbot took a while to

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Jeroen Vermeulen
On Fri, 3 Mar 2023 at 18:14, Tom Lane wrote: > Jeroen Vermeulen writes: > > On Fri, 3 Mar 2023 at 17:33, Tom Lane wrote: > >> Let's not do that. Declare it const char *, or maybe better const void > *. > > > Personally I would much prefer "char" over "void" here: > > * It really is a char

Re: pgsql: Harden new test case against force_parallel_mode = regress.

2023-03-03 Thread Tom Lane
Robert Haas writes: > On Fri, Mar 3, 2023 at 12:46 PM Tom Lane wrote: >> Couldn't we install the leader's snapshot into both transactions? > Yeah, maybe that would Just Work. Not sure. Well, IIUC the worker is currently getting a brand new snapshot for its startup transaction, which is exactly

Re: pgsql: Harden new test case against force_parallel_mode = regress.

2023-03-03 Thread Robert Haas
On Fri, Mar 3, 2023 at 12:46 PM Tom Lane wrote: > Couldn't we install the leader's snapshot into both transactions? Yeah, maybe that would Just Work. Not sure. -- Robert Haas EDB: http://www.enterprisedb.com

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Tom Lane
Jelte Fennema writes: > On Fri, 3 Mar 2023 at 17:33, Tom Lane wrote: >> If you mean exposing PQExpBuffer to users of libpq-fe.h, I'd be very >> seriously against that. I realize that libpq exposes it at an ABI >> level, but that doesn't mean we want non-Postgres code to use it. > The code

Re: Fix comments in gistxlogDelete, xl_heap_freeze_page and xl_btree_delete

2023-03-03 Thread Robert Haas
On Fri, Mar 3, 2023 at 11:28 AM Drouvot, Bertrand wrote: > Thanks for having looked at it! +1. Committed. -- Robert Haas EDB: http://www.enterprisedb.com

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Jelte Fennema
On Fri, 3 Mar 2023 at 17:33, Tom Lane wrote: > If you mean exposing PQExpBuffer to users of libpq-fe.h, I'd be very > seriously against that. I realize that libpq exposes it at an ABI > level, but that doesn't mean we want non-Postgres code to use it. The code comment in the pqexpbuffer.h

Re: pgsql: Harden new test case against force_parallel_mode = regress.

2023-03-03 Thread Tom Lane
Robert Haas writes: > On Fri, Mar 3, 2023 at 11:37 AM Tom Lane wrote: >> +ERROR: role "regress_psql_user" does not exist >> +CONTEXT: while setting parameter "session_authorization" to >> "regress_psql_user" > Oh, that's interesting (and sad). A parallel worker has a "startup > transaction"

Re: pgsql: Harden new test case against force_parallel_mode = regress.

2023-03-03 Thread Robert Haas
On Fri, Mar 3, 2023 at 11:37 AM Tom Lane wrote: > The workers were failing at startup, eg (from [1]): > > +ERROR: role "regress_psql_user" does not exist > +CONTEXT: while setting parameter "session_authorization" to > "regress_psql_user" > > Maybe this says that worker startup needs to

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Tom Lane
Jeroen Vermeulen writes: > On Fri, 3 Mar 2023 at 17:33, Tom Lane wrote: >> Let's not do that. Declare it const char *, or maybe better const void *. > Personally I would much prefer "char" over "void" here: > * It really is a char buffer, containing text. Not in binary-mode COPY. > As for

libpq-fe.h should compile *entirely* standalone

2023-03-03 Thread Tom Lane
I realized that headerscheck is failing to enforce $SUBJECT. This is bad, since we aren't really using libpq-fe.h ourselves in a way that would ensure that c.h symbols don't creep into it. We can easily do better, as attached, but I wonder which other headers should get the same treatment.

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Jeroen Vermeulen
On Fri, 3 Mar 2023 at 17:33, Tom Lane wrote: > > If you mean exposing PQExpBuffer to users of libpq-fe.h, I'd be very > seriously against that. I realize that libpq exposes it at an ABI > level, but that doesn't mean we want non-Postgres code to use it. > I also don't see what it'd add for this

Re: pgsql: Harden new test case against force_parallel_mode = regress.

2023-03-03 Thread Tom Lane
I wrote: > The workers were failing at startup, eg (from [1]): argh, forgot to add the link: [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=hippopotamus=2023-03-02%2022%3A31%3A17 regards, tom lane

Re: pgsql: Harden new test case against force_parallel_mode = regress.

2023-03-03 Thread Matthias van de Meent
On Fri, 3 Mar 2023 at 17:16, Robert Haas wrote: > > On Thu, Mar 2, 2023 at 5:47 PM Tom Lane wrote: > > Harden new test case against force_parallel_mode = regress. > > > > Per buildfarm: worker processes can't see a role created in > > the current transaction. > > Now why would that happen?

Re: pgsql: Harden new test case against force_parallel_mode = regress.

2023-03-03 Thread Tom Lane
Robert Haas writes: > On Thu, Mar 2, 2023 at 5:47 PM Tom Lane wrote: >> Per buildfarm: worker processes can't see a role created in >> the current transaction. > Now why would that happen? Surely the snapshot for each command is > passed down from leader to worker, and the worker is not free to

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Tom Lane
Jelte Fennema writes: > Did you try with PQExpBuffer? I still think that probably fits better > in the API design of libpq. If you mean exposing PQExpBuffer to users of libpq-fe.h, I'd be very seriously against that. I realize that libpq exposes it at an ABI level, but that doesn't mean we want

Re: Fix comments in gistxlogDelete, xl_heap_freeze_page and xl_btree_delete

2023-03-03 Thread Drouvot, Bertrand
Hi, On 3/3/23 12:30 PM, Amit Kapila wrote: On Thu, Mar 2, 2023 at 6:35 PM Drouvot, Bertrand wrote: On 1/6/23 11:05 AM, Drouvot, Bertrand wrote: Hi hackers, Please find attached a patch to $SUBJECT. The wrong comments have been discovered by Robert in [1]. Submitting this here as a

Re: Minimal logical decoding on standbys

2023-03-03 Thread Drouvot, Bertrand
Hi, On 3/3/23 8:58 AM, Jeff Davis wrote: On Thu, 2023-03-02 at 11:45 -0800, Jeff Davis wrote: In this case it looks easier to add the right API than to be sure about whether it's needed or not. I attached a sketch of one approach. Oh, that's very cool, thanks a lot! I'm not very

Re: Minimal logical decoding on standbys

2023-03-03 Thread Drouvot, Bertrand
Hi, On 3/2/23 8:45 PM, Jeff Davis wrote: On Thu, 2023-03-02 at 10:20 +0100, Drouvot, Bertrand wrote: Right, but in our case, right after the wakeup (the one due to the CV broadcast, aka the one that will remove it from the wait queue) we'll exit the loop due to: " /* check whether

Re: psql: Add role's membership options to the \du+ command

2023-03-03 Thread David G. Johnston
On Fri, Mar 3, 2023 at 4:01 AM Pavel Luzanov wrote: > Hello, > > On 22.02.2023 00:34, David G. Johnston wrote: > > I didn't even know this function existed. But I see that it was changed in > 3d14e171 with updated documentation: > >

Re: pgsql: Harden new test case against force_parallel_mode = regress.

2023-03-03 Thread Robert Haas
On Thu, Mar 2, 2023 at 5:47 PM Tom Lane wrote: > Harden new test case against force_parallel_mode = regress. > > Per buildfarm: worker processes can't see a role created in > the current transaction. Now why would that happen? Surely the snapshot for each command is passed down from leader to

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Jeroen Vermeulen
Thank you. I meant to try PQExpBuffer — as you say, it fits much better with existing libpq style. But then I hit on the callback idea which was even more efficient, by a fair margin. It was also considerably simpler both inside libpq and in the client code, eliminating all sorts of awkward

Re: Timeline ID hexadecimal format

2023-03-03 Thread Robert Haas
On Tue, Jan 31, 2023 at 2:16 PM Greg Stark wrote: > I don't see any advantage in converting every place where we refer to > timelines into hex and then having to refer to things like timeline > 1A. It doesn't seem any more intuitive to someone understanding what's > going on than referring to

running logical replication as the subscription owner

2023-03-03 Thread Robert Haas
Hi, Here's a patch against master for $SUBJECT. It lacks documentation changes and might have bugs, so please review if you're concerned about this issue. To recap, under CVE-2020-14349, Noah documented that untrusted users shouldn't own tables into which the system is performing logical

Re: libpq: PQgetCopyData() and allocation overhead

2023-03-03 Thread Jelte Fennema
On Thu, 2 Mar 2023 at 20:45, Jeroen Vermeulen wrote: > I'm attaching a diff now. This is not a patch, it's just a discussion piece. Did you try with PQExpBuffer? I still think that probably fits better in the API design of libpq. Obviously if it's significantly slower than the callback approach

Re: Timeline ID hexadecimal format

2023-03-03 Thread Sébastien Lardière
On 02/03/2023 09:12, Peter Eisentraut wrote: On 24.02.23 17:27, Sébastien Lardière wrote: diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index be05a33205..7e26b51031 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -1332,7 +1332,8 @@ restore_command =

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

2023-03-03 Thread Masahiko Sawada
On Thu, Mar 2, 2023 at 1:07 PM Amit Kapila wrote: > > On Thu, Mar 2, 2023 at 7:38 AM Masahiko Sawada wrote: > > > > On Wed, Mar 1, 2023 at 6:21 PM Hayato Kuroda (Fujitsu) > > wrote: > > > > > > > > > > > Apart from a bad-use case example I mentioned, in general, piling up > > > > WAL files due

Re: Missing free_var() at end of accum_sum_final()?

2023-03-03 Thread Dean Rasheed
> On 20.02.23 23:16, Joel Jacobson wrote: > > In the new attached patch, Andres fixed buffer idea has been implemented > > throughout the entire numeric.c code base. > I have been going over this patch, and IMO it's far too invasive for the fairly modest performance gains (and performance

Re: Non-superuser subscription owners

2023-03-03 Thread Robert Haas
On Wed, Mar 1, 2023 at 7:34 PM Andres Freund wrote: > ISTM that this would require annotating most functions in the system. There's > many problems besides accessing database contents. Just a few examples: > > - dblink functions to access another system / looping back > -

Re: [EXTERNAL] Re: Support load balancing in libpq

2023-03-03 Thread Jelte Fennema
> I want to note that the Fisher-Yates algorithm is implemented in a > difficult to understand manner. > +if (j < i) /* avoid fetching undefined data if j=i */ > This stuff does not make sense in case of shuffling arrays inplace. It > is important only for making a new copy of an array and only in

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

2023-03-03 Thread Önder Kalacı
Hi Hayato, Amit, all > > > ``` > + /* Build scankey for every non-expression attribute in the index. > */ > ``` > > I think that single line comments should not terminated by ".". > Hmm, looking into execReplication.c, many of the single line comments terminated by ".". Also, On the

Re: Testing autovacuum wraparound (including failsafe)

2023-03-03 Thread Heikki Linnakangas
On 03/03/2023 13:34, Heikki Linnakangas wrote: On 16/11/2022 06:38, Ian Lawrence Barwick wrote: Thanks for the patch. While reviewing the patch backlog, we have determined that the latest version of this patch was submitted before meson support was implemented, so it should have a "meson.build"

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2023-03-03 Thread Bharath Rupireddy
On Wed, Mar 1, 2023 at 9:45 AM Nathan Bossart wrote: > > On Tue, Feb 28, 2023 at 10:38:31AM +0530, Bharath Rupireddy wrote: > > On Tue, Feb 28, 2023 at 6:14 AM Nathan Bossart > > wrote: > >> Why do we only read a page at a time in XLogReadFromBuffersGuts()? What is > >> preventing us from

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

2023-03-03 Thread Önder Kalacı
Hi Vignesh, Thanks for the review > 1) We are currently calling RelationGetIndexList twice, once in > FindUsableIndexForReplicaIdentityFull function and in the caller too, > we could avoid one of the calls by passing the indexlist to the > function or removing the check here, index list check

Re: Allow tailoring of ICU locales with custom rules

2023-03-03 Thread Peter Eisentraut
On 02.03.23 16:39, Laurenz Albe wrote: On Wed, 2023-02-22 at 18:35 +0100, Peter Eisentraut wrote: - 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 create a custom template database

What's MultiXactId?

2023-03-03 Thread jack...@gmail.com
in src/include/access/htup_details.h, I find out this: #define HEAP_XMAX_IS_MULTI 0x1000 /* t_xmax is a MultiXactId */ what's MultiXactId? Can you give me a scenario to make this bit as 1? jack...@gmail.com

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

2023-03-03 Thread Hayato Kuroda (Fujitsu)
Hi Katsuragi-san, Thank you for reviewing! PSA new version. > >> 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 new argument

Re: Add support for unit "B" to pg_size_pretty()

2023-03-03 Thread Dean Rasheed
On Fri, 3 Mar 2023 at 11:23, David Rowley wrote: > > On Fri, 3 Mar 2023 at 09:32, Dean Rasheed wrote: > > Hmm, I think it would be easier to just have a separate table for > > pg_size_bytes(), rather than reusing pg_size_pretty()'s table. > > Maybe that's worthwhile if we were actually thinking

Re: Missing update of all_hasnulls in BRIN opclasses

2023-03-03 Thread Tomas Vondra
On 3/3/23 11:32, Alvaro Herrera wrote: > > Thanks for doing all this. (Do I understand correctly that this patch > is not in the commitfest?) > > I think my mental model for this was that "allnulls" meant that either > there are no values for the column in question or that the values were >

Re: Allow ordered partition scans in more cases

2023-03-03 Thread David Rowley
On Thu, 23 Feb 2023 at 02:10, Ronan Dunklau wrote: > I haven't looked too deeply into it, but it seems reasonable that the whole > sort would cost cheaper than individual sorts on partitions + incremental > sorts, except when the the whole sort would spill to disk much more than the > incremental

Re: Testing autovacuum wraparound (including failsafe)

2023-03-03 Thread Heikki Linnakangas
On 16/11/2022 06:38, Ian Lawrence Barwick wrote: Thanks for the patch. While reviewing the patch backlog, we have determined that the latest version of this patch was submitted before meson support was implemented, so it should have a "meson.build" file added for consideration for inclusion in

Re: Fix comments in gistxlogDelete, xl_heap_freeze_page and xl_btree_delete

2023-03-03 Thread Amit Kapila
On Thu, Mar 2, 2023 at 6:35 PM Drouvot, Bertrand wrote: > > On 1/6/23 11:05 AM, Drouvot, Bertrand wrote: > > Hi hackers, > > > > Please find attached a patch to $SUBJECT. > > > > The wrong comments have been discovered by Robert in [1]. > > > > Submitting this here as a separate thread so it does

Re: Add support for unit "B" to pg_size_pretty()

2023-03-03 Thread David Rowley
On Fri, 3 Mar 2023 at 09:32, Dean Rasheed wrote: > Hmm, I think it would be easier to just have a separate table for > pg_size_bytes(), rather than reusing pg_size_pretty()'s table. I.e., > size_bytes_units[], which would only need name and multiplier columns > (not round and limit). Done that

Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()

2023-03-03 Thread Michael Paquier
On Fri, Mar 03, 2023 at 01:38:38PM +0530, Bharath Rupireddy wrote: > I will withdraw the patch proposed in this thread. Okay, thanks for confirming. -- Michael signature.asc Description: PGP signature

Re: Add documentation for coverage reports with meson

2023-03-03 Thread Michael Paquier
On Fri, Mar 03, 2023 at 10:10:15AM +0100, Peter Eisentraut wrote: > genhtml is part of the lcov package. I think it would be confusing to > mention it explicitly, since you won't be able to find it as something to > install. Maybe leave the original list and change "programs" to "packages"?

Re: Deduplicate logicalrep_read_tuple()

2023-03-03 Thread Amit Kapila
On Fri, Mar 3, 2023 at 4:13 PM Bharath Rupireddy wrote: > > On Thu, Jan 19, 2023 at 8:36 AM Peter Smith wrote: > > > > On Wed, Jan 18, 2023 at 6:26 PM Bharath Rupireddy > > wrote: > > > > > > Hi, > > > > > > logicalrep_read_tuple() duplicates code for LOGICALREP_COLUMN_TEXT and > > >

Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-03-03 Thread John Naylor
On Wed, Mar 1, 2023 at 6:59 PM Masahiko Sawada wrote: > > On Wed, Mar 1, 2023 at 3:37 PM John Naylor wrote: > > > > I think we're trying to solve the wrong problem here. I need to study this more, but it seems that code that needs to stay within a memory limit only needs to track what's been

Re: psql: Add role's membership options to the \du+ command

2023-03-03 Thread Pavel Luzanov
Hello, On 22.02.2023 00:34, David G. Johnston wrote: I didn't even know this function existed. But I see that it was changed in 3d14e171 with updated documentation: https://www.postgresql.org/docs/devel/functions-info.html#FUNCTIONS-INFO-ACCESS Maybe that's enough. I think that should

Re: cataloguing NOT NULL constraints

2023-03-03 Thread Alvaro Herrera
On 2023-Mar-03, Peter Eisentraut wrote: > On 28.02.23 20:15, Alvaro Herrera wrote: > > So I reworked this to use a new contype value for the NOT NULL > > pg_constraint rows; I attach it here. I think it's fairly clean. > > > > 0001 is just a trivial change that seemed obvious as soon as I ran

Re: Deduplicate logicalrep_read_tuple()

2023-03-03 Thread Bharath Rupireddy
On Thu, Jan 19, 2023 at 8:36 AM Peter Smith wrote: > > On Wed, Jan 18, 2023 at 6:26 PM Bharath Rupireddy > wrote: > > > > Hi, > > > > logicalrep_read_tuple() duplicates code for LOGICALREP_COLUMN_TEXT and > > LOGICALREP_COLUMN_BINARY introduced by commit 9de77b5. While it > > doesn't hurt

Re: min/max aggregation for jsonb

2023-03-03 Thread David Rowley
On Fri, 3 Mar 2023 at 23:17, Daneel Yaitskov wrote: > I wanted to use min/max aggregation functions for jsonb type and noticed > there is no functions for this type, meanwhile string/array types are > supported. It's not really clear to me how you'd want these to sort. If you just want to sort

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

2023-03-03 Thread Amit Kapila
On Fri, Mar 3, 2023 at 3:02 PM Önder Kalacı wrote: >> >> 7. >> - /* Build scankey for every attribute in the index. */ >> - for (attoff = 0; attoff < >> IndexRelationGetNumberOfKeyAttributes(idxrel); attoff++) >> + /* Build scankey for every non-expression attribute in the index. */ >> + for

Re: Missing update of all_hasnulls in BRIN opclasses

2023-03-03 Thread Alvaro Herrera
Thanks for doing all this. (Do I understand correctly that this patch is not in the commitfest?) I think my mental model for this was that "allnulls" meant that either there are no values for the column in question or that the values were all nulls (For minmax without NULL handling, which is

min/max aggregation for jsonb

2023-03-03 Thread Daneel Yaitskov
Hi, I wanted to use min/max aggregation functions for jsonb type and noticed there is no functions for this type, meanwhile string/array types are supported. Is there a concern about implementing support for jsonb in min/max? jsonb is a byte array. json faces same limitations. -- Best

Re: cataloguing NOT NULL constraints

2023-03-03 Thread Peter Eisentraut
On 28.02.23 20:15, Alvaro Herrera wrote: So I reworked this to use a new contype value for the NOT NULL pg_constraint rows; I attach it here. I think it's fairly clean. 0001 is just a trivial change that seemed obvious as soon as I ran into the problem. This looks harmless enough, but I

Re: meson: Non-feature feature options

2023-03-03 Thread Nazir Bilal Yavuz
Hi, On Fri, 3 Mar 2023 at 12:16, Peter Eisentraut wrote: > > On 02.03.23 11:41, Nazir Bilal Yavuz wrote: > > I am kind of confused. I added these checks for considering other SSL > > implementations in the future, for this reason I have two nested if > > checks. The top one is for checking if we

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

2023-03-03 Thread Önder Kalacı
Hi Amit, all > Few comments on 0001 > > 1. > + such suitable indexes, the search on the subscriber s ide can be > very inefficient, > > unnecessary space in 'side' > Fixed in v28 > > 2. > - identity. If the table does not have any suitable key, then it can be > set >

Re: meson: Non-feature feature options

2023-03-03 Thread Peter Eisentraut
On 02.03.23 11:41, Nazir Bilal Yavuz wrote: I am kind of confused. I added these checks for considering other SSL implementations in the future, for this reason I have two nested if checks. The top one is for checking if we need to search an SSL library and the nested one is for checking if we

Re: Add documentation for coverage reports with meson

2023-03-03 Thread Peter Eisentraut
On 28.02.23 09:49, Michael Paquier wrote: -when compiling with GCC, and it requires the gcov -and lcov programs. +when compiling with GCC, and it requires the gcov, +lcov and genhtml programs. genhtml is part of the lcov package. I think it would be confusing to mention it

Re: In-placre persistance change of a relation

2023-03-03 Thread Kyotaro Horiguchi
At Wed, 1 Mar 2023 14:56:25 -0500, "Gregory Stark (as CFM)" wrote in > On Mon, 6 Feb 2023 at 23:48, Kyotaro Horiguchi > wrote: > > > > Thank you for the comment! > > > > At Fri, 3 Feb 2023 08:42:52 +0100, Heikki Linnakangas > > wrote in > > > I want to call out this part of this patch: > >

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

2023-03-03 Thread Hayato Kuroda (Fujitsu)
Dear Önder, Thanks for updating the patch! I played with your patch and I confirmed that parallel apply worker and tablesync worker could pick the index in typical case. Followings are comments for v27-0001. Please ignore if it is fixed in newer one. execReplication.c ``` + /* Build

Re: Simplify standby state machine a bit in WaitForWALToBecomeAvailable()

2023-03-03 Thread Bharath Rupireddy
On Wed, Mar 1, 2023 at 1:46 PM Michael Paquier wrote: > > On Tue, Jan 03, 2023 at 02:53:10PM +0530, Bharath Rupireddy wrote: > > The proposed patch makes the inherent state change to pg_wal after > > failure to read from archive in XLogFileReadAnyTLI() to explicit by > > setting currentSource to

Re: Flush SLRU counters in checkpointer process

2023-03-03 Thread Anthonin Bonnefoy
Here's the patch rebased with Andres' suggestions. Happy to update it if there's any additionalj change required. On Wed, Mar 1, 2023 at 8:46 PM Gregory Stark (as CFM) wrote: > On Thu, 12 Jan 2023 at 03:46, Anthonin Bonnefoy > wrote: > > > > > > That would make sense. I've created a new patch