Re: ALTER COLUMN ... SET EXPRESSION to alter stored generated column's expression

2023-11-13 Thread Peter Eisentraut
On 09.11.23 13:00, Amul Sul wrote: On Tue, Nov 7, 2023 at 8:21 PM Peter Eisentraut > wrote: On 25.10.23 08:12, Amul Sul wrote: > Here is the rebase version for the latest master head(673a17e3120). > > I haven't done any other changes related to the

Re: Add PQsendSyncMessage() to libpq

2023-11-13 Thread Anthonin Bonnefoy
Hi, I've played a bit with the patch on my side. One thing that would be great would be to make this available in pgbench through a \syncpipeline meta command. That would make it easier for users to test whether there's a positive impact with their queries or not. I've wrote a patch to add it to

Re: pg_upgrade and logical replication

2023-11-13 Thread Peter Smith
Here are some review comments for patch v13-0001 == src/bin/pg_dump/pg_dump.c 1. getSubscriptionTables + int i_srsublsn; + int i; + int cur_rel = 0; + int ntups; What is the difference between 'i' and 'cur_rel'? AFAICT these represent the same tuple index, in which case you might as well t

Re: pg_upgrade and logical replication

2023-11-13 Thread Michael Paquier
On Fri, Nov 10, 2023 at 07:26:18PM +0530, vignesh C wrote: > I did testing in the same lines that you mentioned. Apart from that I > also reviewed the design where it was using the old subscription id > like in case of table sync workers, the tables sync worker will use > replication using old subs

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

2023-11-13 Thread Bharath Rupireddy
On Mon, Nov 13, 2023 at 9:45 AM torikoshia wrote: > > On 2023-11-12 16:46, Michael Paquier wrote: > > On Fri, Nov 10, 2023 at 01:15:50PM +0900, Michael Paquier wrote: > >> The comments added could be better grammatically, but basically LGTM. > >> I'll take care of that if there are no objections.

Re: Synchronizing slots from primary to standby

2023-11-13 Thread Ajin Cherian
On Mon, Nov 13, 2023 at 5:38 PM shveta malik wrote: > Okay. Thanks for testing Ajin. I think it needs a fix wherein we set > the local-slot's invalidation status (provided it is not invalidated > already) from the remote slot before this check itself. And if the > slot is invalidated locally (eith

Re:Re: How to solve the problem of one backend process crashing and causing other processes to restart?

2023-11-13 Thread yuansong
Enhancing the overall fault tolerance of the entire system for this feature is quite important. No one can avoid bugs, and I don't believe that this approach is a more advanced one. It might be worth considering adding it to the roadmap so that interested parties can conduct relevant research.

should check collations when creating partitioned index

2023-11-13 Thread Peter Eisentraut
When creating a partitioned index, the partition key must be a subset of the index's columns. DefineIndex() explains: * If this table is partitioned and we're creating a unique index, primary * key, or exclusion constraint, make sure that the partition key is a * subset of the

Re: Synchronizing slots from primary to standby

2023-11-13 Thread Drouvot, Bertrand
Hi, On 11/13/23 5:24 AM, shveta malik wrote: On Thu, Nov 9, 2023 at 8:56 AM Amit Kapila wrote: Apart from the above, I would like to discuss the slot sync work distribution strategy of this patch. The current implementation as explained in the commit message [1] works well if the slots belong

Re: serial and partitioned table

2023-11-13 Thread Peter Eisentraut
On 17.10.23 09:25, Ashutosh Bapat wrote: #create table tpart (a serial primary key, src varchar) partition by range(a); CREATE TABLE #create table t_p4 (a int primary key, src varchar); CREATE TABLE To appease the gods of surprises I need to add a NOT NULL constraint. See [1]. #alter table t_p4 a

Re: Incorrect file reference in comment in procarray.c

2023-11-13 Thread Etsuro Fujita
On Fri, Nov 3, 2023 at 6:53 PM Etsuro Fujita wrote: > On Thu, Nov 2, 2023 at 10:20 PM Daniel Gustafsson wrote: > > > On 2 Nov 2023, at 13:40, Etsuro Fujita wrote: > > > Attached is a small patch for that: s/heapam_visibility.c/snapmgr.c/. > > > > No objections to the patch, the change is correct

Re: partitioning and identity column

2023-11-13 Thread Peter Eisentraut
On 27.10.23 13:32, Ashutosh Bapat wrote: I think we should fix these anomalies as follows 1. Allow identity columns to be added to the partitioned table irrespective of whether they have partitions of not. 2. Propagate identity property to partitions. 3. Use the same underlying sequence for getti

Re: Fix output of zero privileges in psql

2023-11-13 Thread Erik Wienhold
On 2023-11-09 20:19 +0100, Tom Lane wrote: > Laurenz Albe writes: > > Thanks for the feedback. I'll set the patch to "ready for committer" then. > > So, just to clarify, we're settling on your v4 from [1]? > > [1] > https://www.postgresql.org/message-id/d799f996f422231a99655f1223667d6d887e4c95

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

