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

2024-12-09 Thread Shubham Khanna
Hi all, 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. Currently, pg_createsubscriber creates subscriptions with the two_phase option set t

Re: doc: Mention clock synchronization recommendation for hot_standby_feedback

2024-12-09 Thread Jakub Wartak
Hi Euler!, On Thu, Dec 5, 2024 at 4:07 PM Euler Taveira wrote: > On Thu, Dec 5, 2024, at 6:43 AM, Jakub Wartak wrote: > > One of our customers ran into a very odd case, where hot standby feedback > backend_xmin propagation stopped working due to major (hours/days) clock > time shifts on hypervis

Re: Proposal for Updating CRC32C with AVX-512 Algorithm.

2024-12-09 Thread John Naylor
On Sat, Dec 7, 2024 at 10:16 PM Devulapalli, Raghuveer wrote: > > There is another technique that computes CRC on 3 separate chunks and > > combines them at the end, so about 3x faster on large-enough chunks. > > That's the way used for the Arm proposal [0], coincidentally also citing a > > whit

Re: Track the amount of time waiting due to cost_delay

2024-12-09 Thread Dilip Kumar
On Mon, Dec 9, 2024 at 2:51 PM Masahiro Ikeda wrote: > > On 2024-12-06 18:31, Bertrand Drouvot wrote: > > Hi, > > > > On Thu, Dec 05, 2024 at 10:43:51AM +, Bertrand Drouvot wrote: > >> Yeah, people would likely use this new field to monitor long running > >> vacuum. > >> Long enough that this

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

2024-12-09 Thread Kirill Reshke
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 Hi! Looks like PFA should fix that. -- Best regards, Kirill Reshke v1-0001-Lock-tuple-for-inplace-upd

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-09 Thread Srinath Reddy Sadipiralla
Hi, added this bug to commitfest https://commitfest.postgresql.org/51/5428/  Regards, Srinath Reddy Sadipiralla Member of Technical Staff Zoho

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

2024-12-09 Thread Heikki Linnakangas
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 refactoring patches. Thanks for all the comments so far! Here is a new version of the rem

Re: Wrong results with right-semi-joins

2024-12-09 Thread Richard Guo
On Tue, Dec 3, 2024 at 5:56 PM Richard Guo wrote: > I've traced the root cause to ExecReScanHashJoin, where we neglect to > reset the inner-tuple match flags in the hash table for right-semi > joins when reusing the hash table. It was my oversight in commit > aa86129e1. Attached is patch to fix

Re: An inefficient query caused by unnecessary PlaceHolderVar

2024-12-09 Thread Richard Guo
On Tue, Dec 3, 2024 at 5:33 PM Andrei Lepikhov wrote: > A couple of words about your patch. These few lines of code caused a lot > of discoveries, but in my opinion, they look fine. But I didn't find > negative tests, where we need to wrap a Var with PHV like the following: Pushed after adding tw

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

2024-12-09 Thread Daniel Gustafsson
> 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 of 1.1.1 which offer FIPS certification all patch the common OpenSSL API FIPS_mode() rather than inve

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

2024-12-09 Thread Tomas Vondra
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 refactoring patches. Than

Re: Sort functions with specialized comparators

2024-12-09 Thread Andrey M. Borodin
> On 6 Dec 2024, at 08:49, John Naylor wrote: > > https://www.postgresql.org/message-id/CA%2BhUKGKztHEWm676csTFjYzortziWmOcf8HDss2Zr0muZ2xfEg%40mail.gmail.com Wow, what a thread! "Simpsons Already Did It" > On Fri, Dec 6, 2024 at 1:32 AM Andrey M. Borodin wrote: >> >>> On 5 Dec 2024, at 15:

Define STATS_MIN_ROWS for minimum rows of stats in ANALYZE

2024-12-09 Thread Ilia Evdokimov
Hi hackers, The repeated use of the number 300 in the ANALYZE-related code creates redundancy and relies on scattered, sometimes unclear, comments to explain its purpose. This can make the code harder to understand, especially for new contributors who might not immediately understand its sign

Subscription sometimes loses txns after initial table sync

