Re: doc issues in event-trigger-matrix.html

2024-10-29 Thread Peter Eisentraut
I made a patch for this. I have expanded the narrative discussion on what commands are supported for event triggers, also made a few corrections/additions there, based on inspecting the source code. And then removed the big matrix, which doesn't provide any additional information, I think.

Re: detoast datum into the given buffer as a optimization.

2024-10-29 Thread Nikita Malakhov
Hi Andy, For EXPANDED attributes va_rawsize is the size of the compressed attribute, not original size. You can check toast_save_datum for that. This thread looks like the second take of the shared detoast datum patch. Have you checked my proposals in that thread? -- Regards, Nikita Malakhov Po

Re: [PATCH] Rename trim_array() for consistency with the rest of array_* functions

2024-10-29 Thread Aleksander Alekseev
Hi Vik, > While unfortunately named, we cannot deprecate TRIM_ARRAY() because it > is mandated by the standard. I didn't know that, thanks. Still PostgreSQL doesn't follow the standard precisely in more than one respect. Perhaps we should add array_trim() and keep both? Or (less likely) remove t

Re: Avoid possible useless call to makeNode function (src/backend/commands/view.c)

2024-10-29 Thread David Rowley
On Wed, 30 Oct 2024 at 01:07, Ranier Vilela wrote: > With the function *DefineVirtualRelation* has a possible > useless call to *makeNode* function, which invokes palloc. > > So, reduce the scope for the variable to inner else > where it is really necessary. Seem legit. I can take care of that.

Re: define pg_structiszero(addr, s, r)

2024-10-29 Thread Bertrand Drouvot
Hi, On Tue, Oct 29, 2024 at 11:39:03AM +0200, Heikki Linnakangas wrote: > On 29/10/2024 09:54, Bertrand Drouvot wrote: > > > https://godbolt.org/z/x9hPWjheq. > > > > Yeah, I also think that's fine. Peter Smith did some testing in [1] > > comparing > > memcmp and simple loop checking (thanks Pete

Re: Add isolation test template in injection_points for wait/wakeup/detach

2024-10-29 Thread Bertrand Drouvot
Hi, On Tue, Oct 29, 2024 at 05:20:42PM +0900, Michael Paquier wrote: > On Tue, Oct 29, 2024 at 07:59:31AM +, Bertrand Drouvot wrote: > > On Tue, Oct 29, 2024 at 01:12:25PM +0900, Michael Paquier wrote: > >> Under a wait of N seconds, > >> we could still have environments where the wait() could

Re: Alias of VALUES RTE in explain plan

2024-10-29 Thread Tom Lane
Andrei Lepikhov writes: > Thanks for the detailed explanation. I agree it make sense. Cool, I think we're all agreed then. > Also, after skimming the code, I propose some extra tests: Most of these are covered well enough by existing tests, aren't they? regards, tom lan

Re: On disable_cost

2024-10-29 Thread David Rowley
On Tue, 29 Oct 2024 at 20:04, Laurenz Albe wrote: > That patch is good in my opinion. Thanks for checking. Pushed. David

Re: Pgoutput not capturing the generated columns

2024-10-29 Thread vignesh C
On Tue, 29 Oct 2024 at 11:30, Peter Smith wrote: > > Here are my review comments for patch v44-0002. > > == > Commit message. > > 1. > The commit message is missing. This patch is now merged, so no change required. > == > src/backend/replication/logical/tablesync.c > > fetch_remote_table

Re: Alias of VALUES RTE in explain plan

2024-10-29 Thread Ashutosh Bapat
On Mon, Oct 28, 2024 at 8:46 PM Tom Lane wrote: > > Ashutosh Bapat writes: > > The patch looks good to me, except the name of the new member. > > > CommonTableExpr *p_parent_cte; /* this query's containing CTE */ > > + Alias*p_parent_alias; /* parent's alias for this query */ > > > the two

Re: detoast datum into the given buffer as a optimization.

2024-10-29 Thread Nikita Malakhov
Hi! Sorry for misguiding you, I've overlooked va_rawsize with va_extinfo. You're right, va_rawsize holds uncompressed size, and extinfo actual storage size. This was not intentional. I'd better not count on caller's do know detoasted data length, and much more the buffer is correctly initialized,

Re: Support regular expressions with nondeterministic collations

2024-10-29 Thread Peter Eisentraut
On 22.10.24 16:40, Tom Lane wrote: Peter Eisentraut writes: This patch allows using regular expression functions and operators with nondeterministic collations. ... In summary, this patch doesn't change any functionality that currently works. It just removes one error message and lets regular

Re: Add isolation test template in injection_points for wait/wakeup/detach

