Re: pg_rewind WAL segments deletion pitfall

2022-08-30 Thread Kyotaro Horiguchi
At Wed, 31 Aug 2022 14:30:31 +0900 (JST), Kyotaro Horiguchi wrote in > What do you think about that? By the way don't you add an CF entry for this? -- Kyotaro Horiguchi NTT Open Source Software Center

Re: pg_rewind WAL segments deletion pitfall

2022-08-30 Thread Kyotaro Horiguchi
At Tue, 30 Aug 2022 11:01:58 +0200, Alexander Kukushkin wrote in > On Tue, 30 Aug 2022 at 10:27, Kyotaro Horiguchi > wrote: > > > > > Hmm. Doesn't it work to ignoring tli then? All segments that their > > segment number is equal to or larger than the checkpoint locaiton are > > preserved

Re: New strategies for freezing, advancing relfrozenxid early

2022-08-30 Thread Peter Geoghegan
On Tue, Aug 30, 2022 at 9:37 PM Jeff Davis wrote: > On Tue, 2022-08-30 at 18:50 -0700, Peter Geoghegan wrote: > > Since VM snapshots are immutable, it should be relatively > > easy to have the implementation make its final decision on skipping > > only *after* lazy_scan_heap() returns. > > I like

Re: New strategies for freezing, advancing relfrozenxid early

2022-08-30 Thread Jeff Davis
On Tue, 2022-08-30 at 18:50 -0700, Peter Geoghegan wrote: > Since VM snapshots are immutable, it should be relatively > easy to have the implementation make its final decision on skipping > only *after* lazy_scan_heap() returns. I like this idea. Regards, Jeff Davis

Re: Schema variables - new implementation for Postgres 15

2022-08-30 Thread Pavel Stehule
st 24. 8. 2022 v 10:04 odesílatel Erik Rijkers napsal: > Op 24-08-2022 om 08:37 schreef Pavel Stehule: > >> > > > > I fixed these. > > > > > [v20220824-1-*.patch] > > Hi Pavel, > > I noticed just now that variable assignment (i.e., LET) unexpectedly > (for me anyway) cast the type of the input

Re: [PATCH] Optimize json_lex_string by batching character copying

2022-08-30 Thread Nathan Bossart
On Wed, Aug 31, 2022 at 10:50:39AM +0700, John Naylor wrote: > Here's the final piece. I debated how many tests to add and decided it > was probably enough to add one each for checking quotes and > backslashes in the fast path. There is one cosmetic change in the > code: Before, the vectorized

Re: effective_multixact_freeze_max_age issue

2022-08-30 Thread Nathan Bossart
On Tue, Aug 30, 2022 at 05:24:17PM -0700, Peter Geoghegan wrote: > Attached is v2, which cleans up the structure of > vacuum_set_xid_limits() a bit more. The overall idea was to improve > the overall flow/readability of the function by moving the WARNINGs > into their own "code stanza", just after

Re: [PATCH] Optimize json_lex_string by batching character copying

2022-08-30 Thread John Naylor
On Tue, Aug 23, 2022 at 1:03 PM John Naylor wrote: > > LGTM overall. My plan is to split out the json piece, adding tests for > that, and commit the infrastructure for it fairly soon. Here's the final piece. I debated how many tests to add and decided it was probably enough to add one each for

Re: Stack overflow issue

2022-08-30 Thread Richard Guo
On Wed, Aug 31, 2022 at 6:57 AM Tom Lane wrote: > I wrote: > > The upstream recommendation, which seems pretty sane to me, is to > > simply reject any string exceeding some threshold length as not > > possibly being a word. Apparently it's common to use thresholds > > as small as 64 bytes, but

Re: New strategies for freezing, advancing relfrozenxid early

2022-08-30 Thread Peter Geoghegan
On Tue, Aug 30, 2022 at 1:45 PM Peter Geoghegan wrote: > > d. Can you help give me a sense of scale of the problems solved by > > visibilitymap snapshots and the cost model? Do those need to be in v1? > > I'm not sure. I think that having certainty that we'll be able to scan > only so many pages

Re: [PATCH] Add native windows on arm64 support

2022-08-30 Thread Tom Lane
Michael Paquier writes: > Hence, I am wondering if the solution here > would be to do one xmlXPathNodeSetSort(xpathobj->nodesetval) after > compiling the path with xmlXPathCompiledEval() in XmlTableGetValue(). Hmm, I see that function declared in , which sure doesn't give me a warm feeling that

Re: effective_multixact_freeze_max_age issue