2024-12-09 Thread Pritam Baral
This was discovered when testing the plan for a major version upgrade via logical replication. Said plan requires that some tables be synced before others. So I implemented it using ALTER PUBLICATION ... ADD TABLE ... followed by ALTER SUBSCRIPTION ... REFRESH PUBLICATION. A test for correctness re

Re: [PATCH] Add roman support for to_number function

2024-12-09 Thread Hunaid Sohail
Hi, Thanks for reviewing this patch. On Mon, Dec 9, 2024 at 3:07 AM Tomas Vondra wrote: > Thanks for a nice patch. I did a quick review today, seems almost there, > I only have a couple minor comments: > > 1) Template Patterns for Numeric Formatting > > Why the wording change? "input between 1

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-12-09 Thread Dilip Kumar
On Sat, Oct 19, 2024 at 2:18 AM Melanie Plageman wrote: > > On Wed, Oct 16, 2024 at 11:09 AM Tomas Vondra wrote: > > > > Thanks for the review! > > > > > 1) 0001 > > > > I find it a bit weird that we use ntuples to determine if it's exact or > > lossy. Not an issue caused by this patch, of course

Re: Removing unneeded self joins

2024-12-09 Thread Alexander Korotkov
On Sat, Jul 20, 2024 at 2:38 PM Alexander Korotkov wrote: > We initially didn't use ChangeVarNodes() in SJE at all. See the last > patch version without it [1]. We're trying to address Tom Lane's > proposal to re-use more of existing tree-manipulation infrastructure > [2]. I agree with you that

Re: shared-memory based stats collector - v70

2024-12-09 Thread Michael Paquier
On Sat, Dec 07, 2024 at 12:31:46PM +0300, Anton A. Melnikov wrote: > Completely agree that the original comment needs to be revised, > since it implies that it is normal for deleted entries to be here, > but it is not the case. Yep, so applied v2-0001 to document that, and backpatched it as it is

Re: Missing LWLock protection in pgstat_reset_replslot()

2024-12-09 Thread Michael Paquier
On Thu, Dec 05, 2024 at 07:11:54AM +, Bertrand Drouvot wrote: > Yeah that seems the right thing to do for me too. Thanks for the review. I've looked a bit more at the other paths handling dropped entries and they should be fine, created a TAP test that's able to check the scenario sent by Ant

Re: refactor AlterDomainAddConstraint (alter domain add constraint)