2024-10-29 Thread Michael Paquier
On Tue, Oct 29, 2024 at 07:59:31AM +, Bertrand Drouvot wrote: > On Tue, Oct 29, 2024 at 01:12:25PM +0900, Michael Paquier wrote: >> Under a wait of N seconds, >> we could still have environments where the wait() could remain stuck >> more than N seconds between the moment the condition variable

Re: Alias of VALUES RTE in explain plan

2024-10-29 Thread Andrei Lepikhov
On 10/28/24 22:05, Tom Lane wrote: Andrei Lepikhov writes: My goal is to understand why the implementation follows this pattern. As I see, previously, we had consistent behaviour, according to which we removed the pulling-up subquery's alias as well. And I want to know, is it really the only wa

Re: Conflict detection for update_deleted in logical replication

2024-10-29 Thread Michail Nikolaev
Hello Hayato, > WaitForOlderSnapshots() waits other transactions which can access older tuples > than the specified (=current) transaction, right? I think it does not solve our issue. Oh, I actually described the idea a bit incorrectly. The goal isn’t simply to call WaitForOlderSnapshots(slot.xmi

Re: protocol-level wait-for-LSN

2024-10-29 Thread Matthias van de Meent
On Mon, 28 Oct 2024, 16:51 Peter Eisentraut, wrote: > > This is something I hacked together on the way back from pgconf.eu. > It's highly experimental. > > The idea is to do the equivalent of pg_wal_replay_wait() on the protocol > level, so that it is ideally fully transparent to the application c

Re: Vacuum statistics

2024-10-29 Thread Andrei Zubkov
Hi, Thanks for your attention to our patch! On Mon, 2024-10-28 at 16:03 -0500, Jim Nasby wrote: > > Yes, but as Masahiko-san pointed out, PgStat_TableCounts is almost > > tripled in space.  That a huge change from having no statistics on > > vacuum to have it in much more detail than everything e

Re: Eager aggregation, take 3

2024-10-29 Thread Robert Haas
On Wed, Sep 25, 2024 at 3:03 AM Richard Guo wrote: > On Wed, Sep 11, 2024 at 10:52 AM Tender Wang wrote: > > 1. In make_one_rel(), we have the below codes: > > /* > > * Build grouped base relations for each base rel if possible. > > */ > > setup_base_grouped_rels(root); > > > > As far as I know,

Re: detoast datum into the given buffer as a optimization.

2024-10-29 Thread Andy Fan
Nikita Malakhov writes: Hello Nikita, > > For EXPANDED attributes va_rawsize is the size of the compressed attribute, > not original size. > You can check toast_save_datum for that. Here is some quota from toast_save_datum, which is different from what you are saying here. * Get the

Re: Avoid possible useless call to makeNode function (src/backend/commands/view.c)

2024-10-29 Thread Ranier Vilela
Em ter., 29 de out. de 2024 às 09:25, David Rowley escreveu: > On Wed, 30 Oct 2024 at 01:07, Ranier Vilela wrote: > > With the function *DefineVirtualRelation* has a possible > > useless call to *makeNode* function, which invokes palloc. > > > > So, reduce the scope for the variable to inner els

Re: Forbid to DROP temp tables of other sessions

2024-10-29 Thread Stepan Neretin
Hi, looks good for me, but please fix formatting in temp_tbl_fix.patch!

Re: Vacuum statistics

2024-10-29 Thread Alena Rybakina
On 28.10.2024 16:40, Alexander Korotkov wrote: On Sun, Aug 25, 2024 at 6:59 PM Alena Rybakina wrote: I didn't understand correctly - did you mean that we don't need SRF if we need to display statistics for a specific object? Otherwise, we need this when we display information on all database

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-10-29 Thread Daniel Gustafsson
> On 28 Oct 2024, at 17:09, Jacob Champion > wrote: > On Mon, Oct 28, 2024 at 6:24 AM Daniel Gustafsson wrote: >> Looking more at the patchset I think we need to apply conditional compilation >> of the backend for oauth like how we do with other opt-in schemes in >> configure >> and meson. Th

Re: Pgoutput not capturing the generated columns

2024-10-29 Thread Shubham Khanna
On Tue, Oct 29, 2024 at 3:18 PM vignesh C wrote: > > On Tue, 29 Oct 2024 at 11:30, Peter Smith wrote: > > > > Here are my review comments for patch v44-0002. > > > > == > > Commit message. > > > > 1. > > The commit message is missing. > > This patch is now merged, so no change required. > > >

RE: Conflict detection for update_deleted in logical replication

2024-10-29 Thread Hayato Kuroda (Fujitsu)
Dear Mikhail, Thanks for giving comments! > But as far as I know, to solve this problem, we need to wait for slot.xmin > during the [0] > (WaitForOlderSnapshots) while creating index concurrently. WaitForOlderSnapshots() waits other transactions which can access older tuples than the specified

Re: Add isolation test template in injection_points for wait/wakeup/detach

2024-10-29 Thread Bertrand Drouvot
Hi, On Tue, Oct 29, 2024 at 01:12:25PM +0900, Michael Paquier wrote: > On Mon, Oct 28, 2024 at 07:17:28AM +, Bertrand Drouvot wrote: > > I think that we can not be 100% sure that the s1 wait will finish before the > > s2 detach (easy reproducible with gdb attached on s1 or an hardcoded sleep)

Re: define pg_structiszero(addr, s, r)

2024-10-29 Thread Bertrand Drouvot
Hi, On Mon, Oct 28, 2024 at 04:32:51PM +0200, Heikki Linnakangas wrote: > On 18/09/2024 21:57, Bertrand Drouvot wrote: > > On Wed, Sep 18, 2024 at 10:03:21AM +0200, Peter Eisentraut wrote: > > > On 18.09.24 06:16, Bertrand Drouvot wrote: > > > > +#define pg_structiszero(addr, s, r)

[PATCH] Fixed creation of empty .log files during log rotation

2024-10-29 Thread Арсений Косицын
Hi everyone! A situation has been discovered in which empty .log files are being created. --Reproduce: 1) You need to set the following parameters in the "postgresql.conf" file: log_destination = 'csvlog' logging_collector = on log_rotation_age = 1min log_directory = '/home/user/builds/postgr

