Re: Limit length of queryies in pg_stat_statement extension

2025-01-16 Thread Julien Rouhaud
Hi, On Thu, Jan 16, 2025 at 10:19:49AM +0800, 赵庭海(庭章) wrote: > Hi all, > Recently, I have noticed a potential problem in the pg_stat_statements > extension. When the garbage collection is triggered within this extension, > if there is a significant amount of data to be written to the > pgss_query

Re: SQLFunctionCache and generic plans

2025-01-16 Thread Alexander Pyhalov
Pavel Stehule писал(а) 2024-12-31 18:39: Hi út 31. 12. 2024 v 16:36 odesílatel Alexander Pyhalov napsal: Hi. What should we do with "pre-parsed" SQL functions (when prosrc is empty)? How should we create cached plans when we don't have raw parsetrees? Currently we can create cached plans wi

Re: per backend I/O statistics

2025-01-16 Thread Michael Paquier
On Fri, Jan 17, 2025 at 06:06:35AM +, Bertrand Drouvot wrote: > On Fri, Jan 17, 2025 at 09:08:02AM +0900, Michael Paquier wrote: >> I could tweak that around the beginning of next week with a proposal >> of patch. Bertrand, perhaps you'd prefer hack on this one? > > Yeah, I had in mind to wor

Limit length of queryies in pg_stat_statement extension

2025-01-16 Thread 赵庭海(庭章)
Hi all, Recently, I have noticed a potential problem in the pg_stat_statements extension. When the garbage collection is triggered within this extension, if there is a significant amount of data to be written to the pgss_query_texts.stat file (for example, when tracking very long SQL queries), t

Re: per backend I/O statistics

2025-01-16 Thread Bertrand Drouvot
Hi, On Fri, Jan 17, 2025 at 09:08:02AM +0900, Michael Paquier wrote: > Anyway, let's just switch pgstat_backend.c so as we use a static > PgStat_BackendPending (pending name) to store the pending IO stats > that could be reused for also the WAL bits. It does not seem that > complicated as far as

Re: Pgoutput not capturing the generated columns

2025-01-16 Thread Peter Smith
Hi Vignesh. Some review comments for patch v52-0003 == 1. GENERAL - change to use enum. On Thu, Jan 16, 2025 at 7:47 PM vignesh C wrote: > > On Wed, 15 Jan 2025 at 11:17, Peter Smith wrote: > > 2. > > As suggested in more detail below, I think it would be better if you > > can define a C

Re: leafhopper: Assert("outerstartsel <= outerendsel"), File: "costsize.c"

2025-01-16 Thread Tom Lane
Michael Paquier writes: > This animal has been unstable for some time and this is likely just a > symptom masking a bigger issue, but leafhopper has reported an > intriguing failure yesterday on HEAD: > TRAP: failed Assert("outerstartsel <= outerendsel"), File: > "costsize.c", Line: 3678, PID: 823

leafhopper: Assert("outerstartsel <= outerendsel"), File: "costsize.c"

2025-01-16 Thread Michael Paquier
Hi, (Buildfarm machine owner in CC.) This animal has been unstable for some time and this is likely just a symptom masking a bigger issue, but leafhopper has reported an intriguing failure yesterday on HEAD: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=leafhopper&dt=2025-01-16%2007%3A41

Re: Psql meta-command conninfo+

2025-01-16 Thread Hunaid Sohail
Hi, On Thu, Jan 16, 2025 at 6:01 PM Alvaro Herrera wrote: > On 2025-Jan-16, Hunaid Sohail wrote: > > > server_encoding | UTF8 > > server_version| 18devel > > client_encoding | UTF8 > > session_authorization | hunaid > > standard_conforming

Re: Some ExecSeqScan optimizations

2025-01-16 Thread Amit Langote
Here's v5 with a few commit message tweaks. Barring objections, I would like to push this early next week. -- Thanks, Amit Langote v5-0001-Refactor-ExecScan-to-allow-inlining-of-its-core-l.patch Description: Binary data

Remove XLogRecGetFullXid() in xlogreader.c?

2025-01-16 Thread Michael Paquier
Hi all, XLogRecGetFullXid() has been introduced in 67b9b3ca3283 back in 2019, but as far as I can see this has never been used in the code and this is used nowhere in the core code. I have looked at Debian's codesearch and also looked at traces of it on github without seeing it being used anywher

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

