Re: [PATCH] Small refactoring of inval.c and inval.h

2023-11-05 Thread Michael Paquier
On Tue, Jul 25, 2023 at 06:38:46PM +0300, Aleksander Alekseev wrote: > Unless of course we want to change its signature too. I don't think > this is going to be a good API change. extern void InvalidateSystemCaches(void); -extern void InvalidateSystemCachesExtended(bool debug_discard); Indeed,

Re: Compiling warnings on old GCC

2023-11-05 Thread Richard Guo
On Mon, Nov 6, 2023 at 2:51 PM David Rowley wrote: > On Mon, 6 Nov 2023 at 19:14, Richard Guo wrote: > > I came across the following compiling warnings on GCC (Red Hat 4.8.5-44) > > 4.8.5 with 'CFLAGS=-Og' > > > I wonder if this is worth fixing, maybe by a trivial patch like > > attached. > >

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-05 Thread Andrey M. Borodin
> On 6 Nov 2023, at 09:09, Dilip Kumar wrote: > > >> Having hashtable to find SLRU page in the buffer IMV is too slow. Some >> comments on this approach can be found here [0]. >> I'm OK with having HTAB for that if we are sure performance does not degrade >> significantly, but I really

Re: Requiring recovery.signal or standby.signal when recovering with a backup_label

2023-11-05 Thread Michael Paquier
On Thu, Nov 02, 2023 at 11:03:35AM +0900, Kyotaro Horiguchi wrote: > At Wed, 1 Nov 2023 08:39:17 +0900, Michael Paquier > wrote in >> See in StartupXLOG(), around the comment "complain if we did not roll >> forward far enough to reach". This complains if archive recovery has >> been requested

Re: Compiling warnings on old GCC

2023-11-05 Thread David Rowley
On Mon, 6 Nov 2023 at 19:14, Richard Guo wrote: > I came across the following compiling warnings on GCC (Red Hat 4.8.5-44) > 4.8.5 with 'CFLAGS=-Og' > I wonder if this is worth fixing, maybe by a trivial patch like > attached. There's some relevant discussion in

RE: Is this a problem in GenericXLogFinish()?

2023-11-05 Thread Hayato Kuroda (Fujitsu)
Dear hackers, > Dear Amit, Michael, > > Thanks for making the patch! > > > Why register wbuf at all if there are no tuples to add and it is not > > the same as bucketbuf? Also, I think this won't be correct if prevbuf > > and wrtbuf are the same and also we have no tuples to add to wbuf. I > >

Re: Add recovery to pg_control and remove backup_label

2023-11-05 Thread Michael Paquier
On Sun, Nov 05, 2023 at 01:45:39PM -0400, David Steele wrote: > Rebased on 151ffcf6. I like this patch a lot. Even if the backup_label file is removed, we still have all the debug information from the backup history file, thanks to its LABEL, BACKUP METHOD and BACKUP FROM, so no information is

Re: RFC: Logging plan of the running query

2023-11-05 Thread Ashutosh Bapat
On Fri, Nov 3, 2023 at 7:31 PM Ashutosh Bapat wrote: > > I have following questions related to the functionality. (Please point > me to the relevant discussion if this has been already discussed.) > > 1. When a backend is running nested queries, we will see the plan of > the innermost query. That

Re: POC: Extension for adding distributed tracing - pg_tracing

2023-11-05 Thread Shlok Kyal
Hi, On Thu, 12 Oct 2023 at 14:32, Anthonin Bonnefoy wrote: > > Hi! > > I've made a new batch of changes and improvements. > New features: > - Triggers are now correctly supported. They were not correctly > attached to the ExecutorFinish Span before. > - Additional configuration: exporting

Re: Add new option 'all' to pg_stat_reset_shared()

2023-11-05 Thread Bharath Rupireddy
On Sat, Nov 4, 2023 at 7:19 AM Andres Freund wrote: > > On 2023-11-03 00:55:00 +0530, Bharath Rupireddy wrote: > > On Wed, Nov 1, 2023 at 4:24 AM Michael Paquier wrote: > > > > > > On Tue, Oct 31, 2023 at 04:26:18PM +0900, torikoshia wrote: > > > > Yes, calling pg_stat_reset_shared() for all

Compiling warnings on old GCC

2023-11-05 Thread Richard Guo
I came across the following compiling warnings on GCC (Red Hat 4.8.5-44) 4.8.5 with 'CFLAGS=-Og' be-fsstubs.c: In function ‘be_lo_export’: be-fsstubs.c:537:24: warning: ‘fd’ may be used uninitialized in this function [-Wmaybe-uninitialized] if (CloseTransientFile(fd) != 0)

Re: Add new option 'all' to pg_stat_reset_shared()

2023-11-05 Thread torikoshia
Thanks all for the comments! On Fri, Nov 3, 2023 at 5:17 AM Matthias van de Meent wrote: Knowing that your metrics have a shared starting point can be quite valuable, as it allows you to do some math that would otherwise be much less accurate when working with stats over a short amount of

Re: Add recovery to pg_control and remove backup_label