Avoid possible useless call to makeNode function (src/backend/commands/view.c)

2024-10-29 Thread Ranier Vilela
Hi. With the function *DefineVirtualRelation* has a possible useless call to *makeNode* function, which invokes palloc. So, reduce the scope for the variable to inner else where it is really necessary. trivial patch attached. best regards, Ranier Vilela 0001-avoid-possible-useless-palloc-view

[PATCH] Rename trim_array() for consistency with the rest of array_* functions

2024-10-29 Thread Aleksander Alekseev
Hi hackers, Currently most of the functions dealing with arrays ( except for unnest() and cardinality() ) start with `array_` prefix [1] - array_length(), array_fill(), etc. Also this is how we name the new functions, e.g. recently proposed array_sort() [2] and array_reverse() [3]. The only except

Re: [PATCH] Rename trim_array() for consistency with the rest of array_* functions

2024-10-29 Thread Vik Fearing
On 29/10/2024 13:01, Aleksander Alekseev wrote: Hi hackers, Currently most of the functions dealing with arrays ( except for unnest() and cardinality() ) start with `array_` prefix [1] - array_length(), array_fill(), etc. Also this is how we name the new functions, e.g. recently proposed array

Re: [PATCH] Rename trim_array() for consistency with the rest of array_* functions

2024-10-29 Thread Marcos Pegoraro
Em ter., 29 de out. de 2024 às 09:01, Aleksander Alekseev < aleksan...@timescale.com> escreveu: > The proposed patch renames trim_array() to array_trim(). > That Array Functions list on func.sgml is an ordered list, so the right place for it should be before array_upper, right ? regards Marcos

Re: general purpose array_sort

2024-10-29 Thread Aleksander Alekseev
Hi Jian, > IMMUTABLE indicates that the function cannot modify the database and always > returns the same result when given the same argument values; that is, it does > not do database lookups or otherwise use information not directly present in > its > argument list. If this option is given, any

Re: Replace current implementations in crypt() and gen_salt() to OpenSSL

2024-10-29 Thread Joe Conway
On 10/29/24 05:57, Daniel Gustafsson wrote: On 26 Oct 2024, at 20:10, Joe Conway wrote: Rather than depend on figuring out if we are in FIPS_mode in a portable way, I think the GUC is simpler and sufficient. Why not do that and just use a better name, e.g. legacy_crypto_enabled or something

Re: Remove useless casts to (void *)

2024-10-29 Thread Tom Lane
Peter Eisentraut writes: > There are a bunch of (void *) casts in the code that don't make sense to > me. I think some of these were once necessary because char * was used > in place of void * for some function arguments. And some of these were > probably just copied around without further th

Re: Replace current implementations in crypt() and gen_salt() to OpenSSL

2024-10-29 Thread Joe Conway
On 10/29/24 12:52, Jacob Champion wrote: On Sat, Oct 26, 2024 at 11:10 AM Joe Conway wrote: Rather than depend on figuring out if we are in FIPS_mode in a portable way, I think the GUC is simpler and sufficient. Why not do that and just use a better name, e.g. legacy_crypto_enabled or something

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-10-29 Thread Daniel Gustafsson
> On 29 Oct 2024, at 17:40, Jacob Champion > wrote: > > On Tue, Oct 29, 2024 at 3:52 AM Daniel Gustafsson wrote: >> Currently we don't support any conditional compilation which only affects >> backend or frontend, all --without-XXX flags turn it off for both. > > I don't think that's strictly

