Re: NOT ENFORCED constraint feature

2024-12-09 Thread jian he
hi. some minor issue about v7-0001. there are 5 appearances of "sizeof(CookedConstraint)" to make it safe, it would be nice to manual do ` cooked->is_enforced = true; ` for other kinds of constraints. static bool MergeWithExistingConstraint(Relation rel, const char *ccname, Node *expr, bool a

Re: XMLDocument (SQL/XML X030)

2024-12-09 Thread Jim Jones
On 04.12.24 17:18, Jim Jones wrote: > I'd like to propose the implementation of XMLDocument (SQL/XML X030). > It basically returns an XML document from a given XML expression, e.g. > > SELECT >   xmldocument( >     xmlelement(NAME foo, >   xmlattributes(42 AS att), >   xmlelement(NAME bar,

Re: shared-memory based stats collector - v70

2024-12-09 Thread Anton A. Melnikov
Hi! On 09.12.2024 11:03, Bertrand Drouvot wrote: There is a missing space. I think that should be " at server..." or "...%llu ". Thanks for pointing this out. In the other code the elog messages are all on one line, regardless of their length. Did the same in v3. On 10.12.2024 09:42, Bertra

Re: [PATCH] Add support for displaying database service in psql prompt

2024-12-09 Thread Michael Paquier
On Thu, Nov 28, 2024 at 09:17:23PM +0100, Michael Banck wrote: > Hi, > > On Tue, Nov 19, 2024 at 07:47:58PM -0500, Greg Sabino Mullane wrote: > > Compiled and tested: works fine, so +1 from me. Honestly, I was surprised > > %s was still available. :) > > Thanks. Was that full review? You kept the

Re: Inconsistent output handling in 002_pg_upgrade.pl test logs

2024-12-09 Thread Michael Paquier
On Mon, Oct 28, 2024 at 04:44:48PM +0100, Joel Jacobson wrote: > On Mon, Oct 28, 2024, at 13:44, Daniel Gustafsson wrote: >>> On 28 Oct 2024, at 13:38, Joel Jacobson wrote: >>> Option 1: Keep output together using note >> >>> Option 2: Adjust header message for separate logs >> >>> Thoughts on the

Re: shared-memory based stats collector - v70