2022-08-30 Thread Peter Geoghegan
On Mon, Aug 29, 2022 at 3:40 PM Nathan Bossart wrote: > Agreed. Attached is v2, which cleans up the structure of vacuum_set_xid_limits() a bit more. The overall idea was to improve the overall flow/readability of the function by moving the WARNINGs into their own "code stanza", just after the

Re: [PATCH] Add native windows on arm64 support

2022-08-30 Thread Michael Paquier
On Tue, Aug 30, 2022 at 08:07:27PM -0400, Tom Lane wrote: > It seems like maybe we're relying on an ordering we should not. > Yet surely the ordering of the pieces of this output is meaningful? > Are we using the wrong libxml API to create this result? > > Anyway, I'm now suspicious that we've

Re: [PATCH] Add native windows on arm64 support

2022-08-30 Thread Michael Paquier
On Wed, Aug 31, 2022 at 08:36:01AM +0900, Michael Paquier wrote: > There have been more failures, always switching the input from > "predeeppost" > to "predeeppost". > > Using a PATH of node() influences the output. I am not verse unto > XMLTABLE, but could it be an issue where each node is

Re: [PATCH] Add native windows on arm64 support

2022-08-30 Thread Tom Lane
Michael Paquier writes: > Using a PATH of node() influences the output. I am not verse unto > XMLTABLE, but could it be an issue where each node is parsed and we > have something like a qsort() applied on the pointer addresses for > each part or something like that, causing the output to become

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

2022-08-30 Thread Peter Smith
Here are some review comments for the patch v9-0001: == 1. Commit message 1a. With this patch, I'm proposing the following change: If there is an index on the subscriber, use the index as long as the planner sub-modules picks any index over sequential scan. The index should be a btree

Re: [PATCH] Add native windows on arm64 support

2022-08-30 Thread Michael Paquier
On Mon, Aug 29, 2022 at 10:00:10PM -0400, Tom Lane wrote: > Michael Paquier writes: > > On Mon, Aug 29, 2022 at 05:33:56PM -0700, Andres Freund wrote: > >> The weirdest part is that it only happens as part of the the pg_upgrade > >> test. > > > make check has just failed: > >

Re: Stack overflow issue

2022-08-30 Thread Tom Lane
I wrote: > The upstream recommendation, which seems pretty sane to me, is to > simply reject any string exceeding some threshold length as not > possibly being a word. Apparently it's common to use thresholds > as small as 64 bytes, but in the attached I used 1000 bytes. On further thought: that

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread David Rowley
On Wed, 31 Aug 2022 at 02:17, Tom Lane wrote: > > I wrote: > > So maybe we should revisit the question. It'd be worth collecting some > > stats about how much extra space would be needed if we force there > > to be room for a sentinel. > > Actually, after ingesting more caffeine, the problem

Re: Comma-separated predicates in simple CASE expressions (f263)

2022-08-30 Thread Daniel Gustafsson
> On 31 Aug 2022, at 00:20, Tom Lane wrote: > > Daniel Gustafsson writes: >> I was looking at F263 from the SQL standard, Comma-separated predicates in >> simple CASE expression, and thinking if we could support this within the >> framework we already have at a minimal added cost. The attached

Re: introduce bufmgr hooks

2022-08-30 Thread Nathan Bossart
Thanks for taking a look. On Tue, Aug 30, 2022 at 01:02:20PM +0900, Kyotaro Horiguchi wrote: > smgr is an abstract interface originally intended to allow to choose > one implementation among several (though cannot dynamically). Even > though the patch intends to replace specific (but most of all)

Re: Comma-separated predicates in simple CASE expressions (f263)

2022-08-30 Thread Tom Lane
Daniel Gustafsson writes: > I was looking at F263 from the SQL standard, Comma-separated predicates in > simple CASE expression, and thinking if we could support this within the > framework we already have at a minimal added cost. The attached sketch diff > turns each predicate in the list into

Comma-separated predicates in simple CASE expressions (f263)

2022-08-30 Thread Daniel Gustafsson
I was looking at F263 from the SQL standard, Comma-separated predicates in simple CASE expression, and thinking if we could support this within the framework we already have at a minimal added cost. The attached sketch diff turns each predicate in the list into a CaseWhen node and uses the

Re: replacing role-level NOINHERIT with a grant-level option

2022-08-30 Thread Nathan Bossart
On Tue, Aug 30, 2022 at 08:33:46AM -0400, Robert Haas wrote: > Third try. Now that I have this grantor stuff fresh in my mind, this patch looks good to me. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: replacing role-level NOINHERIT with a grant-level option