Re: detoast datum into the given buffer as a optimization.

2024-10-29 Thread Andy Fan
Nikita Malakhov writes: > Hi! > > Sorry for misguiding you, I've overlooked va_rawsize with va_extinfo. > You're right, va_rawsize holds uncompressed size, and extinfo actual > storage size. This was not intentional. That's OK, so we are in the same page here. > I'd better not count on caller's

Re: Avoid detoast overhead when possible

2024-10-29 Thread Andy Fan
zhihuifan1...@163.com writes: Hello Nikita, >> There's a view from the other angle - detoast just attributes that are needed >> (partial detoast), with optimized storage mechanics for JSONb. > > Very glad to know that, looking forward your design & patch! This is interesting, do you mind to pro

Reorganize cache memory contexts

2024-10-29 Thread Jeff Davis
Attached is a patch that reorganizes CacheMemoryContext to be mostly a parent context, with child contexts such as CatCacheContext, RelCacheContext, PlanCacheContext, etc. The goal is to better account for specific caches, which will hopefully lead to optimizations or other improvements. Regards,

Re: SQL Property Graph Queries (SQL/PGQ)

2024-10-29 Thread Andreas Karlsson
Patches 0001 - 0006 are same as the previous set. 0007 - fixes all the problems you reported till now and also the one I found. The commit message describes the fixes in detail. Hi, I found a potential bug in the parsing of the left and right arrows. They can be broken up in - > and < - respec

Re: Eager aggregation, take 3

2024-10-29 Thread Robert Haas
On Tue, Sep 24, 2024 at 11:20 PM Richard Guo wrote: > The reason is that it is very tricky to set the size estimates for a > grouped join relation. For a non-grouped join relation, we know that > all its paths have the same rowcount estimate (well, in theory). But > this is not true for a groupe

Re: Skip collecting decoded changes of already-aborted transactions

2024-10-29 Thread Masahiko Sawada
Sorry for the late reply. On Tue, Jun 11, 2024 at 7:41 PM Peter Smith wrote: > > Hi, here are some review comments for your patch v4-0001. Thank you for reviewing the patch! > > == > contrib/test_decoding/sql/stats.sql > > 1. > Huh? The test fails because the "expected results" file for the

Re: make all ereport in gram.y print out relative location

2024-10-29 Thread jian he
On Tue, Oct 29, 2024 at 10:49 PM Alvaro Herrera wrote: > > Why remove parsePartitionStrategy? You could just add an "int location" > parameter to it. > now changed to static PartitionStrategy parsePartitionStrategy(char *strategy, int location, core_yyscan_t yyscanner); From 2ec4466576778e42d393

Re: Alias of VALUES RTE in explain plan

2024-10-29 Thread Andrei Lepikhov
On 10/30/24 00:19, Tom Lane wrote: Andrei Lepikhov writes: -- New behavior EXPLAIN (COSTS OFF, VERBOSE) SELECT * FROM (VALUES (4),(2),(3),(1) ORDER BY t1.x LIMIT 2) AS t1(x); SELECT * FROM (VALUES (4),(2),(3),(1) ORDER BY t1.x LIMIT 2) AS t1(x); After taking a closer look at that, yeah it's n

Re: doc issues in event-trigger-matrix.html

2024-10-29 Thread Michael Paquier
On Tue, Oct 29, 2024 at 03:53:43PM +0100, Daniel Gustafsson wrote: > +1, I think this is a net improvement. Agreed. I have spent some time looking in the past few years looking at patches that tweaked this table, and it was always hard to figure out if it was completely right. > The only thing I

Re: Skip collecting decoded changes of already-aborted transactions

2024-10-29 Thread Masahiko Sawada
On Wed, Mar 27, 2024 at 4:49 AM Ajin Cherian wrote: > > > > On Mon, Mar 18, 2024 at 7:50 PM Masahiko Sawada wrote: >> >> >> In addition to these changes, I've made some changes to the latest >> patch. Here is the summary: >> >> - Use txn_flags field to record the transaction status instead of two

Re: Reorganize cache memory contexts

2024-10-29 Thread David Rowley
On Wed, 30 Oct 2024 at 09:29, Jeff Davis wrote: > Attached is a patch that reorganizes CacheMemoryContext to be mostly a > parent context, with child contexts such as CatCacheContext, > RelCacheContext, PlanCacheContext, etc. Is it worth merging efforts with [1]? I don't think that patch goes as

Re: Vacuum statistics