2024-12-09 Thread Bertrand Drouvot
Hi, On Tue, Dec 10, 2024 at 09:54:36AM +0900, Michael Paquier wrote: > On Mon, Dec 09, 2024 at 08:03:54AM +, Bertrand Drouvot wrote: > > Right. OTOH I think that could help the tap test added in da99fedf8c to not > > rely on assert enabled build (the tap test could "simply" check for the > > W

Re: [PATCHES] Post-special page storage TDE support

2024-12-09 Thread Michael Paquier
On Wed, Mar 13, 2024 at 11:26:48AM -0500, David Christensen wrote: > Enclosing v4 for this patch series, rebased atop the > constant-splitting series[1]. For the purposes of having cfbot happy, > I am including the prerequisites as a squashed commit v4-, however > this is not technically part

Re: testing framework for MVCC & vacuum (freeze) & heap_page_prune etc.

2024-12-09 Thread Andy Fan
"Andrey M. Borodin" writes: >> On 10 Dec 2024, at 08:31, Andy Fan wrote: >> >> I want to know if we have some existing testing framework for >> this area (design, code, licence etc). > > I think isolation tests [0] are what you are looking for. These tests are > designed to test concurrent exe

Re: Pgoutput not capturing the generated columns

2024-12-09 Thread Michael Paquier
On Thu, Nov 07, 2024 at 03:46:54PM +0530, Amit Kapila wrote: > Can we slightly modify it as: "If true, this publication replicates > the generated columns in the tables associated with the publication."? > BTW, we might want to say: "If true, this publication replicates the > stored generated colum

Re: [18] Fix a few issues with the collation cache

2024-12-09 Thread Michael Paquier
On Fri, Sep 20, 2024 at 05:28:48PM -0700, Jeff Davis wrote: > Updated and rebased. The patch has been failing to apply for a couple of weeks now. Could you rebase please? -- Michael signature.asc Description: PGP signature

Re: psql client does not handle WSAEWOULDBLOCK on Windows

2024-12-09 Thread Michael Paquier
On Tue, Aug 06, 2024 at 04:01:42PM +0800, Ning wrote: > In the function of gss_read() if print the value of errno and SOCK_ERRNO > separately, I found the values are different: > *ret = pqsecure_raw_read(conn, recv_buffer, length); > if (*ret < 0) > { > printf("errno: %d\n", errno); > printf("resu

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Michael Harris
Hi Andres Following up on the earlier question about OS upgrade paths - all the cases reported so far are either on RL8 (Kernel 4.18.0) or were upgraded to RL9 (kernel 5.14.0) and the affected filesystems were preserved. In fact the RL9 systems were initially built as Centos 7, and then when that

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Michael Harris
Hi again One extra piece of information: I had said that all the machines were Rocky Linux 8 or Rocky Linux 9, but actually a large number of them are RHEL8. Sorry for the confusion. Of course RL8 is a rebuild of RHEL8 so it is not surprising they would be behaving similarly. Cheers Mike On Tu

Re: WAL_LOG CREATE DATABASE strategy broken for non-standard page layouts

2024-12-09 Thread Michael Paquier
On Sat, Sep 14, 2024 at 06:57:21PM +, Akshat Jaimini wrote: > Quick question, are there any more revisions left to be done on this > patch from the previous feedback? This patch is still listed in the CF app waiting on author with what looks like Robert and Tom objecting to it, because it mak

Re: sslinfo extension - add notbefore and notafter timestamps

2024-12-09 Thread Michael Paquier
On Mon, Oct 28, 2024 at 09:59:35AM +0100, Daniel Gustafsson wrote: > The recent bump in minmum required versions of OpenSSL and LibreSSL made me > remember to revisit this patch which was previously reverted due to library > incompatibility (with *both* OpenSSL and LibreSSL on different APIs). > >

Re: long-standing data loss bug in initial sync of logical replication

2024-12-09 Thread Michael Paquier
On Tue, Oct 08, 2024 at 03:21:38PM +0530, Shlok Kyal wrote: > I have tested the scenario shared by you on the thread [1]. And I > confirm that the latest patch [2] fixes this issue. > > [1] > https://www.postgresql.org/message-id/CAD21AoAenVqiMjpN-PvGHL1N9DWnHSq673bfgr6phmBUzx=k...@mail.gmail.com

Re: Skip collecting decoded changes of already-aborted transactions

2024-12-09 Thread Dilip Kumar
On Tue, Dec 10, 2024 at 11:09 AM Amit Kapila wrote: > > On Tue, Dec 10, 2024 at 10:59 AM Dilip Kumar wrote: > > > > On Tue, Nov 26, 2024 at 3:02 AM Masahiko Sawada > > wrote: > > > > > > > > I've attached a new version patch that incorporates all comments I got so > > > far. > > > > > > I thin

Re: Memory leak in WAL sender with pgoutput (v10~)

2024-12-09 Thread Amit Kapila
On Tue, Dec 10, 2024 at 8:54 AM vignesh C wrote: > > On Tue, 10 Dec 2024 at 04:56, Michael Paquier wrote: > > > > On Mon, Dec 09, 2024 at 03:36:15PM +0530, Amit Kapila wrote: > > > It couldn't solve the problem completely even in back-branches. The > > > SQL API case I mentioned and tested by Hou

Re: Skip collecting decoded changes of already-aborted transactions

2024-12-09 Thread Amit Kapila
On Tue, Dec 10, 2024 at 10:39 AM Amit Kapila wrote: > > 5. > +/* > + * Check the transaction status by looking CLOG and discard all changes if > + * the transaction is aborted. The transaction status is cached in > + * txn->txn_flags so we can skip future changes and avoid CLOG lookups on the > +

Re: WARNING: missing lock on database "postgres" (OID 5) @ TID (0,4)

2024-12-09 Thread Kirill Reshke
On Tue, 10 Dec 2024 at 10:45, Kirill Reshke wrote: > PFA v2. Also CF entry https://commitfest.postgresql.org/51/5430/ to get CI feedback. -- Best regards, Kirill Reshke

[BUG] Possible occurrence of segfault in ecpg test

2024-12-09 Thread Daniil Davydov
Hi, The src/interfaces/ecpg/test/sql/bytea.pgc file contains the following code : *** init(); exec sql truncate test; exec sql insert into test values(:send_buf[0], :send_buf[1]); exec sql insert into test values(:send_buf[0], :send_buf[1]); exec sql select data1 into :recv_vlen_buf from test; dump

Re: WARNING: missing lock on database "postgres" (OID 5) @ TID (0,4)

2024-12-09 Thread Kirill Reshke
On Mon, 9 Dec 2024 at 23:13, Noah Misch wrote: > This silences the warning, but it doesn't generally satisfy the locking > protocol at README.tuplock section "Locking to write inplace-updated tables". > The specific problem is that this locks the tuple after copying it from shared > buffers. If g

Re: Skip collecting decoded changes of already-aborted transactions

2024-12-09 Thread Amit Kapila
On Tue, Dec 10, 2024 at 10:59 AM Dilip Kumar wrote: > > On Tue, Nov 26, 2024 at 3:02 AM Masahiko Sawada wrote: > > > > > I've attached a new version patch that incorporates all comments I got so > > far. > > > > I think the patch is in good shape but I'm considering whether we > > might want to

Re: Skip collecting decoded changes of already-aborted transactions

2024-12-09 Thread Dilip Kumar
On Tue, Nov 26, 2024 at 3:02 AM Masahiko Sawada wrote: > > I've attached a new version patch that incorporates all comments I got so far. > > I think the patch is in good shape but I'm considering whether we > might want to call ReorderBufferToastReset() after truncating all > changes, in Reorder

Re: Track the amount of time waiting due to cost_delay

2024-12-09 Thread Dilip Kumar
On Mon, Dec 9, 2024 at 10:11 PM Bertrand Drouvot wrote: > > Hi, > > On Mon, Dec 09, 2024 at 08:34:13PM +0530, Dilip Kumar wrote: > > On Mon, Dec 9, 2024 at 6:55 PM Bertrand Drouvot > > > Yeah. I think we could change the wording that way: > > > > > > s/waiting due to/waiting during/ > > > > > > Do

Re: Skip collecting decoded changes of already-aborted transactions

2024-12-09 Thread Amit Kapila
On Tue, Nov 26, 2024 at 3:03 AM Masahiko Sawada wrote: > > I've attached a new version patch that incorporates all comments I got so far. > Review comments: === 1. + * The given transaction is marked as streamed if appropriate and the caller + * requested it by passing 'mark_txn_strea

Re: confusing / inefficient "need_transcoding" handling in copy

2024-12-09 Thread Michael Paquier
On Fri, Dec 06, 2024 at 04:20:42PM +0900, Sutou Kouhei wrote: > (Do you think that this patch is still needed?) This thread has fallen off my radar, my apologies about that. Yes, I think that this is a good thing to expand these tests. Let's take one step at a time. I have a couple of comments.

Re: Memory leak in WAL sender with pgoutput (v10~)

2024-12-09 Thread Michael Paquier
On Tue, Dec 10, 2024 at 03:24:19AM +, vignesh C wrote: > Yes, that makes sense. How about something like the attached patch. So you have this bit hidden in 7f481b8d3884, causing a small conflict when cherry-picking the change from 15 to 14: -oldctx = MemoryContextSwitchTo(CacheMem

Re: testing framework for MVCC & vacuum (freeze) & heap_page_prune etc.

2024-12-09 Thread Andrey M. Borodin
> On 10 Dec 2024, at 08:31, Andy Fan wrote: > > I want to know if we have some existing testing framework for > this area (design, code, licence etc). I think isolation tests [0] are what you are looking for. These tests are designed to test concurrent execution of various queries. More subt

Re: testing framework for MVCC & vacuum (freeze) & heap_page_prune etc.

2024-12-09 Thread Andy Fan
Andy Fan writes: > Hi, > > I'm willing to design one myself > but it would be better have a ask first to see if there is some existing > excellent project I can start with and contribute to. Just to show that I'm not a person who taking things for granted, this is my draft in this topic. I know

Re: UUID v7

2024-12-09 Thread Andrey M. Borodin
> On 10 Dec 2024, at 03:34, Masahiko Sawada wrote: > > I've attached the updated patches. Both patches look good to me. I'm not sure, but, perhaps, commit message of unleakproofing a function should mention that the problem was reported in Peter E. review. Best regards, Andrey Borodin.

Re: Possible integer overflow in bringetbitmap()

2024-12-09 Thread Michael Paquier
On Thu, Dec 05, 2024 at 08:46:45AM -0800, James Hunter wrote: > On Wed, Dec 4, 2024 at 10:13 PM Michael Paquier wrote: > > > > totalpages is signed, and BlockNumber is unsigned. Hence in theory > > you could always fall into a trap once totalpages gets higher than > > (2^31 - 1), no? This is not

Re: proposal: schema variables

2024-12-09 Thread jian he
hi. GRANT|REVOKE ALL VARIABLES IN SCHEMA schema_name [, ...] } seems to work. might be better to add tests. also src/bin/psql/tab-complete.in.c COMPLETE_WITH_SCHEMA_QUERY_PLUS(Query_for_list_of_grantables, we can also add "ALL VARIABLES IN SCHEMA " also need change this in grant.sgml: Th

testing framework for MVCC & vacuum (freeze) & heap_page_prune etc.

2024-12-09 Thread Andy Fan
Hi, There are so many sistuations in this area, and it is easy to broke something. I want to know if we have some existing testing framework for this area (design, code, licence etc). I'm willing to design one myself but it would be better have a ask first to see if there is some existing excell

Re: Pass ParseState as down to utility functions.

2024-12-09 Thread Michael Paquier
On Mon, Dec 09, 2024 at 12:50:20PM +0500, Kirill Reshke wrote: > Should be fixed in v7. +create domain d_fail as int4 constraint cc check(values > 1) deferrable; +ERROR: specifying constraint deferrability not supported for domains +LINE 1: ...in d_fail as int4 constraint cc check(values > 1) def

Re: Memory leak in WAL sender with pgoutput (v10~)

2024-12-09 Thread vignesh C
On Tue, 10 Dec 2024 at 04:56, Michael Paquier wrote: > > On Mon, Dec 09, 2024 at 03:36:15PM +0530, Amit Kapila wrote: > > It couldn't solve the problem completely even in back-branches. The > > SQL API case I mentioned and tested by Hou-San in the email [1] won't > > be solved. > > > > [1] - > >

Re: Fix some comments for GUC hooks of timezone_abbreviations

2024-12-09 Thread Michael Paquier
On Mon, Dec 09, 2024 at 09:18:48PM -0500, Tom Lane wrote: > Obvious typo indeed (probably my fault :-() As a matter of fact, you are right as this comes from 0a20ff54f5e6. No worries, I'll go fix that. -- Michael signature.asc Description: PGP signature

Re: Proposals for EXPLAIN: rename ANALYZE to EXECUTE and extend VERBOSE

2024-12-09 Thread David Rowley
On Thu, 21 Nov 2024 at 08:30, Guillaume Lelarge wrote: > OK, I'm fine with this. v4 patch attached with one plan showing read, > written, and dirtied buffers. Today I spent more time polishing this patch. There were a few cases in the docs that displayed EXPLAIN ANALYZE output that you'd not adj

Re: Memory leak in WAL sender with pgoutput (v10~)

2024-12-09 Thread Amit Kapila
On Tue, Dec 10, 2024 at 2:17 AM Masahiko Sawada wrote: > > On Mon, Dec 9, 2024 at 2:06 AM Amit Kapila wrote: > > > > On Thu, Dec 5, 2024 at 2:56 PM Masahiko Sawada > > wrote: > > > > > > > > > > > I realized that this patch cannot be backpatched because it introduces > > > > a new > > > > fiel

Re: Adding a '--two-phase' option to 'pg_createsubscriber' utility.

2024-12-09 Thread Peter Smith
Hi Shubham, Here are some review comments for the patch v1-0001. Note -- I think Kuroda-san's idea to use a new switch like '--enable-two-phase' would eliminate lots of my review comments below about the inconsistencies with CREATE SUBSCRIBER, and the current confusion about defaults and argument

Re: Fix some comments for GUC hooks of timezone_abbreviations

2024-12-09 Thread Tom Lane
Michael Paquier writes: > While browsing through the code, I have noticed two comments on top of > assign_timezone_abbreviations() and check_timezone_abbreviations() > that mention "assign_timezone_abbreviations" as the GUC name, while it > should be "timezone_abbreviations", obviously. Obvious t

RE: Adding a '--two-phase' option to 'pg_createsubscriber' utility.

2024-12-09 Thread Hayato Kuroda (Fujitsu)
Dear Shubham, Thanks for the proposal! > I am writing to propose the addition of the two_phase option in > pg_createsubscriber. As discussed in [1], supporting this feature > during the development of pg_createsubscriber was planned for this > version. Yes, that was the pending item. > The atta

Re: Cannot find a working 64-bit integer type on Illumos

2024-12-09 Thread Thomas Munro
On Thu, Dec 5, 2024 at 12:16 PM Tom Lane wrote: > Now you already snuck the camel's nose under the > tent by including stdint.h there, and maybe these additional headers > wouldn't do any further damage. Even though we fixed the immediate issue (thanks), this comment stayed with me. I did that b

Re: Incorrect EXPLAIN ANALYZE output in bloom index docs

2024-12-09 Thread David Rowley
On Tue, 10 Dec 2024 at 14:33, Yan Chengpeng wrote: > Most changes look good to me. Only two small comments here: > > 1. Why did the following part change from ‘never executed’ to execute. Why > the previous state is `never executed`? > ``` > - -> Bitmap Index Scan on btreeidx2 (cost=0.0

RE: Subscription sometimes loses txns after initial table sync

2024-12-09 Thread Zhijie Hou (Fujitsu)
On Monday, December 9, 2024 9:21 PM Pritam Baral wrote: > To: pgsql-hackers > Subject: Subscription sometimes loses txns after initial table sync > > This was discovered when testing the plan for a major version upgrade via > logical replication. Said plan requires that some tables be synced bef

Re: Incorrect EXPLAIN ANALYZE output in bloom index docs

2024-12-09 Thread Yan Chengpeng
> On Dec 9, 2024, at 15:53, David Rowley wrote: > > I was fixing up the patch in [1] with the intention of committing it > when I noticed that there are a few outdated EXPLAIN ANALYZE examples > in the documents for the bloom contrib module. > > The example outputs look like they've been creat

Re: Skip collecting decoded changes of already-aborted transactions

2024-12-09 Thread Masahiko Sawada
On Tue, Nov 26, 2024 at 10:01 PM vignesh C wrote: > > On Tue, 26 Nov 2024 at 02:58, Masahiko Sawada wrote: > > > > On Mon, Nov 18, 2024 at 11:12 PM vignesh C wrote: > > > > > > > > > Few comments: > > > > Thank you for reviewing the patch! > > > > > 1) Should we have the Assert inside ReorderBuf

Fix some comments for GUC hooks of timezone_abbreviations

2024-12-09 Thread Michael Paquier
Hi all, While browsing through the code, I have noticed two comments on top of assign_timezone_abbreviations() and check_timezone_abbreviations() that mention "assign_timezone_abbreviations" as the GUC name, while it should be "timezone_abbreviations", obviously. I have not noticed any similar mi

Re: Outdated comment on scram_build_secret

2024-12-09 Thread Michael Paquier
On Mon, Dec 09, 2024 at 08:39:03PM -0300, Matheus Alcantara wrote: > Commit b577743000 introduced the assert and remove the if condition. All > usages of this function is using an iteration > 0, so I think that is just a > matter of updating the documentation? If that's the case the attached patch

Re: shared-memory based stats collector - v70

2024-12-09 Thread Michael Paquier
On Mon, Dec 09, 2024 at 08:03:54AM +, Bertrand Drouvot wrote: > Right. OTOH I think that could help the tap test added in da99fedf8c to not > rely on assert enabled build (the tap test could "simply" check for the > WARNING in the logfile instead). That's true. Still, the coverage that we hav

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Andres Freund
Hi, On 2024-12-10 10:00:43 +1100, Michael Harris wrote: > On Mon, 9 Dec 2024 at 21:06, Tomas Vondra wrote: > > Sounds more like an XFS bug/behavior, so it's not clear to me what we > > could do about it. I mean, if the filesystem reports bogus out-of-space, > > is there even something we can do?

Outdated comment on scram_build_secret

2024-12-09 Thread Matheus Alcantara
Hi, The documentation for the iterations parameter on scram_build_secret say: * If iterations is 0, default number of iterations is used. But the body of the function have the following assert Assert(iterations > 0); Commit b577743000 introduced the assert and remove the if condition.

Re: Memory leak in WAL sender with pgoutput (v10~)

2024-12-09 Thread Michael Paquier
On Mon, Dec 09, 2024 at 12:46:35PM -0800, Masahiko Sawada wrote: > True. There seems another place where we possibly leak memory on > CacheMemoryContext when using pgoutput via SQL APIs: > > /* Map must live as long as the session does. */ > oldctx = MemoryContextSwitchTo(CacheMemo

Re: Memory leak in WAL sender with pgoutput (v10~)

2024-12-09 Thread Michael Paquier
On Mon, Dec 09, 2024 at 03:36:15PM +0530, Amit Kapila wrote: > It couldn't solve the problem completely even in back-branches. The > SQL API case I mentioned and tested by Hou-San in the email [1] won't > be solved. > > [1] - > https://www.postgresql.org/message-id/OS0PR01MB57166A4DA0ABBB94F2FBB2

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Andres Freund
Hi, On 2024-12-10 09:34:08 +1100, Michael Harris wrote: > On Tue, 10 Dec 2024 at 03:31, Andres Freund wrote: > > I found some references for bugs that were fixed in 5.13. But I think at > > least > > some of this would persist if the filesystem ran into the issue with a > > kernel > > before th

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Michael Harris
Hi Tomas On Mon, 9 Dec 2024 at 21:06, Tomas Vondra wrote: > Sounds more like an XFS bug/behavior, so it's not clear to me what we > could do about it. I mean, if the filesystem reports bogus out-of-space, > is there even something we can do? I don't disagree that it's most likely an XFS issue. H

Re: Unmark gen_random_uuid() function leakproof

2024-12-09 Thread Masahiko Sawada
On Mon, Dec 9, 2024 at 2:23 PM Andres Freund wrote: > > Hi, > > On 2024-12-09 14:10:30 -0800, Masahiko Sawada wrote: > > While reviewing UUIDv7 patch[1], I realized gen_random_uuid() is > > marked leakproof even though it doesn't take arguments. The functions > > without arguments don't need to be

Re: psql: Add tab completion for ALTER USER RESET

2024-12-09 Thread Tomas Vondra
Hi, On 11/29/24 09:42, Robins Tharakan wrote: > Hi, > > Please find attached a patch to help tab completion show only currently > set vars > during ALTER USER RESET. > > Currently tab completion provides a list of all vars which is only > partially helpful. > This patch allows tab completion to

Re: UUID v7

2024-12-09 Thread Masahiko Sawada
On Wed, Dec 4, 2024 at 9:04 AM Andrey M. Borodin wrote: > > > > > On 2 Dec 2024, at 11:00, Masahiko Sawada wrote: > > > > The monotonicity of generated UUIDv7 is guaranteed only within a > > single backend. > > I've addressed all items, except formatting a table... I can't build docs to > make a

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Michael Harris
Hi Andres On Tue, 10 Dec 2024 at 03:31, Andres Freund wrote: > Were those pg_upgrades done with pg_upgrade --clone? Or have been, on the same > filesystem, in the past? No, our procedure is to use --link. > I found some references for bugs that were fixed in 5.13. But I think at least > some of

Re: unused-but-set-variable warning on REL_13_STABLE

2024-12-09 Thread Nathan Bossart
On Mon, Dec 09, 2024 at 02:39:30PM -0500, Tom Lane wrote: > LGTM Thanks! Committed. -- nathan

Re: Document NULL

2024-12-09 Thread David G. Johnston
Thank you for the review. Changes noted below will be part of v5. On Fri, Nov 22, 2024 at 12:00 PM Jeff Davis wrote: > > One idea is to have a brief guidance section to help users know how to > use nulls in their data model effectively. For instance, if you allow > nulls for middle_name to mean

Re: Unmark gen_random_uuid() function leakproof

2024-12-09 Thread Andres Freund
Hi, On 2024-12-09 14:10:30 -0800, Masahiko Sawada wrote: > While reviewing UUIDv7 patch[1], I realized gen_random_uuid() is > marked leakproof even though it doesn't take arguments. The functions > without arguments don't need to be marked leakproof in principle. This > is the sole function that h

Re: Fix tiny memory leaks

2024-12-09 Thread Masahiko Sawada
On Mon, Dec 9, 2024 at 12:04 PM Daniel Gustafsson wrote: > > > On 9 Dec 2024, at 20:03, Daniel Gustafsson wrote: > > > >> On 9 Dec 2024, at 19:52, Masahiko Sawada wrote: > >> > >> On Fri, Dec 6, 2024 at 12:49 AM Daniel Gustafsson wrote: > >>> > On 6 Dec 2024, at 09:38, Tofig Aliev wrote:

Unmark gen_random_uuid() function leakproof

2024-12-09 Thread Masahiko Sawada
Hi, While reviewing UUIDv7 patch[1], I realized gen_random_uuid() is marked leakproof even though it doesn't take arguments. The functions without arguments don't need to be marked leakproof in principle. This is the sole function that has no arguments and is listed in the "List of built-in leakpr

Re: Document NULL

2024-12-09 Thread David G. Johnston
On Wed, Nov 20, 2024 at 7:24 PM jian he wrote: > > attached image.png for > 5.2.7.2. Array Elements and IN Bag Members > the example is too overwhelming, one or two should be enough? > Agreed, fixed in the upcoming v5. The four outputs are actually two equivalent pairs so I framed them up as s

Managing IO workers in postmaster's state machine

2024-12-09 Thread Andres Freund
Hi, For AIO, when using the worker process based "AIO", we need to manage a set of workers. These need to be started by postmaster, obviously. I have a few questions about the design details. They seemed mostly independent of the larger AIO thread, so I started this separately. 1) Where to star

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

2024-12-09 Thread Daniel Gustafsson
> On 9 Dec 2024, at 15:11, Joe Conway wrote: > > On 12/9/24 07:23, Daniel Gustafsson wrote: >>> On 4 Dec 2024, at 16:57, Joe Conway wrote: >>> I can send you the source RPM for openssl 1.1.1c which was an earlier FIPS >>> validated version, but the main FIPS patch contains: >> AFAICT the forks

Re: add support for the old naming libs convention on windows (ssleay32.lib and libeay32.lib)

2024-12-09 Thread Darek Ślusarczyk
On Wed, Dec 4, 2024 at 3:48 PM Daniel Gustafsson wrote: > > On 2 Dec 2024, at 22:12, Darek Ślusarczyk > wrote: > [...] > > -ssl_lib = cc.find_library('ssl', > > +ssl_lib = cc.find_library(['ssl', 'ssleay32'], > > I'm not a meson expert by any means but I was suprised to see this, > libna

Re: [Bug] Heap Use After Free in Window Aggregate Execution

2024-12-09 Thread David Rowley
On Thu, 14 Nov 2024 at 04:31, Jayesh Dehankar wrote: > We have discovered a bug in PostgreSQL v16.3 related to a top-level window > aggregate with a partition-by clause. The issue occurs when the run condition > fails, causing the window aggregate status to change from WINDOWAGG_RUN to > WINDOW

Re: Support for unsigned integer types

2024-12-09 Thread Jack Bay
>That could be avoided perhaps by measures like not having any implicit casts >between the int and uint hierarchies, but then there'd be a corresponding loss >of usability for the uint types. In my opinion no explicit cast between unsigned and signed integer is very desirable behavior. >Quick,

Re: Parallel heap vacuum

2024-12-09 Thread Tomas Vondra
Hi, Thanks for working on this. I took a quick look at this today, to do some basic review. I plan to do a bunch of testing, but that's mostly to get a better idea of what kind of improvements to expect - the initial results look quite nice and sensible. A couple basic comments: 1) I really like

Re: Refactoring postmaster's code to cleanup after child exit

2024-12-09 Thread Heikki Linnakangas
On 09/12/2024 14:47, Tomas Vondra wrote: On 12/9/24 13:30, Heikki Linnakangas wrote: On 09/12/2024 01:12, Tomas Vondra wrote: On 11/14/24 15:13, Heikki Linnakangas wrote: On 09/10/2024 23:40, Heikki Linnakangas wrote: I pushed the first three patches, with the new test and one of the small re

bt_index_parent_check and concurrently build indexes

2024-12-09 Thread Michail Nikolaev
Hello, everyone! While working on [0], I encountered an issue involving a missing tuple in an index that was built concurrently. The problem only occurred once, but it caused me a significant amount of frustration. :) After some time, I managed to find a way to reproduce the issue. It turns out t

Re: Memory leak in WAL sender with pgoutput (v10~)

2024-12-09 Thread Masahiko Sawada
On Mon, Dec 9, 2024 at 2:06 AM Amit Kapila wrote: > > On Thu, Dec 5, 2024 at 2:56 PM Masahiko Sawada wrote: > > > > > > > > I realized that this patch cannot be backpatched because it introduces a > > > new > > > field into the public PGOutputData structure. Therefore, I think we may > > > need

Re: Fix tiny memory leaks

2024-12-09 Thread Daniel Gustafsson
> On 9 Dec 2024, at 20:03, Daniel Gustafsson wrote: > >> On 9 Dec 2024, at 19:52, Masahiko Sawada wrote: >> >> On Fri, Dec 6, 2024 at 12:49 AM Daniel Gustafsson wrote: >>> On 6 Dec 2024, at 09:38, Tofig Aliev wrote: >>> There is a memory leak in functions check_application_name()

Re: Remove dependence on integer wrapping

2024-12-09 Thread Nathan Bossart
On Fri, Dec 06, 2024 at 02:12:51PM -0600, Nathan Bossart wrote: > I seem to have a knack for picking patches that take an entire afternoon to > back-patch... Here's what I have staged for commit early next week. Committed. I chickened out of back-patching this because 1) it adds new routines to

Re: unused-but-set-variable warning on REL_13_STABLE

2024-12-09 Thread Tom Lane
Nathan Bossart writes: > Adding PG_USED_FOR_ASSERTS_ONLY (as in the attached patch) seems sufficient > to suppress this warning. On newer versions, this variable is used for > more than assertions, so the patch only needs to be applied to v13. Since > this is trivial, I plan to commit it shortly

unused-but-set-variable warning on REL_13_STABLE

2024-12-09 Thread Nathan Bossart
My compiler emits the following warning on REL_13_STABLE when assertions are disabled: reorderbuffer.c:2471:8: warning: variable 'spilled' set but not used [-Wunused-but-set-variable] 2471 | Sizespilled = 0; | ^ Adding PG

Re: Fix tiny memory leaks

2024-12-09 Thread Daniel Gustafsson
> On 9 Dec 2024, at 19:52, Masahiko Sawada wrote: > > On Fri, Dec 6, 2024 at 12:49 AM Daniel Gustafsson wrote: >> >>> On 6 Dec 2024, at 09:38, Tofig Aliev wrote: >> >>> There is a memory leak in functions check_application_name() and >>> check_cluster_name(). >>> Functions are located in src

Re: Fix tiny memory leaks

2024-12-09 Thread Masahiko Sawada
On Fri, Dec 6, 2024 at 12:49 AM Daniel Gustafsson wrote: > > > On 6 Dec 2024, at 09:38, Tofig Aliev wrote: > > > There is a memory leak in functions check_application_name() and > > check_cluster_name(). > > Functions are located in src/backend/commands/variable.c > > LGTM. LGTM. It seems commi

Re: Assert failure on running a completed portal again

2024-12-09 Thread Tom Lane
I wrote: > Yugo NAGATA writes: >> I guess planstate is removed due to the redundancy that this is included >> in queryDesc. If so, I think we can also remove use_parallel_mode for the >> same reason. > Certainly there's a bit of aesthetic judgment involved here. After thinking awhile longer, I

Re: Document NULL

2024-12-09 Thread Marcos Pegoraro
Em seg., 9 de dez. de 2024 às 13:31, David G. Johnston < david.g.johns...@gmail.com> escreveu: > I'm OK with adding more cross-references (links or just brief comparative > verbiage like the above) to non-SQL null value treatment but this document, > for this patch, is going to focus solely on SQL

Re: [PATCH] Add sortsupport for range types and btree_gist

2024-12-09 Thread Andrey M. Borodin
> On 9 Dec 2024, at 22:10, Bernd Helmle wrote: > > So here's a version with the original, unchanged regression tests and > injection point removed (i hope i forgot nothing to revert). Besides unnecessary indentation changes in contrib/btree_gist/Makefile, the patch seems good to me. Best r

Re: WARNING: missing lock on database "postgres" (OID 5) @ TID (0,4)

2024-12-09 Thread Noah Misch
On Mon, Dec 09, 2024 at 04:50:16PM +0500, Kirill Reshke wrote: > On Mon, 9 Dec 2024 at 15:27, Alexander Kukushkin wrote: > > postgres=# reassign owned by test to postgres; > > WARNING: missing lock on database "postgres" (OID 5) @ TID (0,4) > > REASSIGN OWNED Thanks for the report. > --- a/src/

Re: SCRAM pass-through authentication for postgres_fdw

2024-12-09 Thread Matheus Alcantara
On 04/12/24 20:05, Jelte Fennema-Nio wrote: On Wed, 4 Dec 2024 at 23:11, Jacob Champion wrote: It makes me a little uneasy to give users a reason to copy identical salts/verifiers around... But for e.g. a loopback connection, it seems like there'd be no additional risk. Is that the target use c

Re: SCRAM pass-through authentication for postgres_fdw

2024-12-09 Thread Matheus Alcantara
Thanks for the comments! On 04/12/24 19:11, Jacob Champion wrote: This is achieved by storing the SCRAM ClientKey and ServerKey obtained during client authentication with the backend. These keys are then used to complete the SCRAM exchange between the backend and the fdw server, eliminating the

Re: Subscription sometimes loses txns after initial table sync

2024-12-09 Thread Pritam Baral
On 09/12/24 18:50, Pritam Baral wrote: > A reproducer script is attached. Apologies. The aforementioned script is broken. It was a poor port from an internal application. A corrected reproducer script is attached. -- #!/usr/bin/env regards Chhatoi Pritam Baral sub-loss-repro2.sh Descriptio

Re: Assert failure on running a completed portal again

2024-12-09 Thread Tom Lane
Yugo NAGATA writes: > On Sun, 08 Dec 2024 14:25:53 -0500 > Tom Lane wrote: > - * > - * Note: the ctid attribute is a 'junk' attribute that is removed before the > - * user can see it > * > */ > This comment remove seems not rel

Re: NOT ENFORCED constraint feature

2024-12-09 Thread Amul Sul
On Mon, Dec 9, 2024 at 9:40 PM jian he wrote: > > hi. > only applied v7-0001. > > alter_table.sgml says we can specify enforceability > for ALTER TABLE ADD column_constraint > and ALTER TABLE ADD column_constraint table_constraint. > but we didn't have a test for column_constraint in alter_table.

Re: Proposal: Role Sandboxing for Secure Impersonation

2024-12-09 Thread Eric Hanson
On Thu, Dec 5, 2024 at 4:29 PM Jelte Fennema-Nio wrote: > When PgBouncer is in transaction mode, the server connection will only > be unlinked, when PgBouncer receives a ReadyForQuery with the "idle" > flag from the server **and** there are no messages from the client in > flight anymore. It's tot

Re: remove pgrminclude?

2024-12-09 Thread Tom Lane
Peter Eisentraut writes: > I propose to remove the pgrminclude scripts and annotations. AFAICT, > per git log, the last time someone tried to do something with it was > around 2011. Also, many (not all) of the "pgrminclude ignore" > annotations are of a newer date but seem to have just been c

Re: [PATCH] Add sortsupport for range types and btree_gist

2024-12-09 Thread Bernd Helmle
Am Samstag, dem 30.11.2024 um 22:18 +0500 schrieb Andrey Borodin: > We tried to go that route, random DEBUG1 lines were breaking tests > (autovacuum or something like that, there was something non- > deterministic). I think we can dig exact reason from 2021 thread why > we abandoned that idea... >

Re: proposal: schema variables

2024-12-09 Thread Pavel Stehule
Hi st 20. 11. 2024 v 21:14 odesílatel Dmitry Dolgov <9erthali...@gmail.com> napsal: > > On Tue, Nov 19, 2024 at 08:14:01PM +0100, Pavel Stehule wrote: > > Hi > > > > I wrote POC of VARIABLE(varname) syntax support > > Thanks, the results look good. I'm still opposed the idea of having a > warning

Re: Track the amount of time waiting due to cost_delay

2024-12-09 Thread Bertrand Drouvot
Hi, On Mon, Dec 09, 2024 at 08:34:13PM +0530, Dilip Kumar wrote: > On Mon, Dec 9, 2024 at 6:55 PM Bertrand Drouvot > > Yeah. I think we could change the wording that way: > > > > s/waiting due to/waiting during/ > > > > Does that make sense? I don't think we need to mention cost limit here. > > Y

Re: IWYU annotations

2024-12-09 Thread Tom Lane
Peter Eisentraut writes: > I have done a pass over much of the source code with > include-what-you-use (IWYU) to remove superfluous includes (commits > dbbca2cf299, 9be4e5d293b, ecb5af77987). Along the way I have collected > some pragma annotations to deal with exceptions and special cases and

Re: [PATCH] SVE popcount support

2024-12-09 Thread Malladi, Rama
On 12/9/24 12:21 AM, devanga.susmi...@fujitsu.com wrote: Hello, We are sharing our patch for pg_popcount with SVE support as a contribution from our side in this thread. We hope this contribution will help in exploring and refining the popcount implementation further. Our patch uses the exist

Re: Document NULL

2024-12-09 Thread David G. Johnston
On Thu, Nov 21, 2024 at 8:03 AM Marcos Pegoraro wrote: > Em qui., 21 de nov. de 2024 às 11:42, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > >> >> I'm not following your train of thought here. Since null == null in >> json-land there isn't a need for or concept of "is distinct fr

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Andres Freund
Hi, On 2024-12-09 18:34:22 +1100, Michael Harris wrote: > Our application has recently migrated to PG16, and we have experienced > some failed upgrades. The upgrades are performed using pg_upgrade and > have failed during the phase where the schema is restored into the new > cluster, with the foll

Re: [PATCH] Fix jsonb comparison for raw scalar pseudo arrays

2024-12-09 Thread jian he
On Mon, Dec 9, 2024 at 9:27 PM Yan Chengpeng wrote: > > Sorry, I uploaded the wrong file. I uploaded a new patch with the modified > document. Please take a review. Thanks! > > sorry. maybe i didn't mention it explicitly. i mean something like: diff --git a/doc/src/sgml/json.sgml b/doc/src/sgml/

  1   2   >