2022-08-30 Thread Nathan Bossart
On Tue, Aug 30, 2022 at 03:24:56PM -0400, Robert Haas wrote: > - william => charles => elizabeth => uk is OK because the first two > hops have ADMIN and the last hop has INHERIT Don't you mean the first two hops have INHERIT and the last has ADMIN? > - william => charles => elizabeth => uk =>

Re: Slight refactoring of state check in pg_upgrade check_ function

2022-08-30 Thread Bruce Momjian
On Sun, Aug 28, 2022 at 03:06:09PM -0700, Nathan Bossart wrote: > On Sun, Aug 28, 2022 at 10:42:24PM +0200, Daniel Gustafsson wrote: > > I noticed that the pg_upgrade check_ functions were determining failures > > found > > in a few different ways. Some keep a boolen flag variable, and some

Re: New strategies for freezing, advancing relfrozenxid early

2022-08-30 Thread Peter Geoghegan
On Tue, Aug 30, 2022 at 11:11 AM Jeff Davis wrote: > The solution involves more changes to the philosophy and mechanics of > vacuum than I would expect, though. For instance, VM snapshotting, > page-level-freezing, and a cost model all might make sense, but I don't > see why they are critical for

Re: First draft of the PG 15 release notes

2022-08-30 Thread Bruce Momjian
On Sat, Aug 27, 2022 at 04:03:02PM +0200, Matthias van de Meent wrote: > Hi, > > I noticed a stray "DETAILS?" marker while going through the release > notes for 15. Is that subsection still under construction or review? > > > > > > > Record and check the collation of each >

PostgreSQL 15 release announcement draft

2022-08-30 Thread Jonathan S. Katz
Hi, Please see the first draft for the PostgreSQL 15 release announcement. This is the announcement that goes out when we ship 15.0. A few notes on the first draft: 1. I have not put in any links yet -- I want to ensure the document is close to being static before I add those in. 2. I

Re: replacing role-level NOINHERIT with a grant-level option

2022-08-30 Thread Robert Haas
On Tue, Aug 30, 2022 at 1:30 PM Nathan Bossart wrote: > I've been staring at this stuff for a while, and I'm still rather confused. > > * You mention that you modelled the "new" function select_best_grantor() on > is_admin_of_role(), but it looks like that function was introduced in 2005. > IIUC

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Andrew Dunstan
On 2022-08-30 Tu 10:55, Pavel Stehule wrote: > > > út 30. 8. 2022 v 16:49 odesílatel Pavel Stehule > napsal: > > > > út 30. 8. 2022 v 16:36 odesílatel Christoph Berg > napsal: > > Re: Pavel Stehule > > pspg requires all lines to have the same width. It can do >

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Andres Freund
Hi, On 2022-08-30 14:32:26 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-08-30 14:07:41 -0400, Tom Lane wrote: > >> Do we want to install this just for NetBSD, or more widely? > >> I think we'd better back-patch it for NetBSD, so I'm inclined > >> to be conservative about the

Re: Tracking last scan time

2022-08-30 Thread Bruce Momjian
On Fri, Aug 26, 2022 at 02:05:36PM +0100, Dave Page wrote: > On Thu, 25 Aug 2022 at 01:44, David Rowley wrote: > I don't have a particular opinion about the patch, I'm just pointing > out that there are other ways. Even just writing down the numbers on a > post-it note and coming back

Re: Hash index build performance tweak from sorting

2022-08-30 Thread Ranier Vilela
>It's a shame you only see 3%, but that's still worth it. Hi, I ran this test here: DROP TABLE hash_speed; CREATE unlogged TABLE hash_speed (x integer); INSERT INTO hash_speed SELECT random()*1000 FROM generate_series(1,1000) x; VACUUM Timing is on. CREATE INDEX ON hash_speed USING hash

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Tom Lane
Andres Freund writes: > On 2022-08-30 14:07:41 -0400, Tom Lane wrote: >> Do we want to install this just for NetBSD, or more widely? >> I think we'd better back-patch it for NetBSD, so I'm inclined >> to be conservative about the change. > It's likely a good idea to enable it everywhere

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Andres Freund
Hi, On 2022-08-30 14:07:41 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-08-30 13:24:39 -0400, Tom Lane wrote: > >> Andres Freund writes: > >>> Perhaps it'd be saner to default to building with -Wl,-z,now? That should > >>> fix > >>> the problem too, right (and if we combine it

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Aleksander Alekseev
Hi hackers, > Here is v3 with silenced compiler warnings. Some more warnings were reported by cfbot, so here is v4. Apologies for the noise. -- Best regards, Aleksander Alekseev v4-0001-Fix-incorrect-uses-of-Datum-conversion-macros.patch Description: Binary data