2024-10-29 Thread Jim Nasby
On Oct 29, 2024, at 7:40 AM, Andrei Zubkov wrote: > > Hi, > > Thanks for your attention to our patch! > > On Mon, 2024-10-28 at 16:03 -0500, Jim Nasby wrote: >>> Yes, but as Masahiko-san pointed out, PgStat_TableCounts is almost >>> tripled in space. That a huge change from having no statistic

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-10-29 Thread Jacob Champion
On Tue, Oct 29, 2024 at 10:41 AM Daniel Gustafsson wrote: > Question is though, if we added PAM > today would we have done the same? I assume so; the client can't tell PAM apart from LDAP or any other plaintext method. (In the same vein, the server can't tell if the client uses libcurl to grab a

Re: Separate memory contexts for relcache and catcache

2024-10-29 Thread Jeff Davis
On Wed, 2024-04-03 at 16:12 +0300, Melih Mutlu wrote: > Rebased. PSA. Thank you. I missed your patch and came up with a similar patch over here: https://www.postgresql.org/message-id/flat/78599c442380ddb5990117e281a4fa65a74231af.ca...@j-davis.com I closed my thread and we can continue this one.

Re: Reorganize cache memory contexts

2024-10-29 Thread Jeff Davis
On Wed, 2024-10-30 at 10:28 +1300, David Rowley wrote: > On Wed, 30 Oct 2024 at 09:29, Jeff Davis wrote: > > Attached is a patch that reorganizes CacheMemoryContext to be > > mostly a > > parent context, with child contexts such as CatCacheContext, > > RelCacheContext, PlanCacheContext, etc. > >

Re: AIO writes vs hint bits vs checksums

2024-10-29 Thread Andres Freund
Hi, Attached is a, unfortunately long, series of patches implementing what I described upthread. 0001 Add very basic test for kill_prior_tuples We currently don't exercise this patch for gist and hash, which seems somewhat criminal. 0002 heapam: Move logic to handle HEAP_MOVED into a

Re: Pgoutput not capturing the generated columns

2024-10-29 Thread vignesh C
On Tue, 29 Oct 2024 at 17:09, Shubham Khanna wrote: > > While performing the Backward Compatibility Test, I found that > 'tablesync' is not working for the older versions i.e., from > version-12 till version-15. > I created 2 nodes ; PUBLISHER on old versions and SUBSCRIBER on HEAD + > v45 Patch f

Re: Support regular expressions with nondeterministic collations

2024-10-29 Thread Tom Lane
Peter Eisentraut writes: > On 22.10.24 16:40, Tom Lane wrote: >> Peter Eisentraut writes: >>> In summary, this patch doesn't change any functionality that currently >>> works. It just removes one error message and lets regular expressions >>> just run, independent of whether the collation is non

Re: Replace current implementations in crypt() and gen_salt() to OpenSSL

2024-10-29 Thread Daniel Gustafsson
> On 29 Oct 2024, at 13:53, Joe Conway wrote: > > On 10/29/24 05:57, Daniel Gustafsson wrote: >>> On 26 Oct 2024, at 20:10, Joe Conway wrote: >>> Rather than depend on figuring out if we are in FIPS_mode in a portable >>> way, I think the GUC is simpler and sufficient. Why not do that and just

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread David E. Wheeler
On Oct 29, 2024, at 13:40, Tristan Partin wrote: > The backend would create the packages and publish them to the various > repositories. We would probably need to come up with a dependency manifest > that listed both build and runtime dependencies. > > This would need some massaging, and has v

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread David E. Wheeler
On Oct 29, 2024, at 12:51, Christoph Berg wrote: > I think this is where the whole idea of "provide binaries outside of > deb/rpm" is just going to die. You are trying to reinvent a wheel that > has been running well for decades, including lots of production > systems. I don't know anyone who wou

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread David E. Wheeler
On Oct 29, 2024, at 12:23, Paul Ramsey wrote: > Thanks for this, David, 🤘🏻 > This of course is the area that worries the heck out of me, as someone with > extensions that includes not just single system dependencies but long chains > of them (depending on GDAL draws in a huge tree). Yeah. I

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread David E. Wheeler
On Oct 29, 2024, at 13:03, David E. Wheeler wrote: > That’s fine for Linux, but more challenging for macOS and Windows. It’s also > an issue that the apt and yum repositories, while having a lot of stuff, > don’t have all extensions. Sorry, I think I was too quick to respond there. To the degr

Re: Support LIKE with nondeterministic collations