2023-11-13 Thread Michael Paquier
On Mon, Nov 13, 2023 at 02:07:21PM +0530, Bharath Rupireddy wrote: > Modified the docs for pg_stat_reset_slru to match with that of > pg_stat_reset_shared. PSA v2 patch. That feels consistent. Thanks. > I noticed that the commit 23c8c0c8 missed to add proargnames => > '{target}' in .dat file for

Re: pg_upgrade and logical replication

2023-11-13 Thread Amit Kapila
On Mon, Nov 13, 2023 at 1:52 PM Michael Paquier wrote: > > It seems to me that INIT cannot be relied on for a similar reason. > This state would be set for a new relation in > LogicalRepSyncTableStart(), and the relation would still be in INIT > state when creating the slot via walrcv_create_slot(

Re: Re: How to solve the problem of one backend process crashing and causing other processes to restart?

2023-11-13 Thread Junwang Zhao
On Mon, Nov 13, 2023 at 5:14 PM yuansong wrote: > > Enhancing the overall fault tolerance of the entire system for this feature > is quite important. No one can avoid bugs, and I don't believe that this > approach is a more advanced one. It might be worth considering adding it to > the roadmap

Re: pgsql: doc: fix wording describing the checkpoint_flush_after GUC

2023-11-13 Thread Alvaro Herrera
On 2023-Nov-09, Bruce Momjian wrote: > doc: fix wording describing the checkpoint_flush_after GUC Hmm. Is this new wording really more clear than the original wording? I agree the original may not have been the most simple, but I don't think it was wrong English. I'm not suggesting to revert th

Re: pg_upgrade and logical replication

2023-11-13 Thread Amit Kapila
On Fri, Nov 10, 2023 at 7:26 PM vignesh C wrote: > > Thanks for the comments, the attached v13 version patch has the > changes for the same. > + + ReplicationOriginNameForLogicalRep(subid, InvalidOid, originname, sizeof(originname)); + originid = replorigin_by_name(originname, false); + replorigi

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

2023-11-13 Thread Bharath Rupireddy
On Mon, Nov 6, 2023 at 9:09 AM Amit Kapila wrote: > > 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

Re: pg_upgrade and logical replication

2023-11-13 Thread Amit Kapila
On Mon, Nov 13, 2023 at 5:01 PM Amit Kapila wrote: > > On Fri, Nov 10, 2023 at 7:26 PM vignesh C wrote: > > > > Thanks for the comments, the attached v13 version patch has the > > changes for the same. > > > > + > + ReplicationOriginNameForLogicalRep(subid, InvalidOid, originname, > sizeof(origin

Re: Why do indexes and sorts use the database collation?

2023-11-13 Thread Peter Eisentraut
On 11.11.23 01:03, Jeff Davis wrote: But the database collation is always deterministic, So far!

Re: ALTER COLUMN ... SET EXPRESSION to alter stored generated column's expression

2023-11-13 Thread Amul Sul
On Mon, Nov 13, 2023 at 1:40 PM Peter Eisentraut wrote: > On 09.11.23 13:00, Amul Sul wrote: > > On Tue, Nov 7, 2023 at 8:21 PM Peter Eisentraut > > wrote: > > > > On 25.10.23 08:12, Amul Sul wrote: > > > Here is the rebase version for the latest master > he

Re: proposal: possibility to read dumped table's name from file

2023-11-13 Thread Pavel Stehule
Hi ne 12. 11. 2023 v 14:17 odesílatel Pavel Stehule napsal: > Hi > > >> What are your thoughts on this version? It's not in a committable state >> as it >> needs a bit more comments here and there and a triplecheck that nothing >> was >> missed in changing this, but I prefer to get your thought

Re: pg_basebackup check vs Windows file path limits

2023-11-13 Thread Andrew Dunstan
On 2023-11-11 Sa 11:31, Alvaro Herrera wrote: On 2023-Jul-08, Andrew Dunstan wrote: # Running: pg_basebackup -D C:\\tools\\nmsys64\\home\\pgrunner\\bf\\root\\REL_16_STABLE\\pgsql.build/testrun/pg_basebackup/010_pg_basebackup/data/t_010_pg_basebackup_main_data/backup/tarbackup2 -h C:/tools/nm

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2023-11-13 Thread Bharath Rupireddy
On Fri, Nov 10, 2023 at 2:28 AM Andres Freund wrote: > > On 2023-11-08 13:10:34 +0530, Bharath Rupireddy wrote: > > > > + /* > > > > + * The fact that we acquire WALBufMappingLock while > > > > reading the WAL > > > > + * buffer page itself guarantees that no

Re: proposal: possibility to read dumped table's name from file

2023-11-13 Thread Daniel Gustafsson
> On 13 Nov 2023, at 14:15, Pavel Stehule wrote: > > Hi > > ne 12. 11. 2023 v 14:17 odesílatel Pavel Stehule > napsal: > Hi > > > What are your thoughts on this version? It's not in a committable state as it > needs a bit more comments here and there and a tri

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

2023-11-13 Thread Bharath Rupireddy
On Mon, Nov 13, 2023 at 5:43 PM Bharath Rupireddy wrote: > > On Mon, Nov 6, 2023 at 9:09 AM Amit Kapila wrote: > > > > 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 w

Re: pg_upgrade failing for 200+ million Large Objects

2023-11-13 Thread Kumar, Sachin
> On 09/11/2023, 18:41, "Tom Lane" > wrote: > Um ... you didn't attach the patch? Sorry , patch attached Regards Sachin pg_upgrade_improvements_v6.diff Description: pg_upgrade_improvements_v6.diff

Re: ALTER COLUMN ... SET EXPRESSION to alter stored generated column's expression

2023-11-13 Thread Peter Eisentraut
On 13.11.23 14:07, Amul Sul wrote: Also, it seems to me that the SET EXPRESSION variant should just do an update of the catalog table instead of a drop and re-insert. I am not sure if that is sufficient; we need to get rid of the dependencies of existing expressions on other columns and

Re: proposal: possibility to read dumped table's name from file

2023-11-13 Thread Pavel Stehule
po 13. 11. 2023 v 14:39 odesílatel Daniel Gustafsson napsal: > > On 13 Nov 2023, at 14:15, Pavel Stehule wrote: > > > > Hi > > > > ne 12. 11. 2023 v 14:17 odesílatel Pavel Stehule < > pavel.steh...@gmail.com > napsal: > > Hi > > > > > > What are your thoughts on t

Re: trying again to get incremental backup

2023-11-13 Thread Alvaro Herrera
Great stuff you got here. I'm doing a first pass trying to grok the whole thing for more substantive comments, but in the meantime here are some cosmetic ones. I got the following warnings, both valid: ../../../../pgsql/source/master/src/common/blkreftable.c: In function 'WriteBlockRefTable': .

Re: Why do indexes and sorts use the database collation?

2023-11-13 Thread Jeff Davis
On Mon, 2023-11-13 at 13:43 +0100, Peter Eisentraut wrote: > On 11.11.23 01:03, Jeff Davis wrote: > > But the database collation is always deterministic, > > So far! Yeah, if we did that, clearly the index collation would need to match that of the database to be useful. What are the main challeng

Re: How to solve the problem of one backend process crashing and causing other processes to restart?

2023-11-13 Thread Joe Conway
On 11/13/23 00:53, Laurenz Albe wrote: On Sun, 2023-11-12 at 21:55 -0500, Tom Lane wrote: yuansong writes: > In PostgreSQL, when a backend process crashes, it can cause other backend > processes to also require a restart, primarily to ensure data consistency. > I understand that the correct app

Re: pg_walfile_name_offset can return inconsistent values

2023-11-13 Thread Bruce Momjian
On Fri, Nov 10, 2023 at 07:59:43PM -0800, Andres Freund wrote: > Hi, > > On 2023-11-09 16:14:07 -0500, Bruce Momjian wrote: > > On Thu, Nov 9, 2023 at 09:49:48PM +0100, Matthias van de Meent wrote: > > > Either way, I think fix #1 is most correct (as was attached in > > > offset2.diff, and quoted

Re: Is this a problem in GenericXLogFinish()?

2023-11-13 Thread Robert Haas
On Mon, Nov 13, 2023 at 12:47 AM Hayato Kuroda (Fujitsu) wrote: > Moved. I see that this patch was committed, but I'm not very convinced that the approach is correct. The comment says this: + /* +* A write buffer needs to be registered even if no tuples are +* a

Re: Official Windows Installer and Documentation

2023-11-13 Thread Bruce Momjian
On Tue, Oct 31, 2023 at 11:24:24AM -0400, Bruce Momjian wrote: > On Tue, Oct 31, 2023 at 11:16:29AM -0400, Bruce Momjian wrote: > > On Wed, Jul 27, 2022 at 09:28:51PM -0700, David G. Johnston wrote: > > > On Wed, Jul 27, 2022 at 8:22 PM Tom Lane wrote: > > > > > > I wrote: > > > > If EDB

Re: pg_walfile_name_offset can return inconsistent values

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 12:14:57 -0500, Bruce Momjian wrote: > +SELECT * > +FROM (values ('0/16ff'), ('0/1700'), ('0/1701')) as t(lsn), > + LATERAL pg_walfile_name_offset(lsn::pg_lsn), > + LATERAL pg_walfile_name(lsn::pg_lsn); > +lsn |file_name | file_offset |

Re: COPY TO (FREEZE)?

2023-11-13 Thread Bruce Momjian
On Mon, Oct 30, 2023 at 03:55:21PM -0400, Bruce Momjian wrote: > On Mon, Oct 30, 2023 at 02:29:05PM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > That is a good point. I reviewed more of the messages and added > > > capitalization where appropriate, patch attached. > > > > This is start

[PATCH] pgbench log file headers

2023-11-13 Thread Adam Hendel
Hello Hackers! Currently, pgbench will log individual transactions to a logfile when the `--log` parameter flag is provided. The logfile, however, does not include column header. It has become a fairly standard expectation of users to have column headers present in flat files. Without the header i

Re: Bug: RLS policy FOR SELECT is used to check new rows

2023-11-13 Thread Robert Haas
On Fri, Nov 10, 2023 at 7:43 AM Laurenz Albe wrote: > So, from my perspective, we should never have let FOR SELECT policies > mess with an UPDATE. But I am too late for that; such a change would > be way too invasive now. So I'd like to introduce a "back door" by > creating a FOR SELECT policy w

Re: Question about non-blocking mode in libpq

2023-11-13 Thread Bruce Momjian
On Wed, Nov 1, 2023 at 08:47:33AM -0400, Bruce Momjian wrote: > On Tue, Oct 31, 2023 at 10:16:07PM -0400, Tom Lane wrote: > > Bruce Momjian writes: > > > On Tue, Oct 31, 2023 at 09:11:06PM -0400, Tom Lane wrote: > > >> What I'm objecting to is removal of the bit about "if they need to be > > >> c

Re: Why do indexes and sorts use the database collation?

2023-11-13 Thread Andres Freund
Hi, On 2023-11-11 23:19:55 -0800, Jeff Davis wrote: > On Fri, 2023-11-10 at 17:19 -0800, Andres Freund wrote: > > I guess you are arguing that the user didn't intend to create an > > index here? > > No, obviously the user should expect an index when a primary key is > created. But that doesn't mea

Re: COPY TO (FREEZE)?

2023-11-13 Thread Tom Lane
Bruce Momjian writes: > Patch applied to master. The buildfarm is quite unhappy with you. regards, tom lane

Re: Cleaning up array_in()

2023-11-13 Thread Tom Lane
I wrote: > Heikki Linnakangas writes: >> 2. This was the same before this patch, but: >> postgres=# select '{{1}}'::int[]; >> ERROR: number of array dimensions (7) exceeds the maximum allowed (6) >> LINE 1: select '{{1}}'::int[]; >> ^ >> The error message isn't gr

retire MemoryContextResetAndDeleteChildren backwards compatibility macro

2023-11-13 Thread Nathan Bossart
I just found myself researching the difference between MemoryContextReset() and MemoryContextResetAndDeleteChildren(), and it turns out that as of commit eaa5808 (2015), there is none. MemoryContextResetAndDeleteChildren() is just a backwards compatibility macro for MemoryContextReset(). I found t

Re: Question about non-blocking mode in libpq

2023-11-13 Thread Bruce Momjian
On Mon, Nov 13, 2023 at 01:01:32PM -0500, Bruce Momjian wrote: > On Wed, Nov 1, 2023 at 08:47:33AM -0400, Bruce Momjian wrote: > > On Tue, Oct 31, 2023 at 10:16:07PM -0400, Tom Lane wrote: > > > Bruce Momjian writes: > > > > On Tue, Oct 31, 2023 at 09:11:06PM -0400, Tom Lane wrote: > > > >> What

Re: pg_walfile_name_offset can return inconsistent values

2023-11-13 Thread Bruce Momjian
On Mon, Nov 13, 2023 at 09:49:53AM -0800, Andres Freund wrote: > Hi, > > On 2023-11-13 12:14:57 -0500, Bruce Momjian wrote: > > +SELECT * > > +FROM (values ('0/16ff'), ('0/1700'), ('0/1701')) as t(lsn), > > + LATERAL pg_walfile_name_offset(lsn::pg_lsn), > > + LATERAL pg_walfile

Re: [PATCH] pgbench log file headers

2023-11-13 Thread Andrew Atkinson
Hi Adam. Column headers in pgbench log files seem helpful. Besides programs, it seems helpful for humans to understand the column data as well. I was able to apply your patch and verify that the headers are added to the log file: andy@MacBook-Air-4 ~/P/postgres (master)> rm pgbench_log.* andy@Mac

Re: trying again to get incremental backup

2023-11-13 Thread Robert Haas
On Fri, Nov 10, 2023 at 6:27 AM Dilip Kumar wrote: > - I think 0001 looks good improvement irrespective of the patch series. OK, perhaps that can be independently committed, then, if nobody objects. Thanks for the review; I've fixed a bunch of things that you mentioned. I'll just comment on the

Re: Version 14/15 documentation Section "Alter Default Privileges"

2023-11-13 Thread Bruce Momjian
On Wed, Nov 8, 2023 at 01:12:24PM +0100, Laurenz Albe wrote: > > I find the above sentence odd. What is its purpose? > > I cannot count how many times I have seen the complaint "I have run ALTER > DEFAULT > PRIVILEGES, and now when some other user creates a table, the permissions are > unchange

Re: Bug: RLS policy FOR SELECT is used to check new rows

2023-11-13 Thread Laurenz Albe
On Mon, 2023-11-13 at 12:57 -0500, Robert Haas wrote: > On Fri, Nov 10, 2023 at 7:43 AM Laurenz Albe wrote: > > So, from my perspective, we should never have let FOR SELECT policies > > mess with an UPDATE. But I am too late for that; such a change would > > be way too invasive now. So I'd like

Re: Version 14/15 documentation Section "Alter Default Privileges"

2023-11-13 Thread Laurenz Albe
On Mon, 2023-11-13 at 14:28 -0500, Bruce Momjian wrote: > Patch applied back to PG 16. Great thanks! I am hopeful that that will reduce people's confusion about this feature. Yours, Laurenz Albe

Re: Fix output of zero privileges in psql

2023-11-13 Thread Laurenz Albe
On Mon, 2023-11-13 at 11:27 +0100, Erik Wienhold wrote: > On 2023-11-09 20:19 +0100, Tom Lane wrote: > > Laurenz Albe writes: > > > Thanks for the feedback. I'll set the patch to "ready for committer" > > > then. > > > > So, just to clarify, we're settling on your v4 from [1]? > > > > [1] > >

Re: Fix output of zero privileges in psql

2023-11-13 Thread David G. Johnston
On Mon, Nov 13, 2023 at 12:36 PM Laurenz Albe wrote: > On Mon, 2023-11-13 at 11:27 +0100, Erik Wienhold wrote: > > On 2023-11-09 20:19 +0100, Tom Lane wrote: > > > Laurenz Albe writes: > > > > Thanks for the feedback. I'll set the patch to "ready for > committer" then. > > > > > > So, just to c

Re: COPY TO (FREEZE)?

2023-11-13 Thread Bruce Momjian
On Mon, Nov 13, 2023 at 01:17:32PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > Patch applied to master. > > The buildfarm is quite unhappy with you. Wow, I never suspeced that, fixed. -- Bruce Momjian https://momjian.us EDB https://enter

Re: Version 14/15 documentation Section "Alter Default Privileges"

2023-11-13 Thread Bruce Momjian
On Mon, Nov 13, 2023 at 08:33:33PM +0100, Laurenz Albe wrote: > On Mon, 2023-11-13 at 14:28 -0500, Bruce Momjian wrote: > > Patch applied back to PG 16. > > Great thanks! > > I am hopeful that that will reduce people's confusion about this feature. Agreed! -- Bruce Momjian https://m

Re: POC, WIP: OR-clause support for indexes

2023-11-13 Thread a.rybakina
Hi, all! These days I was porting a patch for converting or expressions to ANY to the choose_bitmap_and function. Unfortunately, it is not possible to transfer the conversion there, since expressions are processed one by one, as far as I saw. Therefore, I tried to make the conversion earlier

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

2023-11-13 Thread David Christensen
On Tue, Nov 7, 2023 at 6:20 PM Andres Freund wrote: > Hi, > > On 2023-05-09 17:08:26 -0500, David Christensen wrote: > > From 965309ea3517fa734c4bc89c144e2031cdf6c0c3 Mon Sep 17 00:00:00 2001 > > From: David Christensen > > Date: Tue, 9 May 2023 16:56:15 -0500 > > Subject: [PATCH v4 1/3] Add res

Re: should check collations when creating partitioned index

2023-11-13 Thread Laurenz Albe
On Mon, 2023-11-13 at 10:24 +0100, Peter Eisentraut wrote: > * If this table is partitioned and we're creating a unique index, > primary > * key, or exclusion constraint, make sure that the partition key is a > * subset of the index's columns. Otherwise it would be possible to >

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

2023-11-13 Thread Andres Freund
Hi, On 2023-11-08 18:47:56 -0800, Peter Geoghegan wrote: > On Wed, Nov 8, 2023 at 6:04 AM Stephen Frost wrote: > > In conversations with folks (my memory specifically is a discussion with > > Peter G, added to CC, and my apologies to Peter if I'm misremembering) > > there was a pretty strong push

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

2023-11-13 Thread David Christensen
On Mon, Nov 13, 2023 at 2:27 PM Andres Freund wrote: > Hi, > > On 2023-11-08 18:47:56 -0800, Peter Geoghegan wrote: > > On Wed, Nov 8, 2023 at 6:04 AM Stephen Frost wrote: > > > In conversations with folks (my memory specifically is a discussion > with > > > Peter G, added to CC, and my apologie

Re: Split index and table statistics into different types of stats

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 09:26:56 +0100, Drouvot, Bertrand wrote: > --- a/src/backend/storage/buffer/bufmgr.c > +++ b/src/backend/storage/buffer/bufmgr.c > @@ -799,11 +799,19 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, > BlockNumber blockNum, >* Read the buffer, and update pgstat co

Re: Fix output of zero privileges in psql

2023-11-13 Thread Tom Lane
"David G. Johnston" writes: > On Mon, Nov 13, 2023 at 12:36 PM Laurenz Albe > wrote: >> On Mon, 2023-11-13 at 11:27 +0100, Erik Wienhold wrote: >>> On 2023-11-09 20:19 +0100, Tom Lane wrote: So, just to clarify, we're settling on your v4 from [1]? >>> Yes from my side. >> +1 > +0.5 for th

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

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 14:37:47 -0600, David Christensen wrote: > On Mon, Nov 13, 2023 at 2:27 PM Andres Freund wrote: > > On 2023-11-08 18:47:56 -0800, Peter Geoghegan wrote: > > > On Wed, Nov 8, 2023 at 6:04 AM Stephen Frost wrote: > > > > In conversations with folks (my memory specifically is a di

Re: "box" type description

2023-11-13 Thread Bruce Momjian
On Thu, Nov 2, 2023 at 04:12:57PM -0400, Bruce Momjian wrote: > > pg_brin_bloom_summary, pg_brin_minmax_multi_summary, pg_mcv_list and many: > > > > I'm uncertain whether these types, which lack an input syntax (but > > have an output format), qualify as pseudo-types. Nevertheless, I > > believe

Re: Why do indexes and sorts use the database collation?

2023-11-13 Thread Tomas Vondra
On 11/13/23 19:02, Andres Freund wrote: > Hi, > > On 2023-11-11 23:19:55 -0800, Jeff Davis wrote: >> On Fri, 2023-11-10 at 17:19 -0800, Andres Freund wrote: >>> I guess you are arguing that the user didn't intend to create an >>> index here? >> >> No, obviously the user should expect an index w

[DOC] Add detail regarding resource consumption wrt max_connections

2023-11-13 Thread Roberto Mello
The documentation for max_connections does not mention that just by having a higher value for max_connections, PostgreSQL will use more resources. While working with different customers, I noticed that several of them set max_connections to very high numbers, even though they never expected to act

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

2023-11-13 Thread David Christensen
On Mon, Nov 13, 2023 at 2:52 PM Andres Freund wrote: > > > This scheme would open up space per page that would now be available for > > plenty of other things; the encoding in the header and the corresponding > > available space in the footer would seem to open up quite a few options > > now, no?

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

2023-11-13 Thread Stephen Frost
Greetings, On Mon, Nov 13, 2023 at 16:53 David Christensen < david.christen...@crunchydata.com> wrote: > On Mon, Nov 13, 2023 at 2:52 PM Andres Freund wrote: > >> >> > This scheme would open up space per page that would now be available for >> > plenty of other things; the encoding in the header

Re: Why do indexes and sorts use the database collation?

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 22:36:24 +0100, Tomas Vondra wrote: > I don't think we can just arbitrarily override the default because we > happen to think "C" is going to be faster. If we could prove that using > "C" is going to produce exactly the same results as for the implicit > collation (for a given op

lazy_scan_heap() should release lock on buffer before vacuuming FSM

2023-11-13 Thread Melanie Plageman
Hi, I noticed that in lazy_scan_heap(), when there are no indexes on the table being vacuumed, we don't release the lock on the heap page buffer before vacuuming the freespace map. Other call sites of FreeSpaceMapVacuumRange() hold no such lock. It seems like a waste to hold a lock we don't need.

Emit fewer vacuum records by reaping removable tuples during pruning

2023-11-13 Thread Melanie Plageman
Hi, When there are no indexes on the relation, we can set would-be dead items LP_UNUSED and remove them during pruning. This saves us a vacuum WAL record, reducing WAL volume (and time spent writing and syncing WAL). See this example: drop table if exists foo; create table foo(a int) with (a

Re: archive modules loose ends

2023-11-13 Thread Nathan Bossart
There seems to be no interest in this patch, so I plan to withdraw it from the commitfest system by the end of the month unless such interest materializes. On Fri, Feb 17, 2023 at 01:56:24PM -0800, Nathan Bossart wrote: > The first one is the requirement that archive module authors create their >

Re: Emit fewer vacuum records by reaping removable tuples during pruning

2023-11-13 Thread Peter Geoghegan
On Mon, Nov 13, 2023 at 2:29 PM Melanie Plageman wrote: > I think it also makes it clear that we should update the VM in > lazy_scan_prune(). All callers of lazy_scan_prune() will now consider > updating the VM after returning. And most of the state communicated back > to lazy_scan_heap() from laz

Re: Why do indexes and sorts use the database collation?

2023-11-13 Thread Tomas Vondra
On 11/13/23 23:12, Andres Freund wrote: > Hi, > > On 2023-11-13 22:36:24 +0100, Tomas Vondra wrote: >> I don't think we can just arbitrarily override the default because we >> happen to think "C" is going to be faster. If we could prove that using >> "C" is going to produce exactly the same result

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

2023-11-13 Thread Peter Smith
Here are some review comments for patch v13-0001. == doc/src/sgml/config.sgml 1. -Causes each replication command to be logged in the server log. -See for more information about -replication command. The default value is off. -Only superusers and user

Re: Some deleted GUCs are still referred to

2023-11-13 Thread Peter Smith
On Thu, Nov 9, 2023 at 8:12 PM Daniel Gustafsson wrote: > > > On 9 Nov 2023, at 00:51, Peter Smith wrote: > > > > Hi, > > > > I happened to notice that some GUC names "max_fsm_pages" and > > "max_fsm_relations" are still mentioned in these translation files > > (from the REL_16_1 source zip) > >

Re: archive modules loose ends

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 16:42:31 -0600, Nathan Bossart wrote: > There seems to be no interest in this patch, so I plan to withdraw it from > the commitfest system by the end of the month unless such interest > materializes. I think it might just have arrived too shortly before the feature freeze to be

Re: Why do indexes and sorts use the database collation?

2023-11-13 Thread Andres Freund
Hi, On 2023-11-14 00:02:13 +0100, Tomas Vondra wrote: > On 11/13/23 23:12, Andres Freund wrote: > > On 2023-11-13 22:36:24 +0100, Tomas Vondra wrote: > >> ISTM it's about how complex the rules implemented by the collation are, > >> so I agree the cost should be a feature of collations not provider

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

2023-11-13 Thread Andres Freund
Hi, On 2023-11-09 12:16:52 +0900, Michael Paquier wrote: > On Thu, Nov 09, 2023 at 12:04:19PM +0900, Michael Paquier wrote: > > Sure, sorry for the confusion. By "we'd do nothing", I mean precirely > > "to take no specific action related to archive recovery and recovery > > parameters at the end

Re: Why do indexes and sorts use the database collation?

2023-11-13 Thread Jeff Davis
On Mon, 2023-11-13 at 10:02 -0800, Andres Freund wrote: > > Inequalities and ORDER BYs can't benefit from an index with a > > different > > collation, but lots of indexes don't need that. > > But we don't know whether the index is used for that. That will be hard to quantify, but perhaps we can d

Re: [PATCH] pgbench log file headers

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 11:55:07 -0600, Adam Hendel wrote: > Currently, pgbench will log individual transactions to a logfile when the > `--log` parameter flag is provided. The logfile, however, does not include > column header. It has become a fairly standard expectation of users to have > column heade

Re: Emit fewer vacuum records by reaping removable tuples during pruning

2023-11-13 Thread Melanie Plageman
On Mon, Nov 13, 2023 at 5:59 PM Peter Geoghegan wrote: > > On Mon, Nov 13, 2023 at 2:29 PM Melanie Plageman > wrote: > > I think it also makes it clear that we should update the VM in > > lazy_scan_prune(). All callers of lazy_scan_prune() will now consider > > updating the VM after returning. An

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

2023-11-13 Thread Michael Paquier
On Mon, Nov 13, 2023 at 03:41:44PM -0800, Andres Freund wrote: > On 2023-11-09 12:16:52 +0900, Michael Paquier wrote: >> On Thu, Nov 09, 2023 at 12:04:19PM +0900, Michael Paquier wrote: >> > Sure, sorry for the confusion. By "we'd do nothing", I mean precirely >> > "to take no specific action rela

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

2023-11-13 Thread Andres Freund
Hi, On 2023-11-14 09:13:44 +0900, Michael Paquier wrote: > On Mon, Nov 13, 2023 at 03:41:44PM -0800, Andres Freund wrote: > > On 2023-11-09 12:16:52 +0900, Michael Paquier wrote: > >> On Thu, Nov 09, 2023 at 12:04:19PM +0900, Michael Paquier wrote: > >> > Sure, sorry for the confusion. By "we'd d

Re: pg_upgrade and logical replication[

2023-11-13 Thread Michael Paquier
On Mon, Nov 13, 2023 at 04:02:27PM +0530, Amit Kapila wrote: > On Mon, Nov 13, 2023 at 1:52 PM Michael Paquier wrote: >> It seems to me that INIT cannot be relied on for a similar reason. >> This state would be set for a new relation in >> LogicalRepSyncTableStart(), and the relation would still b

Re: pgsql: doc: fix wording describing the checkpoint_flush_after GUC

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 12:31:42 +0100, Alvaro Herrera wrote: > On 2023-Nov-09, Bruce Momjian wrote: > > > doc: fix wording describing the checkpoint_flush_after GUC > > Hmm. Is this new wording really more clear than the original wording? > I agree the original may not have been the most simple, but I

Re: mxid_age() and age(xid) appear undocumented

2023-11-13 Thread Bruce Momjian
On Thu, Jul 5, 2018 at 01:30:22PM -0700, Peter Geoghegan wrote: > On Thu, Jul 5, 2018 at 12:36 PM, Robert Haas wrote: > > On Sun, Jul 1, 2018 at 11:18 PM, David Rowley > > wrote: > >> I see d692308cf494f6126 mentions mxid_age() in passing, but there > >> appears to be no formal definition of eit

Re: Lifetime of commit timestamps

2023-11-13 Thread Bruce Momjian
On Fri, Jun 22, 2018 at 05:21:32PM +0900, Kyotaro HORIGUCHI wrote: > Hello. > > I don't find any description in the documentation about the > guaranteed lifetime of commit timestamps. I think they are > preserved until corresponding xid goes beyond the freeze horizen, > even though they are actual

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

2023-11-13 Thread Michael Paquier
On Mon, Nov 13, 2023 at 07:31:41PM +0900, Michael Paquier wrote: > On Mon, Nov 13, 2023 at 02:07:21PM +0530, Bharath Rupireddy wrote: >> Modified the docs for pg_stat_reset_slru to match with that of >> pg_stat_reset_shared. PSA v2 patch. > > That feels consistent. Thanks. And applied this one.

Re: mxid_age() and age(xid) appear undocumented

2023-11-13 Thread Peter Geoghegan
On Mon, Nov 13, 2023 at 4:43 PM Bruce Momjian wrote: > I looked into this and all the 4-byte xid functions are marked as > deprecated for the 8-byte variants. I don't think documenting 4-byte > mxid_age() and age(xid) makes sense anymore, and I don't see their value > enough to create 8-byte vers

Re: mxid_age() and age(xid) appear undocumented

2023-11-13 Thread Nikolay Samokhvalov
On Mon, Nov 13, 2023 at 5:01 PM Peter Geoghegan wrote: > > On Mon, Nov 13, 2023 at 4:43 PM Bruce Momjian wrote: > > I looked into this and all the 4-byte xid functions are marked as > > deprecated for the 8-byte variants. I don't think documenting 4-byte > > mxid_age() and age(xid) makes sense a

Re: lazy_scan_heap() should release lock on buffer before vacuuming FSM

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 17:13:32 -0500, Melanie Plageman wrote: > I noticed that in lazy_scan_heap(), when there are no indexes on the > table being vacuumed, we don't release the lock on the heap page buffer > before vacuuming the freespace map. Other call sites of > FreeSpaceMapVacuumRange() hold no s

Re: mxid_age() and age(xid) appear undocumented

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 17:00:43 -0800, Peter Geoghegan wrote: > On Mon, Nov 13, 2023 at 4:43 PM Bruce Momjian wrote: > > I looked into this and all the 4-byte xid functions are marked as > > deprecated for the 8-byte variants. I don't think documenting 4-byte > > mxid_age() and age(xid) makes sense a

回复: Re:Re: How to solve the problem of one backend process crashing and causing other processes to restart?

2023-11-13 Thread Thomas wen
Hi yuansong there is connnection pool path (https://commitfest.postgresql.org/34/3043/) ,but it has been dormant for few years,You can check this patch to get what you want to need 发件人: yuansong 发送时间: 2023年11月13日 17:13 收件人: Laurenz Albe 抄送: pgsql-hackers@

Re: pg_upgrade and logical replication

2023-11-13 Thread vignesh C
On Mon, 13 Nov 2023 at 13:52, Michael Paquier wrote: > > On Fri, Nov 10, 2023 at 07:26:18PM +0530, vignesh C wrote: > > I did testing in the same lines that you mentioned. Apart from that I > > also reviewed the design where it was using the old subscription id > > like in case of table sync worke

Re: building with meson on windows with ssl

2023-11-13 Thread Andres Freund
Hi, On 2023-11-12 11:41:15 -0500, Dave Cramer wrote: > On Sun, 12 Nov 2023 at 07:57, Dave Cramer wrote: > > I am getting the following error > > building on HEAD > > > > Library crypto found: YES > > Checking for function "CRYPTO_new_ex_data" with dependencies -lssl, > > -lcrypto: NO > > > > So

Re: Why do indexes and sorts use the database collation?

2023-11-13 Thread Jeff Davis
On Mon, 2023-11-13 at 22:36 +0100, Tomas Vondra wrote: > Yeah. I don't quite agree with the initial argument that not > specifying > the collation explicitly in CREATE TABLE or a query means the user > does > not care about the collation. I didn't argue that the user doesn't care about collation -

Re: Re: How to solve the problem of one backend process crashing and causing other processes to restart?

2023-11-13 Thread Merlin Moncure
On Mon, Nov 13, 2023 at 3:14 AM yuansong wrote: > Enhancing the overall fault tolerance of the entire system for this > feature is quite important. No one can avoid bugs, and I don't believe that > this approach is a more advanced one. It might be worth considering adding > it to the roadmap so t

Re: Is this a problem in GenericXLogFinish()?

2023-11-13 Thread Amit Kapila
On Mon, Nov 13, 2023 at 10:51 PM Robert Haas wrote: > > On Mon, Nov 13, 2023 at 12:47 AM Hayato Kuroda (Fujitsu) > wrote: > > Moved. > > I see that this patch was committed, but I'm not very convinced that > the approach is correct. The comment says this: > > + /* > +* A wri

  1   2   >