Re: New strategies for freezing, advancing relfrozenxid early

2022-08-30 Thread Jeff Davis
On Thu, 2022-08-25 at 14:21 -0700, Peter Geoghegan wrote: > Attached patch series is a completely overhauled version of earlier > work on freezing. Related work from the Postgres 15 cycle became > commits 0b018fab, f3c15cbe, and 44fa8488. > > Recap > = > > The main high level goal of this

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Tom Lane
Andres Freund writes: > On 2022-08-30 13:24:39 -0400, Tom Lane wrote: >> Andres Freund writes: >>> Perhaps it'd be saner to default to building with -Wl,-z,now? That should >>> fix >>> the problem too, right (and if we combine it with relro, it'd be a security >>> improvement to boot). >> Hm.

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Andres Freund
Hi, On 2022-08-30 13:24:39 -0400, Tom Lane wrote: > Andres Freund writes: > > Perhaps it'd be saner to default to building with -Wl,-z,now? That should > > fix > > the problem too, right (and if we combine it with relro, it'd be a security > > improvement to boot). > > Hm. Not sure if that

Re: replacing role-level NOINHERIT with a grant-level option

2022-08-30 Thread Nathan Bossart
On Mon, Aug 29, 2022 at 03:38:57PM -0400, Robert Haas wrote: > Argh, I found a bug, and one that I should have caught during testing, > too. I modelled the new function select_best_grantor() on > is_admin_of_role(), but it differs in that it calls > roles_is_member_of() with ROLERECURSE_PRIVS

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Tom Lane
Andres Freund writes: > On 2022-08-29 15:43:55 -0400, Tom Lane wrote: >> The attached patch seems to fix the problem, by forcing resolution of >> the PLT link before we unblock signals. It depends on the assumption >> that another select() call appearing within postmaster.c will share >> the

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Andres Freund
Hi, On 2022-08-29 15:43:55 -0400, Tom Lane wrote: > Buildfarm member mamba (NetBSD-current on prairiedog's former hardware) > has failed repeatedly since I set it up. I have now run the cause of > that to ground [1], and here's what's happening: if the postmaster > receives a signal just before

Re: Handle infinite recursion in logical replication setup

2022-08-30 Thread vignesh C
On Mon, 29 Aug 2022 at 12:01, Peter Smith wrote: > > Here are some review comments for patch v42-0002: > > == > > 1. doc/src/sgml/logical-replication.sgml > > copy_data = true > > There are a couple of these tags where there is a trailing space > before the . I guess it is doing no harm, but

Re: Handle infinite recursion in logical replication setup

2022-08-30 Thread vignesh C
On Mon, 29 Aug 2022 at 11:59, Peter Smith wrote: > > Here are some review comments for patch v42-0001: > > == > > 1. Commit message > > A later review comment below suggests some changes to the WARNING > message so if those changes are made then the example in this commit > message also needs

Re: SUBTRANS: Minimizing calls to SubTransSetParent()

2022-08-30 Thread Simon Riggs
On Thu, 11 Aug 2022 at 06:32, Dilip Kumar wrote: > > > So I still think some adjustment is required in XidInMVCCSnapdhot() > > > > That is one way to resolve the issue, but not the only one. I can also > > change AssignTransactionId() to recursively register parent xids for > > all of a subxid's

Re: archive modules

2022-08-30 Thread Nathan Bossart
On Tue, Aug 30, 2022 at 09:49:20AM +0200, Benoit Lobréau wrote: > Ok done, https://commitfest.postgresql.org/39/3856/ (is that fine if I > added you as a reviewer ?) Of course. I've marked it as ready-for-committer. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: Hash index build performance tweak from sorting

2022-08-30 Thread Simon Riggs
On Fri, 5 Aug 2022 at 20:46, David Zhang wrote: > > On 2022-08-01 8:37 a.m., Simon Riggs wrote: > > Using the above test case, I'm getting a further 4-7% improvement on > > already committed code with the attached patch, which follows your > > proposal. > > I ran two test cases: for committed

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread Tom Lane
David Rowley writes: > Here's a patch which adds a comment to MemoryContextMethodID to Robert's > patch. OK, but while looking at that I noticed the adjacent #define MEMORY_CONTEXT_METHODID_MASK \ UINT64CONST((1 << MEMORY_CONTEXT_METHODID_BITS) - 1) I'm rather astonished that that

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread Robert Haas
On Tue, Aug 30, 2022 at 11:39 AM David Rowley wrote: > On Wed, 31 Aug 2022 at 03:31, David Rowley wrote: > > I've no objections to adding a comment to the enum to > > explain to future devs. My vote would be for that and add the (int) > > cast as proposed by Robert. > > Here's a patch which adds

Re: making relfilenodes 56 bits

2022-08-30 Thread Robert Haas
On Tue, Aug 30, 2022 at 8:45 AM Dilip Kumar wrote: > I have found one more issue with this approach of rewriting the > conflicting table. Earlier I thought we could do the conflict > checking and rewriting inside create_new_objects() right before the > restore command. But after implementing

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread David Rowley
On Wed, 31 Aug 2022 at 03:31, David Rowley wrote: > I've no objections to adding a comment to the enum to > explain to future devs. My vote would be for that and add the (int) > cast as proposed by Robert. Here's a patch which adds a comment to MemoryContextMethodID to Robert's patch. David

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread David Rowley
On Wed, 31 Aug 2022 at 01:36, Tom Lane wrote: > > David Rowley writes: > > I think the Assert is useful as if we were ever to add an enum member > > with the value of 8 and forgot to adjust MEMORY_CONTEXT_METHODID_BITS > > then bad things would happen inside MemoryChunkSetHdrMask() and > >

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread David Rowley
On Wed, 31 Aug 2022 at 03:00, Robert Haas wrote: > > On Tue, Aug 30, 2022 at 3:14 AM David Rowley wrote: > > I think the Assert is useful as if we were ever to add an enum member > > with the value of 8 and forgot to adjust MEMORY_CONTEXT_METHODID_BITS > > then bad things would happen inside

Re: Stack overflow issue

2022-08-30 Thread Tom Lane
I wrote: >> I think most likely we should report this to Snowball upstream >> and see what they think is an appropriate fix. > Done at [1], and I pushed the other fixes. Thanks again for the report! The upstream recommendation, which seems pretty sane to me, is to simply reject any string

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread Robert Haas
On Tue, Aug 30, 2022 at 3:14 AM David Rowley wrote: > I'm not really sure either. I tried compiling with clang 12.0.1 with > -Wtautological-constant-out-of-range-compare and don't get this > warning. I have a much older clang version, it seems. clang -v reports 5.0.2. I use -Wall and -Werror as

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Pavel Stehule
út 30. 8. 2022 v 16:49 odesílatel Pavel Stehule napsal: > > > út 30. 8. 2022 v 16:36 odesílatel Christoph Berg napsal: > >> Re: Pavel Stehule >> > pspg requires all lines to have the same width. It can do some >> corrections >> > - but it is hard to detect wanted differences or just plain text

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Aleksander Alekseev
Hi hackers, > Cfbot is making its mind at the moment of writing. Here is v3 with silenced compiler warnings. -- Best regards, Aleksander Alekseev v3-0002-Convert-GetDatum-and-DatumGet-macros-to-inline-fu.patch Description: Binary data

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Pavel Stehule
út 30. 8. 2022 v 16:36 odesílatel Christoph Berg napsal: > Re: Pavel Stehule > > pspg requires all lines to have the same width. It can do some > corrections > > - but it is hard to detect wanted differences or just plain text format. > > > > can be nice to have the first invisible row with some

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Christoph Berg
Re: Pavel Stehule > pspg requires all lines to have the same width. It can do some corrections > - but it is hard to detect wanted differences or just plain text format. > > can be nice to have the first invisible row with some information about > used formatting. pspg does some heuristic but

Re: SQL/JSON features for v15

2022-08-30 Thread Jonathan S. Katz
On 8/30/22 9:16 AM, Andrew Dunstan wrote: On 2022-08-30 Tu 06:29, Amit Langote wrote: On Tue, Aug 30, 2022 at 6:19 PM Alvaro Herrera wrote: On 2022-Aug-30, Amit Langote wrote: Patches 0001-0006: Yeah, these add the overhead of an extra function call (typin() -> typin_opt_error()) in

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Tom Lane
Aleksander Alekseev writes: > Maybe we should consider backporting at least 0001 patch, partially > perhaps? I believe if fixes pretty cursed pieces of code, e.g: Certainly if there are any parts of it that fix actual bugs, we ought to backport those. I'm not in a big hurry to backport cosmetic

Re: \pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Pavel Stehule
út 30. 8. 2022 v 15:49 odesílatel Christoph Berg napsal: > Re: Andrew Dunstan > > >> + pg_log_error("\\pset: allowed xheader_width values > are full > > >> (default), column, page, or an number specifying exact width."); > > > Committed. There were a couple of bits missing, which I

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Robert Haas
On Tue, Aug 30, 2022 at 10:25 AM Aleksander Alekseev wrote: > > Yeah, I don't see a reason to back-patch a change like this > > Maybe we should consider backporting at least 0001 patch, partially > perhaps? I believe if fixes pretty cursed pieces of code, e.g: > > ``` >

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Aleksander Alekseev
Tom, Robert, > Yeah, I don't see a reason to back-patch a change like this Maybe we should consider backporting at least 0001 patch, partially perhaps? I believe if fixes pretty cursed pieces of code, e.g: ``` pg_cryptohash_ctx *context = -(pg_cryptohash_ctx *)

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread Tom Lane
I wrote: > So maybe we should revisit the question. It'd be worth collecting some > stats about how much extra space would be needed if we force there > to be room for a sentinel. Actually, after ingesting more caffeine, the problem with this for aset.c is that the only way to add space for a

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Robert Haas
On Tue, Aug 30, 2022 at 10:13 AM Tom Lane wrote: > Aleksander Alekseev writes: > > Just to clarify, a break in this case is going to be the fact that we > > are adding new functions, although inlined, correct? Or maybe > > something else? I'm sorry this is the first time I encounter the > >

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Tom Lane
Aleksander Alekseev writes: > Just to clarify, a break in this case is going to be the fact that we > are adding new functions, although inlined, correct? Or maybe > something else? I'm sorry this is the first time I encounter the > question of ABI compatibility in the context of Postgres, so I

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Aleksander Alekseev
Hi Tom, > Do you think this should be backported? >> Impossible, it's an ABI break. OK, got it. Just to clarify, a break in this case is going to be the fact that we are adding new functions, although inlined, correct? Or maybe something else? I'm sorry this is the first time I encounter the

\pset xheader_width page as default? (Re: very long record lines in expanded psql output)

2022-08-30 Thread Christoph Berg
Re: Andrew Dunstan > >> +   pg_log_error("\\pset: allowed xheader_width values are full > >> (default), column, page, or an number specifying exact width."); > Committed. There were a couple of bits missing, which I filled in, and I > changed the behaviour when the option is given

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Tom Lane
Aleksander Alekseev writes: > Do you think this should be backported? Impossible, it's an ABI break. regards, tom lane

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread Tom Lane
David Rowley writes: > On Tue, 30 Aug 2022 at 03:16, Robert Haas wrote: >> ../../../../src/include/utils/memutils_memorychunk.h:186:18: error: >> comparison of constant 7 with expression of type >> 'MemoryContextMethodID' (aka 'enum MemoryContextMethodID') is always >> true

Re: Convert *GetDatum() and DatumGet*() macros to inline functions

2022-08-30 Thread Aleksander Alekseev
Hi Peter, > To address this, I converted these macros to inline functions This is a great change! I encountered passing the wrong arguments to these macros many times, and this is indeed pretty annoying. I wish we could forbid doing other stupid things as well, e.g. comparing two Datum's

Re: Strip -mmacosx-version-min options from plperl build

2022-08-30 Thread Andrew Dunstan
On 2022-08-26 Fr 16:25, Andres Freund wrote: > Hi, > > On 2022-08-26 16:00:31 -0400, Tom Lane wrote: >> Andrew Dunstan writes: >>> On 2022-08-26 Fr 12:11, Tom Lane wrote: And if that doesn't help, try -Wl,--export-all-symbols >>> worked > Except that it's only happening for plperl, I'd

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Thomas Munro
On Wed, Aug 31, 2022 at 12:26 AM Robert Haas wrote: > On Tue, Aug 30, 2022 at 8:17 AM Thomas Munro wrote: > > FWIW I suspect FreeBSD can't break like this in a program linked with > > libthr, because it has a scheme for deferring signals while the > > runtime linker holds locks. _rtld_bind

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread Tom Lane
Tomas Vondra writes: > I guess the idea was to add a sentinel only when there already is space > for it, but perhaps that's a bad tradeoff limiting the benefits. Either > we add the sentinel fairly often (and then why not just add it all the > time - it'll need a bit more space), or we do it only