2024-10-29 Thread Jacob Champion
On Sun, Sep 15, 2024 at 11:26 PM Peter Eisentraut wrote: > > Here is an updated patch. It is rebased over the various recent changes > in the locale APIs. No other changes. libfuzzer is unhappy about the following code in MatchText: > +while (p1len > 0) > +{ > +

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread David E. Wheeler
On Oct 29, 2024, at 12:23, Paul Ramsey wrote: > Question for the more knowledgable, how are binary distribution systems like > Conda and others shipping DLLs such that different packages don’t clobber > each other? I’m not familiar with Conda, but from its docs[1], it seems to rely on a value

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread Paul Ramsey
> On Oct 29, 2024, at 10:09 AM, David E. Wheeler wrote: > > On Oct 29, 2024, at 12:23, Paul Ramsey wrote: > >> Thanks for this, David, > > 🤘🏻 > >> This of course is the area that worries the heck out of me, as someone with >> extensions that includes not just single system dependencies but

Re: New "raw" COPY format

2024-10-29 Thread Joel Jacobson
On Mon, Oct 28, 2024, at 18:50, Masahiko Sawada wrote: > Thank you for updating the patch. Here are review comments on the v15 > 0002 patch: Thanks for review. > When testing the patch with an empty delimiter, I got the following failure: > > postgres(1:903898)=# copy hoge from '/tmp/tmp.raw' wit

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread Christoph Berg
Re: Paul Ramsey > Thanks for this, David, > > > On Oct 28, 2024, at 3:19 PM, David E. Wheeler wrote: > > > > ## Challenge: Third Party Dependencies > > This of course is the area that worries the heck out of me, as someone with > extensions that includes not just single system dependencies but

Re: Replace current implementations in crypt() and gen_salt() to OpenSSL

2024-10-29 Thread Jacob Champion
On Sat, Oct 26, 2024 at 11:10 AM Joe Conway wrote: > Rather than depend on figuring out if we are in FIPS_mode in a portable > way, I think the GUC is simpler and sufficient. Why not do that and just > use a better name, e.g. legacy_crypto_enabled or something similar > (bike-shedding welcomed) as

Re: MultiXact\SLRU buffers configuration

2024-10-29 Thread Thom Brown
On Tue, 29 Oct 2024 at 16:38, Thom Brown wrote: > > On Fri, 23 Aug 2024 at 01:29, Michael Paquier wrote: >> >> On Thu, Aug 22, 2024 at 10:36:38AM -0400, Alvaro Herrera wrote: >> > On 2024-Aug-22, Michael Paquier wrote: >> >> I'm not sure that we need to get down to that until somebody has a >> >>

Re: Reduce one comparison in binaryheap's sift down

2024-10-29 Thread Nathan Bossart
On Tue, Oct 29, 2024 at 11:21:15AM +0800, cca5507 wrote: > Agree, new version patch is attached. I might editorialize a bit, but overall this looks pretty good to me. Robert, would you like to commit this, or shall I? -- nathan

Scrollable cursors that use an nbtree index scan are subtly broken with array keys (bug affecting 17+)

2024-10-29 Thread Peter Geoghegan
Attached test case illustrates how a bug in nbtree's handling of primitive index scan scheduling can lead to wrong answers when a scrollable cursor is used. This happens when the scan direction changes for a scan with array keys, at exactly the wrong time, when certain precise conditions are met (m

Re: protocol-level wait-for-LSN

2024-10-29 Thread Jesper Pedersen
Hi Peter, On 10/28/24 12:58 PM, Heikki Linnakangas wrote: I'd suggest adding a new message type for this, so that it works the same with simple and extended query. Or if you just want to wait without issuing any query. I agree it is a good idea to have a feature like this. However, I agree w

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread David E. Wheeler
On Oct 29, 2024, at 13:16, Paul Ramsey wrote: > An apposite choice, since it not only demonstrates depending on a common > system library, it also demonstrates the way these things loop on each other, > as curl then depends on libssl, which postgres also depends on. Ooh, yeah, vicious! > Rela

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread Paul Ramsey
> On Oct 29, 2024, at 10:55 AM, David E. Wheeler wrote: > >>> Relative rpaths as I have seen them are relative to the executable or >>> library in which they are defined (as far as I know, I’m not a dylib expert >>> by any stretch). The implication is that extension.so >>>

Re: Fix for consume_xids advancing XIDs incorrectly

2024-10-29 Thread Fujii Masao
On 2024/10/29 18:00, Yushi Ogiwara wrote:     consumed = XidSkip(nextXid);     if (consumed > 0)     TransamVariables->nextXid.value += (uint64) consumed; BTW, the code snippet above in consume_xids_shortcut() could potentially set the next XID to a value below FirstNorm

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread David E. Wheeler
On Oct 29, 2024, at 14:03, Paul Ramsey wrote: > At that point you’re better off distributing the extension via the packaging > system, where you know that all the dependency versions line up correctly. Yeah. Perhaps it could be mitigated to some degree by requiring a minimum version of each de

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread David E. Wheeler
On Oct 29, 2024, at 14:09, Christoph Berg wrote > So far, no one has approached me ("the packaging team") about which > problems I need solved with extensions (apart from the PGSHAREDIR > issue). > >> Is that something people would be interested in? As someone who writes >> software, I largely f

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread Christoph Berg
Re: Tristan Partin > This would need some massaging, and has various caveats like require using a > well-known build system like PGXS or meson. There are probably security > implications that need to be worked through. The packaging team could maybe > have some burden lifted off their shoulders. S

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread Tristan Partin
On Tue Oct 29, 2024 at 12:03 PM CDT, David E. Wheeler wrote: On Oct 29, 2024, at 12:51, Christoph Berg wrote: I think this is where the whole idea of "provide binaries outside of deb/rpm" is just going to die. You are trying to reinvent a wheel that has been running well for decades, includin

Re: general purpose array_sort

2024-10-29 Thread Junwang Zhao
Hi Aleksander, On Tue, Oct 29, 2024 at 12:48 AM Aleksander Alekseev wrote: > > Hi, > > > Based on the previous discussion, I split it into two patches in V8. > > > > 0001 is the general sort part without `is_ascending` or `nulls_first`, > > the sort order is determined by the "<" operator of the

Re: make all ereport in gram.y print out relative location

2024-10-29 Thread Alvaro Herrera
Why remove parsePartitionStrategy? You could just add an "int location" parameter to it. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Los cuentos de hadas no dan al niño su primera idea sobre los monstruos. Lo que le dan es su primera idea de la posible derro

Re: MultiXact\SLRU buffers configuration

2024-10-29 Thread Thom Brown
On Fri, 23 Aug 2024 at 01:29, Michael Paquier wrote: > On Thu, Aug 22, 2024 at 10:36:38AM -0400, Alvaro Herrera wrote: > > On 2024-Aug-22, Michael Paquier wrote: > >> I'm not sure that we need to get down to that until somebody has a > >> case where they want to rely on stats of injection points

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-10-29 Thread Jacob Champion
On Tue, Oct 29, 2024 at 3:52 AM Daniel Gustafsson wrote: > Currently we don't support any conditional compilation which only affects > backend or frontend, all --without-XXX flags turn it off for both. I don't think that's strictly true; see --with-pam which affects only server-side code, since t

Re: Popcount optimization using AVX512

2024-10-29 Thread Raghuveer Devulapalli
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, failed Spec compliant: tested, failed Documentation:tested, failed Changes LGTM. Makes the Makefile look clean. Built and ran te

Always have pg_dump write rules in a consistent order

2024-10-29 Thread Andreas Karlsson
Hi, When working on a new feature for PostgreSQL I noticed that the pg_upgrade tests became flaky due to rules being dumped in a different order between the original cluster and the upgraded cluster. (For context: my regress scripts left a bunch of views with dependency circles which I had fo

Re: Alias of VALUES RTE in explain plan

2024-10-29 Thread Tom Lane
Andrei Lepikhov writes: > -- New behavior > EXPLAIN (COSTS OFF, VERBOSE) > SELECT * FROM (VALUES (4),(2),(3),(1) ORDER BY t1.x LIMIT 2) AS t1(x); > SELECT * FROM (VALUES (4),(2),(3),(1) ORDER BY t1.x LIMIT 2) AS t1(x); After taking a closer look at that, yeah it's new behavior, and I'm not sure w

Cleanup SubPlanstate

2024-10-29 Thread Rafia Sabih
Hello hackers, While reviewing a related patch, it came to the notice that tab_eq_funcs in the SubPlanState is not used. Hence the patch. -- Regards, Rafia Sabih CYBERTEC PostgreSQL International GmbH From 9415a530ff6557f424d9c04d7aace697d0fe2883 Mon Sep 17 00:00:00 2001 From: rafia sabih Date:

Re: protocol-level wait-for-LSN

2024-10-29 Thread Jesper Pedersen
Hi, On 10/29/24 12:03 PM, Jesper Pedersen wrote: On 10/28/24 12:58 PM, Heikki Linnakangas wrote: I'd suggest adding a new message type for this, so that it works the same with simple and extended query. Or if you just want to wait without issuing any query. I agree it is a good idea to have

Re: RFC: Extension Packaging & Lookup

2024-10-29 Thread Paul Ramsey
Thanks for this, David, > On Oct 28, 2024, at 3:19 PM, David E. Wheeler wrote: > > ## Challenge: Third Party Dependencies This of course is the area that worries the heck out of me, as someone with extensions that includes not just single system dependencies but long chains of them (depending

Re: Enhancing Memory Context Statistics Reporting

2024-10-29 Thread Andres Freund
Hi, On 2024-10-26 16:14:25 +0200, Alvaro Herrera wrote: > > A fixed-size shared memory block, currently accommodating 30 records, > > is used to store the statistics. > > Hmm, would it make sene to use dynamic shared memory for this? +1 > The publishing backend could dsm_create one DSM chunk o

Re: define pg_structiszero(addr, s, r)

2024-10-29 Thread Bertrand Drouvot
hi, On Tue, Oct 29, 2024 at 10:23:37AM +0100, Peter Eisentraut wrote: > On 29.10.24 08:54, Bertrand Drouvot wrote: > > +static inline bool > > +pg_mem_is_all_zeros(const char *p, size_t len) > > This should be a void * pointer please. Thanks for looking at it! Yeah better, done in v4 attached.

Re: doc issues in event-trigger-matrix.html

2024-10-29 Thread Daniel Gustafsson
> On 29 Oct 2024, at 12:54, Peter Eisentraut wrote: > > I made a patch for this. I have expanded the narrative discussion on what > commands are supported for event triggers, also made a few > corrections/additions there, based on inspecting the source code. And then > removed the big matrix

Re: general purpose array_sort

2024-10-29 Thread jian he
On Tue, Oct 29, 2024 at 12:48 AM Aleksander Alekseev wrote:. > > 0001: > > > +{ oid => '8810', descr => 'sort array', > > + proname => 'array_sort', provolatile => 'v', prorettype => 'anyarray', > > + proargtypes => 'anyarray', prosrc => 'array_sort'}, > > I would expect that array_sort() should

Re: Eager aggregation, take 3

2024-10-29 Thread Richard Guo
On Fri, Oct 18, 2024 at 12:44 PM jian he wrote: > 1. root->parse->resultRelation > 0 > just be 100% sure we are only dealing with SELECT, or we can add > Assert at the end of setup_eager_aggregation. Can GROUP BY clauses be used in INSERT/UPDATE/DELETE/MERGE statements? If not, I think there

Re: -Wformat-signedness

2024-10-29 Thread Peter Eisentraut
On 29.10.24 07:51, Michael Paquier wrote: On Tue, Oct 29, 2024 at 07:38:36AM +0100, Peter Eisentraut wrote: I think it could be useful to set up some better test coverage for various things overflowing signed integer maximums. For example, maybe you could hack initdb to advance the OID counter

Re: Eager aggregation, take 3

2024-10-29 Thread Richard Guo
On Fri, Oct 18, 2024 at 10:22 PM jian he wrote: > So overall I doubt here BTEQUALIMAGE_PROC flag usage is correct. The BTEQUALIMAGE_PROC flag is used to prevent eager aggregation for types whose equality operators do not imply bitwise equality, such as NUMERIC. After a second thought, I think it

Re: -Wformat-signedness

2024-10-29 Thread Peter Eisentraut
On 27.10.24 04:59, Andy Fan wrote: I haven't found anything that is a really serious bug, but I imagine you could run into trouble in various ways when you exceed the INT_MAX value. But then again, if you use up INT_MAX WAL timelines, you probably have other problems. ;-) Me too, just that want

Re: Converting contrib SQL functions to new style

2024-10-29 Thread Ronan Dunklau
Le mercredi 1 septembre 2021, 19:27:35 heure normale d’Europe centrale Tom Lane a écrit : > The rest of this is stuck pending investigation of the ideas about > making new-style function creation safer when the creation-time path > isn't secure, so I suppose we should mark it RWF rather than leavi

Re: Make all Perl warnings fatal

2024-10-29 Thread Peter Eisentraut
On 22.10.24 11:25, Anton Voloshin wrote: Hello, On 18/01/2024 10:52, Peter Eisentraut wrote: > Committed, thanks. since this patch two .pl files without FATAL in "use warnings" have been committed to master: src/test/recovery/t/043_wal_replay_wait.pl src/test/modules/test_misc/t/006_signal_a

Re: Pgoutput not capturing the generated columns

2024-10-29 Thread vignesh C
On Tue, 29 Oct 2024 at 11:19, Hayato Kuroda (Fujitsu) wrote: > > Dear Shubham, > > Thanks for updating the patch! Here are my comments for v44. > > 01. fetch_remote_table_info() > > `bool *remotegencolpresent` is accessed unconditionally, but it can cause > crash > if NULL is passed to the functi

Re: Add ExprState hashing for GROUP BY and hashed SubPlans

2024-10-29 Thread David Rowley
On Mon, 28 Oct 2024 at 21:51, Andrei Lepikhov wrote: > Having remembered that SQL Server uses lightweight threads to execute > massive hash and aggregate operations in parallel, I think this patch is > promising. Unfortunately, it causes SEGFAULT on 'make check'. Thanks for having a look. The cra

Re: On disable_cost

2024-10-29 Thread Laurenz Albe
On Tue, 2024-10-29 at 12:21 +1300, David Rowley wrote: >     When using the enable/disable flags to disable plan node types, many of >     the flags only discourage the use of the corresponding plan node and don't >     outright disallow the planner's ability to use the plan node type.  This >    

  1   2   >