2025-01-16 Thread Shubham Khanna
On Fri, Jan 17, 2025 at 5:43 AM Peter Smith wrote: > > Hi Shubham, > > Some review comments for patch v11-0001. > > == > src/sgml/ref/pg_createsubscriber.sgml > > 1. > -must accept local connections. > +must accept local connections. If you are planning to use the > +--enable-two-p

Re: Automatic update of time column

2025-01-16 Thread Tom Lane
"=?UTF-8?B?6LW15a6H6bmPKOWuh+W9rSk=?=" writes: > MySQL offers a similar feature through ON UPDATE CURRENT_TIMESTAMP. Is there > any > consideration for PostgreSQL to implement this functionality? It's been considered and rejected multiple times before. I don't really see why we'd alter that dec

Automatic update of time column

2025-01-16 Thread 赵宇鹏(宇彭)
Hello, CREATE TABLE test ( id INT, create_time TIMESTAMPTZ DEFAULT now(), update_time TIMESTAMPTZ DEFAULT now()); With a table like this, users often want the update_time to automatically update to the current timestamp when executing an UPDATE statement, without having to exp

Re: An improvement of ProcessTwoPhaseBuffer logic

2025-01-16 Thread Michael Paquier
On Thu, Jan 16, 2025 at 06:44:16PM -0800, Noah Misch wrote: > On Fri, Jan 17, 2025 at 11:04:03AM +0900, Michael Paquier wrote: >> +typedef void (*TwoPhaseCallback) (FullTransactionId fxid, uint16 info, >>void *recdata, uint32 len); >> >> Based on your latest pat

Re: convert libpgport's pqsignal() to a void function

2025-01-16 Thread Nathan Bossart
I've now committed all of this. I ended up finding a couple other frontend programs that called pqsignal() with an invalid signal number on Windows, so I fixed those as well. AFAICT the reason I didn't catch them in my earlier testing is because they aren't tested! I'll keep an eye on the buildf

Re: An improvement of ProcessTwoPhaseBuffer logic

2025-01-16 Thread Noah Misch
On Fri, Jan 17, 2025 at 11:04:03AM +0900, Michael Paquier wrote: > On Thu, Jan 16, 2025 at 04:52:21PM -0800, Noah Misch wrote: > > In other words, the root problem that led to commits e358425 and 7e125b2 was > > recovery interpreting pg_twophase file content before reaching consistency. > > We can'

Re: Adding OLD/NEW support to RETURNING

2025-01-16 Thread Richard Guo
On Fri, Jan 17, 2025 at 12:28 AM Dean Rasheed wrote: > I went over this again in detail and didn't find any problems, so I > have committed it. Thanks for all the review comments. It seems that adding ParseNamespaceItems for the OLD or NEW aliases may confuse scanNameSpaceForRelid() when searchin

Re: Pgoutput not capturing the generated columns

2025-01-16 Thread Peter Smith
On Thu, Jan 16, 2025 at 7:47 PM vignesh C wrote: > ... > > v52-0002 - One typo related to a publication name which Peter reported. Hi Vignesh, Patch v52-0002 LGTM. == Kind Regards, Peter Smith. Fujitsu Australia

Re: An improvement of ProcessTwoPhaseBuffer logic

2025-01-16 Thread Michael Paquier
On Thu, Jan 16, 2025 at 04:52:21PM -0800, Noah Misch wrote: > In other words, the root problem that led to commits e358425 and 7e125b2 was > recovery interpreting pg_twophase file content before reaching consistency. > We can't make the ProcessTwoPhaseBuffer() checks safe before reaching > consiste

Re: Pgoutput not capturing the generated columns

2025-01-16 Thread Peter Smith
Hi Vignesh. Some review comments for v52-0001. == Commit message 1. I guess the root cause is that in PG18 we decided to put the "Generated columns" column to the left of the "Via Root" column instead of to the right, and in doing so introduced a mistake ordering the code. The commit messag

Timeline issue if StartupXLOG() is interrupted right before end-of-recovery record is done