Re: SQL/JSON features for v15

2022-08-30 Thread Andrew Dunstan
On 2022-08-30 Tu 06:29, Amit Langote wrote: > On Tue, Aug 30, 2022 at 6:19 PM Alvaro Herrera > wrote: >> On 2022-Aug-30, Amit Langote wrote: >> >>> Patches 0001-0006: >>> >>> Yeah, these add the overhead of an extra function call (typin() -> >>> typin_opt_error()) in possibly very common

plpgsql-trigger.html: Format TG_ variables as table (patch)

2022-08-30 Thread Christoph Berg
Hi, I found the list of TG_ variables on https://www.postgresql.org/docs/current/plpgsql-trigger.html#PLPGSQL-DML-TRIGGER hard to read for several reasons: too much whitespace, all the lines start with "Data type", and even after that, the actual content is hiding behind some extra "variable

Re: POC: GROUP BY optimization

2022-08-30 Thread Jonathan S. Katz
On 8/18/22 3:29 AM, Tomas Vondra wrote: On 8/18/22 03:32, David Rowley wrote: Here are a couple of patches to demo the idea. Yeah, that's an option too. I should have mentioned it along with the cpu_operator_cost. BTW would you mind taking a look at the costing? I think it's fine, but

Re: Removing dead code in pgcrypto