2023-11-05 Thread Michael Paquier
On Fri, Oct 27, 2023 at 10:10:42AM -0400, David Steele wrote: > We are still planning to address this issue in the back branches. FWIW, redesigning the backend code in charge of doing base backups in the back branches is out of scope. Based on a read of the proposed patch, it includes catalog

Re: Extract numeric filed in JSONB more effectively

2023-11-05 Thread zhihuifan1213
Chapman Flack writes: (This is Andy Fan and I just switch to my new email address). Hi Chap, Thanks for alway keep an eye on this! > Adding this comment via the CF app so it isn't lost, while an > improperly-interpreted-DKIM-headers issue is still preventing me from > mailing directly to

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-11-05 Thread Dilip Kumar
On Sun, Nov 5, 2023 at 1:37 AM Andrey M. Borodin wrote: > On 30 Oct 2023, at 09:20, Dilip Kumar wrote: > > changed the logic of SlruAdjustNSlots() in 0002, such that now it > starts with the next power of 2 value of the configured slots and > keeps doubling the number of banks until we reach

Re: Synchronizing slots from primary to standby

2023-11-05 Thread shveta malik
On Mon, Nov 6, 2023 at 7:01 AM Zhijie Hou (Fujitsu) wrote: > > On Friday, November 3, 2023 7:32 PM Amit Kapila > > > > On Thu, Nov 2, 2023 at 2:35 PM Zhijie Hou (Fujitsu) > > wrote: > > > > > > Here is the new version patch set(V29) which addressed Peter > > > comments[1][2] and fixed one doc

Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?)

2023-11-05 Thread Amit Kapila
On Sun, Nov 5, 2023 at 4:01 AM Bharath Rupireddy wrote: > > On Thu, Nov 2, 2023 at 7:19 AM Peter Smith wrote: > > > > But that's not quite compatible with what Alvaro [2] had written long > > back ("... the only acquisitions that would log messages are those in > > StartReplication and

RE: Is this a problem in GenericXLogFinish()?

2023-11-05 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Michael, Thanks for making the patch! > Why register wbuf at all if there are no tuples to add and it is not > the same as bucketbuf? Also, I think this won't be correct if prevbuf > and wrtbuf are the same and also we have no tuples to add to wbuf. I > have attached a naive and crude

Re: Support run-time partition pruning for hash join

2023-11-05 Thread Richard Guo
On Sat, Nov 4, 2023 at 6:00 PM Alexander Lakhin wrote: > 02.11.2023 14:19, Richard Guo wrote: > > However, the cfbot indicates that there are test cases that fail on > FreeBSD [1] (no failure on other platforms). So I set up a FreeBSD-13 > locally but just cannot reproduce the failure. I must

Re: pg_upgrade and logical replication

2023-11-05 Thread Peter Smith
Here are some review comments for patch v11-0001 == Commit message 1. The subscription's replication origin are needed to ensure that we don't replicate anything twice. ~ /are needed/is needed/ ~~~ 2. Author: Julien Rouhaud Reviewed-by: FIXME Discussion:

minor doc issues.

2023-11-05 Thread jian he
hi https://www.postgresql.org/docs/current/datatype-json.html Table 8.23. JSON Primitive Types and Corresponding PostgreSQL Types "SQL NULL is a different concept" can we change to "Only accept lowercase null. SQL NULL is a different concept" I saw people ask similar questions on stackoverflow.

Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value

2023-11-05 Thread jian he
minor doc issues. Returns the chunk id of the TOASTed value, or NULL if the value is not TOASTed. Should it be "chunk_id"? you may place it after pg_create_logical_replication_slot entry to make it look like alphabetical order. There is no test. maybe we can add following to

Re: Something seems weird inside tts_virtual_copyslot()

2023-11-05 Thread David Rowley
On Sat, 4 Nov 2023 at 15:15, Andres Freund wrote: > > On 2023-11-01 11:35:50 +1300, David Rowley wrote: > > I changed the Assert in tts_virtual_copyslot() to check the natts > > match in each of the slots and all of the regression tests still pass, > > so it seems we have no tests where there's

Re: Add recovery to pg_control and remove backup_label

2023-11-05 Thread David Steele
Rebased on 151ffcf6.diff --git a/doc/src/sgml/backup.sgml b/doc/src/sgml/backup.sgml index 8cb24d6ae54..6be8fb902c5 100644 --- a/doc/src/sgml/backup.sgml +++ b/doc/src/sgml/backup.sgml @@ -935,19 +935,20 @@ SELECT * FROM pg_backup_stop(wait_for_archive => true); ready to archive.

Re: Add recovery to pg_control and remove backup_label

2023-11-05 Thread David Steele
On 10/27/23 13:45, David G. Johnston wrote: Let me modify that to make it a bit more clear, I actually wouldn't care if pg_backup_end outputs an entire binary pg_control file as part of the SQL resultset. My proposal would be to, in addition, place in the temporary directory on the server,

Re: MERGE ... RETURNING

2023-11-05 Thread Dean Rasheed
On Wed, 1 Nov 2023 at 17:49, Jeff Davis wrote: > > Most of my concern is that parts of the implementation feel like a > hack, which makes me concerned that we're approaching it the wrong way. > OK, that's a fair point. Attached is a new version, replacing those parts of the implementation with a