2025-01-16 Thread Roman Eskin
Hello pgsql-hackers, It appears to exist an issue with timeline switching in archive recovery mode if the startup process is interrupted by some external reason (for ex. system power loss) in a specific tight time window (after a new history file is created but before end-of-recovery record is do

Re: An improvement of ProcessTwoPhaseBuffer logic

2025-01-16 Thread Noah Misch
On Thu, Jan 16, 2025 at 12:52:54PM -0800, Noah Misch wrote: > On Thu, Jan 16, 2025 at 04:50:09PM +0900, Michael Paquier wrote: > > As far as I understand, the most important point of the logic is to > > detect and discard the future files first in restoreTwoPhaseData() -> > > ProcessTwoPhaseBuffer(

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

2025-01-16 Thread Peter Smith
Hi Shubham, Some review comments for patch v11-0001. == src/sgml/ref/pg_createsubscriber.sgml 1. -must accept local connections. +must accept local connections. If you are planning to use the +--enable-two-phase then you will also need to set the + appropriately. The m

Re: per backend I/O statistics

2025-01-16 Thread Michael Paquier
On Thu, Jan 16, 2025 at 11:28:43AM -0500, Andres Freund wrote: > On 2025-01-15 18:27:22 +0900, Michael Paquier wrote: >> My problem is that this is not only related to backend stats, but to >> all variable-numbered stats kinds that require this behavior. > > The issue here imo is that recently IO

Re: per backend WAL statistics

2025-01-16 Thread Michael Paquier
On Thu, Jan 16, 2025 at 12:44:20PM -0500, Andres Freund wrote: > On 2025-01-16 17:11:09 +, Bertrand Drouvot wrote: >> So, do you think that the initial proposal that has been made here (See R1. >> in >> [2]) i.e make use of a new PendingBackendWalStats variable: > > Well, I think this first n

Re: Make pg_stat_io view count IOs as bytes instead of blocks

2025-01-16 Thread Michael Paquier
On Thu, Jan 16, 2025 at 11:55:34AM +0300, Nazir Bilal Yavuz wrote: > I checked clang 4 as well on the link you sent and it also fixes the > warning there. Confirmed here, so done this way. -- Michael signature.asc Description: PGP signature

Re: Trigger more frequent autovacuums of heavy insert tables

2025-01-16 Thread Melanie Plageman
On Thu, Jan 16, 2025 at 4:43 PM Melanie Plageman wrote: > > On Fri, Oct 25, 2024 at 11:14 AM Melanie Plageman > wrote: > > > > I've done something similar to this in attached v2. > > This needed a rebase. See attached v4. Whoops -- docs didn't build. Attached v5. - Melanie v5-0002-Trigger-mor

Re: Document NULL

2025-01-16 Thread David G. Johnston
In reply to Marcos: > The word below is commonly used on DOCs, but I didn't find it as a link. Wouldn't it be better to write what you are linking to, instead of the word below ? I've changed many of these links into simple xref elements for now. I may add alternate text but since the majority o

Re: Purpose of wal_init_zero

2025-01-16 Thread Hannu Krosing
On Thu, Jan 16, 2025 at 10:21 AM Ritu Bhandari wrote: > Could we consider adding back fallocate? Or if not adding it back for all then maybe have a 3-value wal_init_zero : wal_init_zero = on; wal_init_zero = off; wal_init_zero = fallocate; ?

Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size

2025-01-16 Thread Peter Smith
Patch v11-0001 LGTM. == Kind Regards, Peter Smith. Fujitsu Australia

Re: Trigger more frequent autovacuums of heavy insert tables

2025-01-16 Thread Melanie Plageman
On Fri, Oct 25, 2024 at 11:14 AM Melanie Plageman wrote: > > I've done something similar to this in attached v2. This needed a rebase. See attached v4. - Melanie v4-0001-Add-relallfrozen-to-pg_class.patch Description: Binary data v4-0002-Trigger-more-frequent-autovacuums-with-relallfroz.patc

Re: Eager aggregation, take 3

2025-01-16 Thread Tom Lane
I'm very sorry for not having had any time to look at this patch before --- it's been on my radar screen for awhile, but $LIFE has been rather demanding lately. Anyway, I've now read through the mail thread and portions of the v16 patch, and I have to concur with Robert's qualms about whether this

Re: An improvement of ProcessTwoPhaseBuffer logic

2025-01-16 Thread Noah Misch
On Thu, Jan 16, 2025 at 04:50:09PM +0900, Michael Paquier wrote: > On Wed, Jan 15, 2025 at 05:00:51PM -0800, Noah Misch wrote: > > I think "using the current epoch" is wrong for half of the nextFullXid > > values > > having epoch > 0. For example, nextFullId==2^32 is in epoch 1, but all the > > a

Re: Document How Commit Handles Aborted Transactions

2025-01-16 Thread David G. Johnston
On Wed, Jan 1, 2025 at 11:16 PM Gurjeet Singh wrote: > > On Fri, Dec 20, 2024 at 9:02 AM David G. Johnston < > david.g.johns...@gmail.com> wrote: > > >> The commit reference page lacks an "Outputs" section even though it is > capable of outputting both "COMMIT" and "ROLLBACK". > > I generally agr

Re: Non-text mode for pg_dumpall

2025-01-16 Thread Mahendra Singh Thalor
Thanks Jian. On Thu, 16 Jan 2025 at 14:14, jian he wrote: > > hi. > > $BIN6/pg_dumpall --format=directory --verbose --file=test1 > pg_dumpall: executing SELECT pg_catalog.set_config('search_path', '', false); > pg_dumpall: error: could not create directory "test1": File exists > > we should first

Re: per backend WAL statistics

2025-01-16 Thread Andres Freund
Hi, On 2025-01-16 17:11:09 +, Bertrand Drouvot wrote: > On Thu, Jan 16, 2025 at 11:38:47AM -0500, Andres Freund wrote: > > Hi, > > > > On 2025-01-16 15:59:31 +, Bertrand Drouvot wrote: > > > On Wed, Jan 15, 2025 at 03:11:32PM +0900, Michael Paquier wrote: > > > > On Fri, Jan 10, 2025 at 0

Re: Allow ILIKE forward matching to use btree index

2025-01-16 Thread Jeff Davis
On Thu, 2025-01-16 at 14:53 +0900, Yugo NAGATA wrote: > Instead of generating complete patterns considering every case- > varying characters, > two clauses considering only the first case-varying character are > generated. Did you consider other approaches that integrate more deeply into the index

Re: per backend WAL statistics

2025-01-16 Thread Bertrand Drouvot
Hi, On Thu, Jan 16, 2025 at 11:38:47AM -0500, Andres Freund wrote: > Hi, > > On 2025-01-16 15:59:31 +, Bertrand Drouvot wrote: > > On Wed, Jan 15, 2025 at 03:11:32PM +0900, Michael Paquier wrote: > > > On Fri, Jan 10, 2025 at 09:40:38AM +, Bertrand Drouvot wrote: > > > + * WAL pending sta

Re: per backend WAL statistics

2025-01-16 Thread Andres Freund
Hi, On 2025-01-16 15:59:31 +, Bertrand Drouvot wrote: > On Wed, Jan 15, 2025 at 03:11:32PM +0900, Michael Paquier wrote: > > On Fri, Jan 10, 2025 at 09:40:38AM +, Bertrand Drouvot wrote: > > + * WAL pending statistics are incremented inside a critical section > > + * (see XLogWrite()), so

Re: per backend I/O statistics

2025-01-16 Thread Andres Freund
Hi, On 2025-01-15 18:27:22 +0900, Michael Paquier wrote: > On Wed, Jan 15, 2025 at 08:30:20AM +, Bertrand Drouvot wrote: > > On Wed, Jan 15, 2025 at 11:03:54AM +0300, Nazir Bilal Yavuz wrote: > >> With this commit it may not be possible to count IOs in the critical > >> sections. I think the p

Re: per backend I/O statistics

2025-01-16 Thread Bertrand Drouvot
Hi, On Thu, Jan 16, 2025 at 06:48:58AM +, Bertrand Drouvot wrote: > Hi, > > On Thu, Jan 16, 2025 at 09:55:10AM +0900, Michael Paquier wrote: > > On Wed, Jan 15, 2025 at 05:20:57PM +0300, Nazir Bilal Yavuz wrote: > > > I think allowing only pgStatPendingContext to have > > > MemoryContextAllow

Re: per backend WAL statistics

2025-01-16 Thread Bertrand Drouvot
Hi, On Wed, Jan 15, 2025 at 03:11:32PM +0900, Michael Paquier wrote: > On Fri, Jan 10, 2025 at 09:40:38AM +, Bertrand Drouvot wrote: > > Please find attached v4 taking into account 2c14037bb5. > > +} PgStat_WalCounters; > + > +typedef struct PgStat_WalStats > +{ > + PgStat_WalCounters wal

Re: Statistics Import and Export

2025-01-16 Thread Corey Huinker
> > pg_dump --dbname=src2 --table=tenk1 --statistics-only --verbose > x.sql > there no pg_restore_attribute_stats, pg_restore_relation_stats there > for table tenk1. > There aren't any statistics, should there be? > pg_restore_relation_stats: yes. looking into that. pg_restore_attribute_stats: yes

Re: Allow NOT VALID foreign key constraints on partitioned tables.

2025-01-16 Thread Álvaro Herrera
On 2025-Jan-15, Amul Sul wrote: > I made the minor changes to the attached version and rebased it > against the latest master(9a45a89c38f). Pushed 0001, thanks. -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/

Re: Increase NUM_XLOGINSERT_LOCKS

2025-01-16 Thread Andres Freund
Hi, On 2025-01-16 16:52:46 +0300, Yura Sokolov wrote: > Good day, hackers. > > Zhiguo Zhow proposed to transform xlog reservation to lock-free algorighm to > increment NUM_XLOGINSERT_LOCKS on very huge (480vCPU) servers. [1] > > While I believe lock-free reservation make sense on huge server, it

Re: Adding OLD/NEW support to RETURNING

2025-01-16 Thread Dean Rasheed
On Wed, 8 Jan 2025 at 09:38, Dean Rasheed wrote: > > OK, done. > > I also noticed that I had failed to use quote_identifier() in > ruleutils.c for the new WITH aliases, so I've fixed that and adjusted > a couple of the test cases to test that. > I went over this again in detail and didn't find an

Re: Statistics Import and Export

2025-01-16 Thread jian he
On Thu, Jan 16, 2025 at 4:56 AM Corey Huinker wrote: >> > Attached is just the pg_dump stuff, and only for relation/attribute stats. > The extended stats and vacuumdb work will be in their own threads going > forward. I didn't follow this thread actively, so if the following issue is already ad

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

2025-01-16 Thread Bernd Helmle
Am Mittwoch, dem 15.01.2025 um 19:24 +0100 schrieb Bernd Helmle: > > Commit 630f9a43cece93cb4a5c243b30e34abce6a89514 created a conflict > > with > > this patch so that it doesn't apply anymore. > > Seems i broke something during rebase (see cfbot). I will look at > this tomorrow. This was related

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-16 Thread Yura Sokolov
14.01.2025 17:49, Zhou, Zhiguo пишет: Good day, Yura! On 1/10/2025 8:42 PM, Yura Sokolov wrote: If you consider hash-table fillrate, than 256 is quite enough for 128 concurrent inserters. The profile of your patch didn't show significant hotspots in the hash table functions, so I believe the

Bug in detaching a partition with a foreign key.

2025-01-16 Thread Amul Sul
Hi, While detaching a partition with a foreign key referencing a partitioned table, I am getting the following error: ERROR: could not find ON INSERT check triggers of foreign key constraint 16636 I haven’t looked closely at what the issue might be, but it seems the logic inside DetachPartition

Increase NUM_XLOGINSERT_LOCKS

2025-01-16 Thread Yura Sokolov
Good day, hackers. Zhiguo Zhow proposed to transform xlog reservation to lock-free algorighm to increment NUM_XLOGINSERT_LOCKS on very huge (480vCPU) servers. [1] While I believe lock-free reservation make sense on huge server, it is hard to measure on small servers and personal computers/no

Re: refactor AlterDomainAddConstraint (alter domain add constraint)

2025-01-16 Thread Peter Eisentraut
I have committed the part of this patch that removes the switch statement in AlterDomainAddConstraint(). That one is dead code. I'll study the other discussion a bit more. I agree the current code isn't satisfactory.

Re: NOT ENFORCED constraint feature

2025-01-16 Thread Amul Sul
On Thu, Jan 16, 2025 at 6:07 PM Peter Eisentraut wrote: > > On 11.01.25 18:26, Amul Sul wrote: > > On Saturday, 11 January 2025, Peter Eisentraut > > wrote: > > > > I have applied v8-0001, with some editing of the documentation and > > in the tests. I'll cont

Re: Accept recovery conflict interrupt on blocked writing

2025-01-16 Thread Anthonin Bonnefoy
Bonjour Thomas, On Wed, Jan 15, 2025 at 6:21 AM Thomas Munro wrote: > Right. Before commit 0da096d7 in v17, the recovery conflict code > running in a signal handler would have set ProcDiePending, so this > looks like an unintended regression due to that commit. The issue is happening on instanc

Re: SCRAM pass-through authentication for postgres_fdw

2025-01-16 Thread Matheus Alcantara
Em qua., 15 de jan. de 2025 às 14:03, Peter Eisentraut escreveu: > > On 14.01.25 15:14, Matheus Alcantara wrote: > >> Attached is a fixup patch where I have tried to expand the documentation > >> a bit in an attempt to clarify how to use this. Maybe check that what I > >> wrote is correct. > > >

Re: Psql meta-command conninfo+

2025-01-16 Thread Alvaro Herrera
On 2025-Jan-16, Hunaid Sohail wrote: > server_encoding | UTF8 > server_version| 18devel > client_encoding | UTF8 > session_authorization | hunaid > standard_conforming_strings | on > DateStyle | ISO, MDY > scram_itera

Re: NOT ENFORCED constraint feature

2025-01-16 Thread Peter Eisentraut
On 11.01.25 18:26, Amul Sul wrote: On Saturday, 11 January 2025, Peter Eisentraut > wrote: I have applied v8-0001, with some editing of the documentation and in the tests.  I'll continue reviewing the subsequent patches. Thank you for the improvement and co

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

2025-01-16 Thread Shubham Khanna
On Thu, Jan 16, 2025 at 3:15 PM Shlok Kyal wrote: > > On Wed, 15 Jan 2025 at 12:03, Shubham Khanna > wrote: > > > > On Tue, Jan 14, 2025 at 4:53 PM Shlok Kyal wrote: > > > > > > On Fri, 27 Dec 2024 at 12:06, Shubham Khanna > > > wrote: > > > > > > > > On Fri, Dec 27, 2024 at 11:30 AM vignesh C

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

2025-01-16 Thread Shubham Khanna
On Thu, Jan 16, 2025 at 4:53 AM Peter Smith wrote: > > On Wed, Jan 15, 2025 at 9:24 PM Ajin Cherian wrote: > > > > > > > > On Wed, Jan 15, 2025 at 5:33 PM Shubham Khanna > > wrote: > > > Previously, the warning was necessary because the 'two-phase' option > > > was not available, and users need

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

2025-01-16 Thread Shubham Khanna
On Wed, Jan 15, 2025 at 3:54 PM Ajin Cherian wrote: > > > > On Wed, Jan 15, 2025 at 5:33 PM Shubham Khanna > wrote: > > Previously, the warning was necessary because the 'two-phase' option > > was not available, and users needed to be informed about the default > > behavior regarding 'two-phase'

Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size

2025-01-16 Thread Shlok Kyal
On Thu, 16 Jan 2025 at 12:34, Shubham Khanna wrote: > > On Thu, Jan 16, 2025 at 12:12 PM Shlok Kyal wrote: > > > > On Thu, 16 Jan 2025 at 10:48, Shubham Khanna > > wrote: > > > > > > On Wed, Jan 15, 2025 at 3:28 AM Peter Smith wrote: > > > > > > > > Hi Shubham. > > > > > > > > Patch v9-0001 LGT

Re: Conflict detection for update_deleted in logical replication

2025-01-16 Thread Amit Kapila
On Wed, Jan 15, 2025 at 9:38 AM Amit Kapila wrote: > > On Wed, Jan 15, 2025 at 5:57 AM Masahiko Sawada wrote: > > > > Probably retaining dead tuples based on the time duration or its age > > might be other solutions, it would increase a risk of not being able > > to detect update_deleted conflict

Re: Change GUC hashtable to use simplehash?

2025-01-16 Thread Anton A. Melnikov
Hi! On 16.01.2025 04:36, Tom Lane wrote: "Anton A. Melnikov" writes: Seems it is possible to exclude much less code from checking under valgrind and get the same result by replacing the only function call pg_rightmost_one_pos64() with a valgrind-safe code. See the attached patch, please. The

Re: Psql meta-command conninfo+

2025-01-16 Thread Hunaid Sohail
Hi, I have attached 3 new patches v37-000* which display the \conninfo+ output as 2 columns "Parameter" and "Value". The other 2 patches are: 1. A new libpq function, PQparameterNames, which returns names of parameters reported by the server. 2. Mark role as GUC_REPORT. All these patches include

Re: Conflict detection for update_deleted in logical replication

2025-01-16 Thread Dilip Kumar
On Thu, Jan 16, 2025 at 4:02 PM Amit Kapila wrote: > On Thu, Jan 16, 2025 at 3:45 PM Dilip Kumar wrote: > > > > On Fri, Jan 3, 2025 at 4:31 PM Amit Kapila > wrote: > >> > >> On Thu, Jan 2, 2025 at 2:57 PM vignesh C wrote: > >> > > >> > Conflict detection of truncated updates is detected as upd

Re: Conflict detection for update_deleted in logical replication

2025-01-16 Thread Amit Kapila
On Thu, Jan 16, 2025 at 3:45 PM Dilip Kumar wrote: > > On Fri, Jan 3, 2025 at 4:31 PM Amit Kapila wrote: >> >> On Thu, Jan 2, 2025 at 2:57 PM vignesh C wrote: >> > >> > Conflict detection of truncated updates is detected as update_missing >> > and deleted update is detected as update_deleted. I

Re: Fix misuse use of pg_b64_encode function (contrib/postgres_fdw/connection.c)

2025-01-16 Thread Ranier Vilela
Em qui., 16 de jan. de 2025 às 05:07, Peter Eisentraut escreveu: > On 16.01.25 02:12, Ranier Vilela wrote: > > Per Coverity. > > > > CID 1590024:(CHECKED_RETURN) > > Calling "pg_b64_encode" without checking return value (as is done > > elsewhere 8 out of 10 times). > > > > The function *pg_b6

Re: Conflict detection for update_deleted in logical replication

2025-01-16 Thread Dilip Kumar
On Fri, Jan 3, 2025 at 4:31 PM Amit Kapila wrote: > On Thu, Jan 2, 2025 at 2:57 PM vignesh C wrote: > > > > Conflict detection of truncated updates is detected as update_missing > > and deleted update is detected as update_deleted. I was not sure if > > truncated updates should also be detected

Re: Conflict detection for update_deleted in logical replication

2025-01-16 Thread Amit Kapila
On Wed, Jan 15, 2025 at 2:20 PM Zhijie Hou (Fujitsu) wrote: > > In the latest version, we implemented a simpler approach that allows the apply > worker to directly advance the oldest_nonremovable_xid if the waiting time > exceeds the newly introduced option's limit. I've named this option > "max_c

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

2025-01-16 Thread Shlok Kyal
On Wed, 15 Jan 2025 at 12:03, Shubham Khanna wrote: > > On Tue, Jan 14, 2025 at 4:53 PM Shlok Kyal wrote: > > > > On Fri, 27 Dec 2024 at 12:06, Shubham Khanna > > wrote: > > > > > > On Fri, Dec 27, 2024 at 11:30 AM vignesh C wrote: > > > > > > > > > > > > The documentation requires a minor upda

Re: Fix misuse use of pg_b64_encode function (contrib/postgres_fdw/connection.c)

2025-01-16 Thread Michael Paquier
On Thu, Jan 16, 2025 at 09:07:45AM +0100, Peter Eisentraut wrote: > Maybe we could put a pg_nodiscard attribute on pg_b64_encode() and > pg_b64_decode()? Sounds like a good idea to me. +1. -- Michael signature.asc Description: PGP signature

Re: Purpose of wal_init_zero

2025-01-16 Thread Ritu Bhandari
Hi, Adding to Andy Fan's point above: If we increase WAL segment size from 16MB to 64MB, initializing the 64MB WAL segment inline can cause several seconds of freeze on all write transactions when it happens. Writing out a newly zero-filled 64MB WAL segment takes several seconds for smaller disk

Re: Make pg_stat_io view count IOs as bytes instead of blocks

2025-01-16 Thread Nazir Bilal Yavuz
Hi, On Thu, 16 Jan 2025 at 10:12, Bertrand Drouvot wrote: > > Hi, > > On Thu, Jan 16, 2025 at 12:47:17AM -0500, Tom Lane wrote: > > Michael Paquier writes: > > > Not completely sure about the number of parenthesis, but I hope that > > > this should be enough (extra set around io_op): > > > +#def

Re: SQL/JSON json_table plan clause

2025-01-16 Thread Vladlen Popolitov
The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, failed Spec compliant: not tested Documentation:not tested Hi! Proposed patch tested at Macosx, compiled and build without warni

Re: Windows meson build

2025-01-16 Thread Vladlen Popolitov
Kohei Harikae (Fujitsu) писал(а) 2025-01-10 16:43: Hi, Thank you for your advice. Based on your advice, I have added a description of the vcpkg and -Dextra_include_dirs options. How do you think about this? Regards, Kohei Harikae Hi, Looks good! If you create commitfest entry, I would make

Re: Virtual generated columns

2025-01-16 Thread vignesh C
On Thu, 16 Jan 2025 at 01:16, Peter Eisentraut wrote: > > On 15.01.25 08:11, vignesh C wrote: > > On Tue, 14 Jan 2025 at 19:08, Peter Eisentraut wrote: > >> > >> > >> I've also added a patch that addresses logical replication. It > >> basically adds back some of the prohibitions against includin

Re: Pgoutput not capturing the generated columns

2025-01-16 Thread vignesh C
On Wed, 15 Jan 2025 at 14:41, Shlok Kyal wrote: > > I have reviewed the patch and have following comments: > > In file: create_publication.sgml > > 1. > + > + If set to stored, the generated columns present > in > + the tables associated with publication will be replica

Re: Non-text mode for pg_dumpall

2025-01-16 Thread jian he
hi. $BIN6/pg_dumpall --format=directory --verbose --file=test1 pg_dumpall: executing SELECT pg_catalog.set_config('search_path', '', false); pg_dumpall: error: could not create directory "test1": File exists we should first validate --file option, if not ok error out immediately. if ok then conne

Re: Show WAL write and fsync stats in pg_stat_io

2025-01-16 Thread Nazir Bilal Yavuz
Hi, On Fri, 19 Apr 2024 at 11:01, Nazir Bilal Yavuz wrote: > > If I am not missing any new changes, the only problem is reading > variable bytes now. We have discussed a couple of solutions: With the recent commit [1], pg_stat_io tracks IOs as bytes instead of blocks. This solves the variable IO

Re: [PATCH] Improve code coverage of network address functions

2025-01-16 Thread Keisuke Kuroda
I could not send it to the mailing list, so I'm resending it. ___ Hi Aleksander, I have tested your patch. I have confirmed that the coverage improves to the expected value(69.8%->80.1%) Your patch looks good to me. ## test and make coverage source: commit 9a45a89c38f3257b13e09edf382e32fa28b918c

Re: Eager aggregation, take 3

2025-01-16 Thread Richard Guo
On Wed, Jan 15, 2025 at 11:40 PM Robert Haas wrote: > On Wed, Jan 15, 2025 at 1:58 AM Richard Guo wrote: > > I understand that we're currently quite bad at estimating the number > > of groups after aggregation. In fact, it's not just aggregation > > estimates — we're also bad at join estimates i

Re: Fix misuse use of pg_b64_encode function (contrib/postgres_fdw/connection.c)

2025-01-16 Thread Peter Eisentraut
On 16.01.25 02:12, Ranier Vilela wrote: Per Coverity. CID 1590024:    (CHECKED_RETURN) Calling "pg_b64_encode" without checking return value (as is done elsewhere 8 out of 10 times). The function *pg_b64_encode* has in the comments: [0]  "and -1 in the event of an error" So, the function can