2022-08-30 Thread Aleksander Alekseev
Hi again, > I'm pretty sure this change is fine too, but I added the patch to the > CF application in order to play it safe. Let's see what cfbot will > tell us. I see a little race condition happen :) Sorry for this. -- Best regards, Aleksander Alekseev

Re: ICU for global collation

2022-08-30 Thread Michael Paquier
On Wed, Aug 24, 2022 at 08:28:24PM +0200, Peter Eisentraut wrote: > Committed, thanks. > > (This should conclude all the issues discussed in this thread recently.) Please note that this open item was still listed as open. I have closed it now. -- Michael signature.asc Description: PGP

Setting restrictedtoken in pg_regress

2022-08-30 Thread Daniel Gustafsson
In pg_regress we set restrictedToken when calling CreateRestrictedProcess, but we never seem to use that anywhere. Not being well versed in Windows I might be missing something, but is it needed or is it a copy/pasteo from fa1e5afa8a2 which does that in restricted_token.c? If not needed,

Re: Removing dead code in pgcrypto

2022-08-30 Thread Aleksander Alekseev
Hi Daniel, > Thanks for looking! On closer inspection, I found another function which was > never used and which doesn't turn up when searching extensions. The attached > removes pgp_get_cipher_name as well. I'm pretty sure this change is fine too, but I added the patch to the CF application