2024-12-09 Thread jian he
hi. ALTER DOMAIN ADD CONSTRAINT syntax more simple than CREATE DOMAIN. So in gram.y, I changed DomainConstraintElem to the following: DomainConstraintElem: CHECK '(' a_expr ')' { Constraint *n = makeNode(Constraint); n->contype =

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

2024-12-09 Thread Michael Paquier
On Fri, Dec 06, 2024 at 08:23:00AM +, Zhijie Hou (Fujitsu) wrote: > Thanks for the suggestions. They make sense to me. > > Please see the updated version as attached. It sounds to me that we are in agreement for HEAD, so I've moved ahead and fixed this issue on HEAD using your patch that adds

Re: Pass ParseState as down to utility functions.

2024-12-09 Thread Kirill Reshke
Thank you for reviewing this! On Fri, 6 Dec 2024 at 19:01, Alvaro Herrera wrote: > I think it would make more sense to write the commit message in terms of > the DDL commands that now report error position, than the C functions. > Such a list of commands does not need to be exhaustive; a > repres

Re: Assert failure on running a completed portal again

2024-12-09 Thread Yugo NAGATA
On Sun, 08 Dec 2024 14:25:53 -0500 Tom Lane wrote: > I wrote: > > After looking at this further, I think this whole "run_once" > > business is badly designed, worse documented, and redundant > > (as well as buggy). It can be replaced with three self-contained > > lines in ExecutePlan, as per the

Fwd: Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-09 Thread Srinath Reddy Sadipiralla
Forwarded message From: Srinath Reddy Sadipiralla To: "Nazir Bilal Yavuz", "pgsql-hackers", "Andres Freund" Date: Mon, 09 Dec 2024 10:14:06 +0530 Subject: Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty? Forwarded me

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

2024-12-09 Thread jian he
On Sun, Dec 8, 2024 at 10:58 PM Andrew Dunstan wrote: > > So the actual sort order as implemented is, AIUI, > > Object > Non-Empty-Array > Boolean > Number > String > Null > Empty-Array > > which is ugly, but fortunately not many apps rely on jsonb sort order. > > Nobody else has commented, so I p

Incorrect EXPLAIN ANALYZE output in bloom index docs

2024-12-09 Thread David Rowley
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 created with a 100 thousand row table, but the commands given are to

Re: Proper object locking for GRANT/REVOKE

2024-12-09 Thread Noah Misch
On Mon, Dec 02, 2024 at 12:13:56PM +0100, Peter Eisentraut wrote: > On 25.11.24 02:24, Noah Misch wrote: > > commit d31bbfb wrote: > > > --- a/src/backend/catalog/aclchk.c > > > +++ b/src/backend/catalog/aclchk.c > > > @@ -659,147 +659,77 @@ ExecGrantStmt_oids(InternalGrant *istmt) > > >* objec

Re: Why we need to check for local buffers in BufferIsExclusiveLocked and BufferIsDirty?

2024-12-09 Thread Srinath Reddy Sadipiralla
On Sun, 08 Dec 2024 18:23:21 +0530 Nazir Bilal Yavuz wrote --- Hi Srinath, On Sat, 7 Dec 2024 at 11:17, Srinath Reddy Sadipiralla wrote: > > On Fri, 06 Dec 2024 16:40:51 +0530 Nazir Bilal Yavuz > > wrote --- > > L

Re: generic plans and "initial" pruning

2024-12-09 Thread Amit Langote
On Fri, Dec 6, 2024 at 5:18 PM Amit Langote wrote: > On Thu, Dec 5, 2024 at 11:07 PM Tomas Vondra wrote: > > On 12/5/24 12:28, Amit Langote wrote: > > > On Thu, Dec 5, 2024 at 3:53 PM Amit Langote > > > wrote: > > >> On Thu, Dec 5, 2024 at 2:20 AM Tomas Vondra wrote: > > >>> Sure, changing the

remove pgrminclude?

2024-12-09 Thread Peter Eisentraut
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 copied around during refactorings

Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY

2024-12-09 Thread Amit Kapila
On Fri, Dec 6, 2024 at 11:10 AM Shlok Kyal wrote: > > Thanks Peter, for pointing this out. > I also feel that the error message suggested by Amit would be better. > I have attached a patch for the same. > Pushed. -- With Regards, Amit Kapila.

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

2024-12-09 Thread Tomas Vondra
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 >> refactoring patches. Thanks for all the comments so far! Here is a new >> version of the remaining patches. >> Hi, the TAP tes

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-12-09 Thread Alexander Korotkov
Hi! On Fri, Aug 30, 2024 at 11:43 AM Dmitry Koval wrote: > I plan to prepare fixes for issues from email [1] as separate commits > (for better code readability). Attachment in this email is a variant of > fix for the issue: > > > 1. Function createPartitionTable() should be rewritten using > >

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Andrea Gelmini
Il Lun 9 Dic 2024, 10:19 Michael Harris ha scritto: > > Is this already being looked into? > Funny, i guess it's the same reason I see randomly complain of WhatsApp web interface, on Chrome, since I switched to XFS. It says something like "no more space on disk" and logout, with more than 300GB

Re: proposal: schema variables

2024-12-09 Thread jian he
On Mon, Dec 9, 2024 at 2:33 AM Pavel Stehule wrote: > > Hi > again. only applied v20241208-0001-Enhancing-catalog-for-support-session-variables-and-.patch. /* we want SessionVariableCreatePostprocess to see the catalog changes. */ 0001 doesn't have SessionVariableCreatePostprocess, so this commen

Re: Add a warning message when using unencrypted passwords

2024-12-09 Thread Andrei Lepikhov
On 7/12/2024 21:39, Guillaume Lelarge wrote: I'm interested in any comments about this. I didn't create a commitfest entry yet, I'm mostly waiting on your comments. My first impression is that such a GUC may be generalised - something like a 'security_warnings' parameter. Also, you can check the

Re: Track the amount of time waiting due to cost_delay

2024-12-09 Thread Masahiro Ikeda
On 2024-12-06 18:31, Bertrand Drouvot wrote: Hi, On Thu, Dec 05, 2024 at 10:43:51AM +, Bertrand Drouvot wrote: Yeah, people would likely use this new field to monitor long running vacuum. Long enough that this error should be acceptable. Do you agree? OTOH, adding the 100% accuracy looks

Re: Do not scan index in right table if condition for left join evaluates to false using columns in left table

2024-12-09 Thread Andrei Lepikhov
On 8/12/2024 23:37, Andres Freund wrote: On 2024-12-08 15:44:23 +0700, Andrei Lepikhov wrote: On 8/12/2024 09:52, Andres Freund wrote: I think avoiding touching a hash table and an index under MergeJoin can also be beneficial. How would you get significant wins for mergejoins? You need to go

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

2024-12-09 Thread Alexander Kukushkin
Hello Hacker, When Postgres is compiled with --enable-cassert I get subj when doing the following: postgres=# create user test; CREATE ROLE postgres=# alter database postgres owner to test; ALTER DATABASE postgres=# reassign owned by test to postgres; WARNING: missing lock on database "postgres"

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Jakub Wartak
On Mon, Dec 9, 2024 at 10:19 AM Michael Harris wrote: Hi Michael, We found this thread describing similar issues: > > > https://www.postgresql.org/message-id/flat/AS1PR05MB91059AC8B525910A5FCD6E699F9A2%40AS1PR05MB9105.eurprd05.prod.outlook.com > We've got some case in the past here in EDB, wher

Re: Conflict detection for update_deleted in logical replication

2024-12-09 Thread Amit Kapila
On Mon, Dec 9, 2024 at 3:20 PM Nisha Moond wrote: > > Here is a summary of tests targeted to the Publisher node in a > Publisher-Subscriber setup. > (All tests done with v14 patch-set) > > > Performance Tests: > > Test machine details: > In

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

2024-12-09 Thread Amit Kapila
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 to > > use Alvaro's version [1] for the back branches. > > FWIW for bac

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Tomas Vondra
On 12/9/24 08:34, Michael Harris wrote: > Hello PG Hackers > > 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

Re: Parallel heap vacuum

2024-12-09 Thread Peter Smith
Hi Sawada-San. FWIW, here are the remainder of my review comments for the patch v4-0001 == src/backend/access/heap/vacuumlazy.c lazy_scan_heap: 2.1. + /* + * Do the actual work. If parallel heap vacuum is active, we scan and + * vacuum heap with parallel workers. + */ /with/using/ ~~~ 2

Re: fixing tsearch locale support

2024-12-09 Thread Peter Eisentraut
I have expanded this patch set. The first three patches are the same as before. I have added a new patch that gets rid of lowerstr() from ts_locale.c and replaces it with the standard str_tolower() that everyone else is using. lowerstr() and lowerstr_with_len() in ts_locale.c do the same thi

FileFallocate misbehaving on XFS

2024-12-09 Thread Michael Harris
Hello PG Hackers 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 following error: pg_restore: error: could not exec

Re: Giving the shared catalogues a defined encoding

2024-12-09 Thread Thomas Munro
On Sat, Dec 7, 2024 at 7:51 AM Tom Lane wrote: > Over in the discussion of bug #18735, I've come to the realization > that these problems apply equally to the filesystem path names that > the server deals with: not only the data directory path, but the > path to the installation files [1]. Can we

Re: Popcount optimization using SVE for ARM

2024-12-09 Thread devanga.susmi...@fujitsu.com
Hi Nathan, Thanks for your suggestion. I’ll move this discussion to the existing thread so we can all work together toward a more efficient solution. Regards, Susmitha Devanga. From: Nathan Bossart Sent: Friday, December 6, 2024 21:09 To: Kirill Reshke Cc: Sus

Re: Add a warning message when using unencrypted passwords

2024-12-09 Thread Jelte Fennema-Nio
On Sat, 7 Dec 2024 at 15:40, Guillaume Lelarge wrote: > > Whenever log_statement is set to all (which I understand should be done for > > a short period of time for troubleshooting purposes only), if we change the > > password for a user, or create a new user, the passwords would be logged in >

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Tomas Vondra
On 12/9/24 10:47, Andrea Gelmini wrote: > > > Il Lun 9 Dic 2024, 10:19 Michael Harris > ha scritto: > > > Is this already being looked into? > > > Funny, i guess it's the same reason I see randomly complain of WhatsApp > web interface, on Chrome, since I switch

Re: shared-memory based stats collector - v70

2024-12-09 Thread Bertrand Drouvot
Hi, On Mon, Dec 09, 2024 at 02:39:58PM +0900, Michael Paquier wrote: > On Sat, Dec 07, 2024 at 12:31:46PM +0300, Anton A. Melnikov wrote: > > Completely agree that the original comment needs to be revised, > > since it implies that it is normal for deleted entries to be here, > > but it is not the

Re: Track the amount of time waiting due to cost_delay

2024-12-09 Thread Bertrand Drouvot
Hi, On Mon, Dec 09, 2024 at 05:18:30PM +0530, Dilip Kumar wrote: > On Mon, Dec 9, 2024 at 2:51 PM Masahiro Ikeda > wrote: > > > > On 2024-12-06 18:31, Bertrand Drouvot wrote: > > > Hi, > > > > > > On Thu, Dec 05, 2024 at 10:43:51AM +, Bertrand Drouvot wrote: > > >> Yeah, people would likely

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

2024-12-09 Thread Yan Chengpeng
If many people are already using this ‘wrong’ behavior. I agree to change the doc. I also think using ‘null’ may be a better choice. Thanks for your comments. From: jian he Date: Monday, December 9, 2024 at 16:56 To: Andrew Dunstan Cc: Yan Chengpeng , pgsql-hack...@postgresql.org Subject: Re:

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

2024-12-09 Thread Yan Chengpeng
Sorry, I uploaded the wrong file. I uploaded a new patch with the modified document. Please take a review. Thanks! From: Yan Chengpeng Date: Monday, December 9, 2024 at 21:22 To: jian he , Andrew Dunstan Cc: pgsql-hack...@postgresql.org Subject: Re: [PATCH] Fix jsonb comparison for raw scalar

Re: Giving the shared catalogues a defined encoding

2024-12-09 Thread Thomas Munro
On Sat, Dec 7, 2024 at 7:51 AM Tom Lane wrote: > Over in the discussion of bug #18735, I've come to the realization > that these problems apply equally to the filesystem path names that > the server deals with: not only the data directory path, but the > path to the installation files [1]. Can we

Re: Add a warning message when using unencrypted passwords

2024-12-09 Thread Greg Sabino Mullane
Overall +1 to the idea of a warning. Regarding warning vs error, I agree that a WARNING is probably the right > choice generally. But I think that Divya is correct: When > log_statement = 'all', an error should be thrown instead. First, it should be for 'all' AND 'ddl'. And obviously glossing ov

Re: Proposal to add a new URL data type.

2024-12-09 Thread Alexander Borisov
06.12.2024 21:04, Matthias van de Meent: On Thu, 5 Dec 2024 at 15:02, Alexander Borisov wrote: [..] I'd be extremely annoyed if URLs I wrote into the database didn't return in identical manner when fetched from the database. See also how numeric has different representations of the same value

Re: Add a warning message when using unencrypted passwords

2024-12-09 Thread Daniel Gustafsson
> On 9 Dec 2024, at 14:26, Greg Sabino Mullane wrote: > -1 to throwing an ERROR - that's not really an error, and not our call to > make, so a WARNING is sufficient. Agreed, regardless of how bad it's considered, it's not an error. There are many ways sensitive data can end up in the logs and

Re: Wrong results with right-semi-joins

2024-12-09 Thread Melanie Plageman
On Tue, Dec 3, 2024 at 3:56 AM Richard Guo wrote: > > I ran into $subject and it can be reproduced with the query below. > > create temp table tbl_rs(a int, b int); > insert into tbl_rs select i, i from generate_series(1,10)i; > analyze tbl_rs; > > set enable_nestloop to off; > set enable_hashagg

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

2024-12-09 Thread Joe Conway
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 of 1.1.1 which offer FIPS certification all patch the commo

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

2024-12-09 Thread vignesh C
On Mon, 9 Dec 2024 at 16:25, Shubham Khanna wrote: > > Hi all, > > 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 this will be u

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: 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: [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: 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: 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

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: 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

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: [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/

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: 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: [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: 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: 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: 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: NOT ENFORCED constraint feature

2024-12-09 Thread jian he
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.sql so segmental fault happened again: create table tx(a int

Re: Document NULL

2024-12-09 Thread David G. Johnston
On Mon, Dec 2, 2024 at 12:18 AM jian he wrote: > >> > >> typo: > >> There are none. During initializion all settings are assigned a > non-null value. > >> 5.2.16. Null Values in Partiton Keys > >> As noted in the synatx chapter, a null value literal is written using > >> the NULL keyword. Its typ

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Andres Freund
Hi, On 2024-12-09 15:47:55 +0100, Tomas Vondra wrote: > On 12/9/24 11:27, Jakub Wartak wrote: > > On Mon, Dec 9, 2024 at 10:19 AM Michael Harris > > wrote: > > > > Hi Michael, > > > > We found this thread describing similar issues: > > > > https://www.postgresq

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: 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: 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: Add a warning message when using unencrypted passwords

2024-12-09 Thread Guillaume Lelarge
Hi, Le lun. 9 déc. 2024 à 14:40, Daniel Gustafsson a écrit : > > On 9 Dec 2024, at 14:26, Greg Sabino Mullane wrote: > > > -1 to throwing an ERROR - that's not really an error, and not our call > to make, so a WARNING is sufficient. > > Agreed, regardless of how bad it's considered, it's not an

Re: Track the amount of time waiting due to cost_delay

2024-12-09 Thread Dilip Kumar
On Mon, Dec 9, 2024 at 6:55 PM Bertrand Drouvot wrote: > > Hi, > > On Mon, Dec 09, 2024 at 05:18:30PM +0530, Dilip Kumar wrote: > > On Mon, Dec 9, 2024 at 2:51 PM Masahiro Ikeda > > wrote: > > > > > > On 2024-12-06 18:31, Bertrand Drouvot wrote: > > > > Hi, > > > > > > > > On Thu, Dec 05, 2024 a

Re: meson missing test dependencies

2024-12-09 Thread Peter Eisentraut
On 07.12.24 21:45, Andres Freund wrote: If a test target does not have ay dependency 'meson test' treats it has having a dependency on the project default test. Which in turn currently includes everything that will be installed, i.e. everything that tmp_install might need. But that's not somethin

Re: meson missing test dependencies

2024-12-09 Thread Andres Freund
Hi, On 2024-12-09 16:06:18 +0100, Peter Eisentraut wrote: > On 07.12.24 21:45, Andres Freund wrote: > > If a test target does not have ay dependency 'meson test' treats it has > > having > > a dependency on the project default test. Which in turn currently includes > > everything that will be ins

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: 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

IWYU annotations

2024-12-09 Thread Peter Eisentraut
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 peculiarities of the PostgreSQL

some Page/PageData const stuff

2024-12-09 Thread Peter Eisentraut
In [0] I wrote: """ I was fiddling a bit with making some Page-related APIs const-proof, which might involve changing something like "Page p" to "const PageData *p", but I was surprised that a type PageData exists but it's an unrelated type local to generic_xlog.c. This patch renames that ty

Re: FileFallocate misbehaving on XFS

2024-12-09 Thread Tomas Vondra
On 12/9/24 11:27, Jakub Wartak wrote: > On Mon, Dec 9, 2024 at 10:19 AM Michael Harris > wrote: > > Hi Michael, > > We found this thread describing similar issues: > > https://www.postgresql.org/message-id/flat/ > > AS1PR05MB91059AC8B525910A5FCD6E699F9A2

Re: Document NULL

2024-12-09 Thread David G. Johnston
On Sat, Nov 23, 2024 at 5:30 AM Marcos Pegoraro wrote: > Em qui., 21 de nov. de 2024 às 12:04, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > > Typo in NuLl, mixed upper and lower case. > > SELECT > NULL AS "Literal Null Value", > pg_typeof(null) AS "Type of Null", > pg

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: 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: 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: 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: 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: 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

  1   2   >