Re: Removing dead code in pgcrypto

2022-08-30 Thread Daniel Gustafsson
> On 30 Aug 2022, at 14:39, Aleksander Alekseev > wrote: > > Hi Daniel, > >> it seems we can consider retiring them in v16. > > Looks good to me. A link to the discussion was added to the patch. Thanks for looking! On closer inspection, I found another function which was never used and

Re: making relfilenodes 56 bits

2022-08-30 Thread Dilip Kumar
On Fri, Aug 26, 2022 at 9:33 PM Robert Haas wrote: > > On Fri, Aug 26, 2022 at 7:01 AM Dilip Kumar wrote: > > While working on this solution I noticed one issue. Basically, the > > problem is that during binary upgrade when we try to rewrite a heap we > > would expect that

Re: Removing dead code in pgcrypto

2022-08-30 Thread Aleksander Alekseev
Hi Daniel, > it seems we can consider retiring them in v16. Looks good to me. A link to the discussion was added to the patch. -- Best regards, Aleksander Alekseev v2-0001-pgcrypto-Remove-unused-mbuf-code.patch Description: Binary data

Re: replacing role-level NOINHERIT with a grant-level option

2022-08-30 Thread Robert Haas
On Tue, Aug 30, 2022 at 8:24 AM Robert Haas wrote: > On Mon, Aug 29, 2022 at 10:16 PM Robert Haas wrote: > > I'll figure out a fix tomorrow when I'm less tired. Thanks for catching it. > > Second try. Third try. -- Robert Haas EDB: http://www.enterprisedb.com

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Robert Haas
On Tue, Aug 30, 2022 at 8:17 AM Thomas Munro wrote: > FWIW I suspect FreeBSD can't break like this in a program linked with > libthr, because it has a scheme for deferring signals while the > runtime linker holds locks. _rtld_bind calls _thr_rtld_rlock_acquire, > which uses the

Re: replacing role-level NOINHERIT with a grant-level option

2022-08-30 Thread Robert Haas
On Mon, Aug 29, 2022 at 10:16 PM Robert Haas wrote: > I'll figure out a fix tomorrow when I'm less tired. Thanks for catching it. Second try. -- Robert Haas EDB: http://www.enterprisedb.com v2-0001-Fix-a-bug-in-roles_is_member_of.patch Description: Binary data

Re: Postmaster self-deadlock due to PLT linkage resolution

2022-08-30 Thread Thomas Munro
On Tue, Aug 30, 2022 at 7:44 AM Tom Lane wrote: > Buildfarm member mamba (NetBSD-current on prairiedog's former hardware) > has failed repeatedly since I set it up. I have now run the cause of > that to ground [1], and here's what's happening: if the postmaster > receives a signal just before it

Re: Transparent column encryption

2022-08-30 Thread Peter Eisentraut
On 27.07.22 01:19, Jacob Champion wrote: Now, if we don't have a padding system built into the feature, then that does put even more on the user; it's hard to argue with that. Right. If they can even fix it at all. Having a well-documented padding feature would not only help mitigate that, it

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

2022-08-30 Thread Amit Kapila
On Tue, Aug 30, 2022 at 12:12 PM Amit Kapila wrote: > > Few other comments on v25-0001* > > Some more comments on v25-0001*: = 1. +static void +apply_handle_stream_abort(StringInfo s) ... ... + else if (apply_action ==

Re: Transparent column encryption

2022-08-30 Thread Peter Eisentraut
On 20.07.22 08:12, Masahiko Sawada wrote: --- Regarding the documentation, I'd like to have a page that describes the generic information of the transparent column encryption for users such as what this feature actually does, what can be achieved by this feature, CMK rotation, and its known

Removing dead code in pgcrypto

2022-08-30 Thread Daniel Gustafsson
mbuf_tell and mbuf_rewind functions were introduced in commit e94dd6ab91 but were seemingly never used, so it seems we can consider retiring them in v16. -- Daniel Gustafsson https://vmware.com/ v1-0001-pgcrypto-Remove-unused-mbuf-code.patch Description: Binary data

Re: SQL/JSON features for v15

2022-08-30 Thread Amit Langote
On Tue, Aug 30, 2022 at 6:19 PM Alvaro Herrera wrote: > On 2022-Aug-30, Amit Langote wrote: > > > Patches 0001-0006: > > > > Yeah, these add the overhead of an extra function call (typin() -> > > typin_opt_error()) in possibly very common paths. Other than > > refactoring *all* places that call

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

2022-08-30 Thread Peter Smith
Hi Onder, Since you ask me several questions [1], this post is just for answering those. I have looked again at the latest v9 patch, but I will post my review comments for that separately. On Thu, Aug 25, 2022 at 7:09 PM Önder Kalacı wrote: > >> 1d. >> In above text, what was meant by

Re: SQL/JSON features for v15

2022-08-30 Thread Alvaro Herrera
On 2022-Aug-30, Amit Langote wrote: > Patches 0001-0006: > > Yeah, these add the overhead of an extra function call (typin() -> > typin_opt_error()) in possibly very common paths. Other than > refactoring *all* places that call typin() to use the new API, the > only other option seems to be to

Re: Letter case of "admin option"

2022-08-30 Thread Alvaro Herrera
On 2022-Aug-26, Robert Haas wrote: > Here's a patch changing all occurrences of "admin option" in error > messages to "ADMIN OPTION". > > Two of these five messages also exist in previous releases; the other > three are new. > > I'm not sure if this is our final conclusion on what we want to do

Re: Reducing the chunk header sizes on all memory context types

2022-08-30 Thread Tomas Vondra
On 8/30/22 04:31, David Rowley wrote: > On Tue, 30 Aug 2022 at 13:55, Tom Lane wrote: >> I wonder if slab ought to artificially bump up such requests when >> MEMORY_CONTEXT_CHECKING is enabled, so there's room for a sentinel. >> I think it's okay for aset.c to not do that, because its

Re: pg_rewind WAL segments deletion pitfall

2022-08-30 Thread Alexander Kukushkin
On Tue, 30 Aug 2022 at 10:27, Kyotaro Horiguchi wrote: > > Hmm. Doesn't it work to ignoring tli then? All segments that their > segment number is equal to or larger than the checkpoint locaiton are > preserved regardless of TLI? > If we ignore TLI there is a chance that we may retain some

  1   2   >