Re: Making Vars outer-join aware

2022-11-15 Thread Richard Guo
On Sun, Nov 6, 2022 at 5:53 AM Tom Lane wrote: > I wrote: > > I've been working away at this patch series, and here is an up-to-date > > version. > > This needs a rebase after ff8fa0bf7 and b0b72c64a. I also re-ordered > the patches so that the commit messages' claims about when regression > tes

Re: Synchronizing slots from primary to standby

2022-11-15 Thread Drouvot, Bertrand
Hi, On 2/11/22 3:26 PM, Peter Eisentraut wrote: On 10.02.22 22:47, Bruce Momjian wrote: On Tue, Feb  8, 2022 at 08:27:32PM +0530, Ashutosh Sharma wrote: Which means that if e.g. the standby_slot_names GUC differs from synchronize_slot_names on the physical replica, the slots synchronized on t

Re: List of Bitmapset (was Re: ExecRTCheckPerms() and many prunable partitions)

2022-11-15 Thread Alvaro Herrera
On 2022-Nov-14, Tom Lane wrote: > For discussion's sake, here's my current version of that 0004 patch, > rewritten to use list-of-bitmapset as the data structure. I feel that there should be more commentary that explains what a multi-bms is. Not sure where, maybe just put it near the function th

Re: Allow single table VACUUM in transaction block

2022-11-15 Thread Simon Riggs
On Mon, 14 Nov 2022 at 19:52, Simon Riggs wrote: > > On Tue, 8 Nov 2022 at 03:10, Simon Riggs wrote: > > > > On Mon, 7 Nov 2022 at 08:20, Simon Riggs > > wrote: > > > > > Temp tables are actually easier, since we don't need any of the > > > concurrency features we get with lazy vacuum. > > > Th

Re: archive modules

2022-11-15 Thread Peter Eisentraut
On 05.11.22 21:51, Nathan Bossart wrote: On Fri, Nov 04, 2022 at 12:05:26PM +0900, Ian Lawrence Barwick wrote: cfbot reports the patch no longer applies [1]. As CommitFest 2022-11 is currently underway, this would be an excellent time to update the patch. Indeed. Here is a new version of the

Re: SUBTRANS: Minimizing calls to SubTransSetParent()

2022-11-15 Thread Simon Riggs
On Mon, 7 Nov 2022 at 21:14, Simon Riggs wrote: > These results are compelling, thank you. > > Setting this to Ready for Committer. New version attached. -- Simon Riggshttp://www.EnterpriseDB.com/ 002_minimize_calls_to_SubTransSetParent.v12.patch Description: Binary data

Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures

2022-11-15 Thread Bharath Rupireddy
On Fri, Nov 11, 2022 at 5:52 PM Maxim Orlov wrote: > > Hi! > > I've watched over the patch and consider it useful. Applies without > conflicts. The functionality of the patch itself is > meets declared functionality. Thanks for reviewing. > But, in my view, some improvements may be proposed. We

Re: pg_basebackup's --gzip switch misbehaves

2022-11-15 Thread Daniel Gustafsson
> On 15 Nov 2022, at 00:58, Michael Paquier wrote: > > On Mon, Nov 14, 2022 at 03:27:14PM +0100, Daniel Gustafsson wrote: >> Ugh, yes, that's what it should say. > > A split sounds fine by me. On top of what Tom has mentioned, I have > spotted two small-ish things. > > -This module is avai

Re: Unit tests for SLRU

2022-11-15 Thread Aleksander Alekseev
Hi Michael, > I have reworked that as per the attached, that provides basically the > same coverage, going through a SQL interface for the whole thing. > Like all the other tests of its kind, this does not use a TAP test, > relying on a custom configuration file instead. This still needs some > p

Re: New docs chapter on Transaction Management and related changes

2022-11-15 Thread Simon Riggs
On Tue, 8 Nov 2022 at 03:41, Bruce Momjian wrote: > > On Mon, Nov 7, 2022 at 10:58:05AM +, Simon Riggs wrote: > > What I've posted is the merged patch, i.e. your latest patch, plus > > changes to RELEASE SAVEPOINT from you on Oct 16, plus changes based on > > the later comments from Robert an

Re: libpq support for NegotiateProtocolVersion

2022-11-15 Thread Peter Eisentraut
On 14.11.22 19:11, Jacob Champion wrote: If we want to address this, maybe this should be handled in the polling loop before we pass off the input buffer to the per-message-type handlers. I thought it was supposed to be handled by this code: /* * Can't process if message body

Re: Non-decimal integer literals

2022-11-15 Thread Peter Eisentraut
On 14.11.22 08:25, John Naylor wrote: Regarding the patch, it looks good overall. My only suggestion would be to add a regression test for just below and just above overflow, at least for int2. ok Minor nits: - * Process {integer}.  Note this will also do the right thing with {decimal}, +

Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment

2022-11-15 Thread David Rowley
On Tue, 15 Nov 2022 at 11:11, Andres Freund wrote: > Couldn't we reduce the amount of over-allocation by a small amount by special > casing the already-aligned case? That's not going to be relevant for page size > aligne allocations, but for smaller alignment values it could matter. I don't quite

Re: Unit tests for SLRU

2022-11-15 Thread Daniel Gustafsson
> On 15 Nov 2022, at 11:15, Aleksander Alekseev > wrote: >> What do you think? > > It looks much better than before. I replaced strcpy() with strncpy() > and pgindent'ed the code. + /* write given data to the page */ + strncpy(TestSlruCtl->shared->page_buffer[slotno], data, BLCKSZ

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-11-15 Thread Bharath Rupireddy
On Tue, Nov 15, 2022 at 1:29 AM David Christensen wrote: > > Enclosed is v8, which uses the replication slot method to retain WAL > as well as fsync'ing the output directory when everything is done. Thanks. It mostly is in good shape. However, few more comments: 1. +if it does not exist.

Re: Unit tests for SLRU

2022-11-15 Thread Pavel Borisov
Hi, Alexander! > > I have reworked that as per the attached, that provides basically the > > same coverage, going through a SQL interface for the whole thing. > > Like all the other tests of its kind, this does not use a TAP test, > > relying on a custom configuration file instead. This still need

Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment

2022-11-15 Thread David Rowley
On Mon, 14 Nov 2022 at 15:25, John Naylor wrote: > - Assert((char *) chunk > (char *) block); > + Assert((char *) chunk >= (char *) block); > > Is this related or independent? It's related. Because the code is doing: MemoryChunkSetHdrMask(alignedchunk, unaligned, alignto, MCTX_ALIGNED_REDIREC

Re: Assertion failure in SnapBuildInitialSnapshot()

2022-11-15 Thread Amit Kapila
On Tue, Nov 15, 2022 at 8:08 AM Andres Freund wrote: > > On 2022-11-14 17:25:31 -0800, Andres Freund wrote: > > Hm, also, shouldn't the patch adding CRS_USE_SNAPSHOT have copied more of > > SnapBuildExportSnapshot()? Why aren't the error checks for > > SnapBuildExportSnapshot() needed? Why don't w

Re: Add non-blocking version of PQcancel

2022-11-15 Thread Jelte Fennema
Ugh, it indeed seems like I somehow messed up sending the new patch. Here's the correct one. 0001-Add-non-blocking-version-of-PQcancel.patch Description: 0001-Add-non-blocking-version-of-PQcancel.patch

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-11-15 Thread Nitin Jadhav
> v6 was not applying anymore, due to a change in > doc/src/sgml/ref/checkpoint.sgml done by b9eb0ff09e (Rename > pg_checkpointer predefined role to pg_checkpoint). > > Please find attached a rebase in v7. > > While working on this rebase, I also noticed that "pg_checkpointer" is > still mentioned

Re: Assertion failure in SnapBuildInitialSnapshot()

2022-11-15 Thread Amit Kapila
On Tue, Nov 15, 2022 at 6:55 AM Andres Freund wrote: > > On 2022-11-10 16:04:40 +0530, Amit Kapila wrote: > > I don't have any good ideas on how to proceed with this. Any thoughts > > on this would be helpful? > > One thing worth doing might be to convert the assertion path into an elog(), > menti

Re: Error on missing Python module in Meson setup

2022-11-15 Thread Daniel Gustafsson
> On 15 Nov 2022, at 01:25, Andres Freund wrote: > On 2022-11-14 14:23:02 +0100, Daniel Gustafsson wrote >> Installing the distutils package fixes it, but it seems harsh to fail setup >> on >> a missing package. Would something like the attached make sense? > > The error is a bit better in newe

Re: meson oddities

2022-11-15 Thread Andrew Dunstan
On 2022-11-14 Mo 18:24, Andres Freund wrote: > Hi, > > On 2022-11-14 17:41:54 -0500, Andrew Dunstan wrote: >> Here's a couple of things I've noticed. >> >> >> andrew@ub22:HEAD $ inst.meson/bin/pg_config --libdir --ldflags >> /home/andrew/pgl/pg_head/root/HEAD/inst.meson/lib/x86_64-linux-gnu >> -f

Re: psql: Add command to use extended query protocol

2022-11-15 Thread Peter Eisentraut
On 09.11.22 00:12, Corey Huinker wrote: As for the docs, they're very clear and probably sufficient as-is, but I wonder if we should we explicitly state that the bind-state and bind parameters do not "stay around" after the query is executed? Suggestions in bold:          This command causes

Re: SUBTRANS: Minimizing calls to SubTransSetParent()

2022-11-15 Thread Japin Li
On Tue, 15 Nov 2022 at 17:34, Simon Riggs wrote: > On Mon, 7 Nov 2022 at 21:14, Simon Riggs wrote: > >> These results are compelling, thank you. >> >> Setting this to Ready for Committer. > > New version attached. Take a quick look, I think it should be PGPROC instead of PG_PROC, right? +

Re: when the startup process doesn't (logging startup delays)

2022-11-15 Thread Bharath Rupireddy
On Mon, Nov 14, 2022 at 9:31 PM Robert Haas wrote: > > On Mon, Nov 14, 2022 at 7:37 AM Simon Riggs > wrote: > > > Whilte at it, I noticed that we report redo progress for PITR, but we > > > don't report when standby enters archive recovery mode, say due to a > > > failure in the connection to pri

Re: plpgsql-trigger.html: Format TG_ variables as table (patch)

2022-11-15 Thread Daniel Gustafsson
> On 2 Sep 2022, at 11:19, Daniel Gustafsson wrote: > The patch missed to update the corresponding list for TG_ event trigger vars, > fixed in the attached. I took another look at this, and pushed it with a few small tweaks. Thanks! -- Daniel Gustafsson https://vmware.com/

Re: Add sub-transaction overflow status in pg_stat_activity

2022-11-15 Thread Robert Haas
On Mon, Nov 14, 2022 at 4:17 PM Andres Freund wrote: > Perhaps this would better be tackled by a new "visibility" view. It could show > - number of sessions with a snapshot > - max age of backend xmin > - pid with max backend xmin > - number of sessions that suboverflowed > - pid of the session wi

Re: when the startup process doesn't (logging startup delays)

2022-11-15 Thread Simon Riggs
On Tue, 15 Nov 2022 at 13:33, Bharath Rupireddy wrote: > > On Mon, Nov 14, 2022 at 9:31 PM Robert Haas wrote: > > > > On Mon, Nov 14, 2022 at 7:37 AM Simon Riggs > > wrote: > > > > Whilte at it, I noticed that we report redo progress for PITR, but we > > > > don't report when standby enters arch

Re: Meson doesn't define HAVE_LOCALE_T for mscv

2022-11-15 Thread Juan José Santamaría Flecha
On Tue, Nov 15, 2022 at 1:49 AM Andres Freund wrote: > > Hm. Is it right that the changes are only done for msvc? win32_port.h > defines > the types for mingw as well afaict. > > Yes, it does, but configure does nothing with them, so adding those defines is a new feature for MinGW but a correctio

Re: Avoid overhead open-close indexes (catalog updates)

2022-11-15 Thread Ranier Vilela
Em ter., 15 de nov. de 2022 às 04:02, Michael Paquier escreveu: > On Tue, Nov 15, 2022 at 09:57:26AM +0900, Michael Paquier wrote: > > Anyway, multi-inserts are going to be solution better than > > CatalogTupleInsertWithInfo() in some cases, because we would just > > generate one WAL record of N

Re: Check return value of pclose() correctly

2022-11-15 Thread Peter Eisentraut
On 02.11.22 16:26, Ankit Kumar Pandey wrote: The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed Hi Peter, This

Re: dynamic result sets support in extended query protocol

2022-11-15 Thread Peter Eisentraut
On 14.10.22 19:22, Pavel Stehule wrote: 1. there can be possibility to set "dynamic result sets" to unknown. The behaviour of the "dynamic result sets" option is a little bit confusing. I expect the number of result sets should be exactly the same as this number. But the warning is raised only

Re: Vacuumdb --force-index-cleanup option not available in postgres 12.9

2022-11-15 Thread Justin Pryzby
On Tue, Nov 15, 2022 at 02:45:37PM +, Karthik Jagadish (kjagadis) wrote: > Hi, > > In the postgres document we notice that the --force-index-cleanup option is > available in PostgreSQL server 12 and Later. We have postgres db running on > 12.9 but we don’t see this option. > > https://www.p

Index not getting cleaned even though vacuum is running

2022-11-15 Thread Karthik Jagadish (kjagadis)
Hi, We notice that vacuum is happening at regular intervals but the space occupied by indexes is always increasing. Any pointers as to why would this happen? Some outputs below. Auto vacuum is enabled but we notice index size is growing. $ psql -U postgres -d cgms -c "SELECT pg_size_pretty(SUM

Re: Vacuumdb --force-index-cleanup option not available in postgres 12.9

2022-11-15 Thread Karthik Jagadish (kjagadis)
Thanks Justin for prompt response. Could you please provide the full email for pgsql-user? pgsql-u...@postgresql.org is not working From: Justin Pryzby Date: Tuesday, 15 November 2022 at 9:02 PM To: Karthik Jagadish (kjagadis) Cc: pgsql-hack...@postgresql.org

Re: Vacuumdb --force-index-cleanup option not available in postgres 12.9

2022-11-15 Thread Justin Pryzby
On Tue, Nov 15, 2022 at 03:40:58PM +, Karthik Jagadish (kjagadis) wrote: > Thanks Justin for prompt response. Could you please provide the full email > for pgsql-user? pgsql-u...@postgresql.org > is not working Of course, I intended to say pgsql-gene...@list

Re: meson oddities

2022-11-15 Thread Peter Eisentraut
On 15.11.22 00:48, Andres Freund wrote: We effectively do that with autoconf as well, except that we don't mention that in pg_config --ldflags. Our linking rules include CFLAGS, see e.g.: %: %.o $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) postgres: $(OBJS) $(CC

Re: Error-safe user functions

2022-11-15 Thread Andrew Dunstan
On 2022-10-07 Fr 13:37, Tom Lane wrote: [ lots of detailed review ] > Basically, this patch set should be a lot smaller and not have ambitions > beyond "get the API right" and "make one or two datatypes support COPY > NULL_ON_ERROR". Add more code once that core functionality gets reviewed >

Re: HOT chain validation in verify_heapam()

2022-11-15 Thread Robert Haas
On Mon, Nov 14, 2022 at 5:02 PM Andres Freund wrote: > On 2022-11-14 14:27:54 -0500, Robert Haas wrote: > > On Wed, Nov 9, 2022 at 5:08 PM Andres Freund wrote: > > > I don't really understand this logic - why can't we populate the > > > predecessor > > > array, if we can construct a successor en

Re: archive modules

2022-11-15 Thread Nathan Bossart
On Tue, Nov 15, 2022 at 10:31:44AM +0100, Peter Eisentraut wrote: > I have committed this to master. Thanks! > The surrounding code has changed a bit between PG15 and master, so if we > wanted to backpatch this, we'd need another patch from you. However, at > this point, I'm content to just leav

Re: allowing for control over SET ROLE

2022-11-15 Thread Robert Haas
Bump. Discussion has trailed off here, but I still don't see that we have a better way forward here than what I proposed on September 30th. Two people have commented. Nathan said that he wasn't sure this was best (neither am I) but that he didn't have a better idea either (neither do I). Stephen p

Re: archive modules

2022-11-15 Thread Alvaro Herrera
On 2022-Nov-15, Nathan Bossart wrote: > On Tue, Nov 15, 2022 at 10:31:44AM +0100, Peter Eisentraut wrote: > > The surrounding code has changed a bit between PG15 and master, so if we > > wanted to backpatch this, we'd need another patch from you. However, at > > this point, I'm content to just l

Re: when the startup process doesn't (logging startup delays)

2022-11-15 Thread Robert Haas
On Tue, Nov 15, 2022 at 8:33 AM Bharath Rupireddy wrote: > Please review the v2 patch. It seems to me that this will call disable_startup_progress_timeout once per WAL record, which seems like an unnecessary expense. How about leaving the code inside the loop just as we have it, and putting if (S

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-11-15 Thread David Christensen
On Tue, Nov 15, 2022 at 4:41 AM Bharath Rupireddy wrote: > > On Tue, Nov 15, 2022 at 1:29 AM David Christensen > wrote: > > > > Enclosed is v8, which uses the replication slot method to retain WAL > > as well as fsync'ing the output directory when everything is done. > > Thanks. It mostly is in g

Re: List of Bitmapset (was Re: ExecRTCheckPerms() and many prunable partitions)

2022-11-15 Thread Tom Lane
Alvaro Herrera writes: > On 2022-Nov-14, Tom Lane wrote: >> For discussion's sake, here's my current version of that 0004 patch, >> rewritten to use list-of-bitmapset as the data structure. > I feel that there should be more commentary that explains what a > multi-bms is. Not sure where, maybe j

Standardizing how pg_waldump presents recovery conflict XID cutoffs

2022-11-15 Thread Peter Geoghegan
Most recovery conflicts are generated in REDO routines using a standard approach these days: they all call ResolveRecoveryConflictWithSnapshot() with a latestRemovedXid argument taken directly from the WAL record. Right now we don't quite present this information in a uniform way, even though REDO

Re: List of Bitmapset (was Re: ExecRTCheckPerms() and many prunable partitions)

2022-11-15 Thread Tom Lane
Amit Langote writes: > On Mon, Nov 14, 2022 at 11:57 PM Tom Lane wrote: >> + * The new member is identified by the zero-based index of the List >> + * element it should go into, and the bit number to be set therein. > The comment sounds a bit ambiguous, especially the ", and the bit > number to

Re: Reducing the WAL overhead of freezing in VACUUM by deduplicating per-tuple freeze plans

2022-11-15 Thread Peter Geoghegan
On Fri, Nov 11, 2022 at 10:38 AM Peter Geoghegan wrote: > Attached is v4, which removes the old comments you pointed out were > now out of place (they weren't adding much anyway). Also fixed bitrot > against HEAD from today's visibility map commit from Jeff Davis. Pushed something like this earli

closing file in adjust_data_dir

2022-11-15 Thread Ted Yu
Hi, I was looking at the commit: commit 2fe3bdbd691a5d11626308e7d660440be6c210c8 Author: Peter Eisentraut Date: Tue Nov 15 15:35:37 2022 +0100 Check return value of pclose() correctly In src/bin/pg_ctl/pg_ctl.c : if (fd == NULL || fgets(filename, sizeof(filename), fd) == NULL || pclo

Distinct tightly coupled with Agg

2022-11-15 Thread Ankit Kumar Pandey
Hello, I am looking at todo item (#1) /Implement DISTINCT clause in window aggregates/ and while looking at code, I found distinct tightly coupled with Agg function. Looking at another todo item(#2) /Do we really need so much duplicated code between Agg and WindowAgg/?  I was wondering what

Re: Distinct tightly coupled with Agg

2022-11-15 Thread Tom Lane
Ankit Kumar Pandey writes: > I am looking at todo item (#1) /Implement DISTINCT clause in window > aggregates/ and while looking at code, I found distinct tightly coupled > with Agg function. Looking at another todo item(#2) /Do we really need > so much duplicated code between Agg and WindowAgg

Re: Distinct tightly coupled with Agg

2022-11-15 Thread Ankit Kumar Pandey
On 16/11/22 00:26, Tom Lane wrote: Ankit Kumar Pandey writes: I am looking at todo item (#1) /Implement DISTINCT clause in window aggregates/ and while looking at code, I found distinct tightly coupled with Agg function. Looking at another todo item(#2) /Do we really need so much duplicated c

Re: meson oddities

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 08:04:29 -0500, Andrew Dunstan wrote: > On 2022-11-14 Mo 18:24, Andres Freund wrote: > > Hi, > > > > On 2022-11-14 17:41:54 -0500, Andrew Dunstan wrote: > >> Here's a couple of things I've noticed. > >> > >> > >> andrew@ub22:HEAD $ inst.meson/bin/pg_config --libdir --ldflags > >>

Re: Moving forward with TDE

2022-11-15 Thread Jacob Champion
On Mon, Oct 24, 2022 at 9:29 AM David Christensen wrote: > I would love to open a discussion about how to move forward and get > some of these features built out. The historical threads here are > quite long and complicated; is there a "current state" other than the > wiki that reflects the gener

Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 23:36:53 +1300, David Rowley wrote: > On Tue, 15 Nov 2022 at 11:11, Andres Freund wrote: > > Couldn't we reduce the amount of over-allocation by a small amount by > > special > > casing the already-aligned case? That's not going to be relevant for page > > size > > aligne allo

Re: Add sub-transaction overflow status in pg_stat_activity

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 09:04:25 -0500, Robert Haas wrote: > On Mon, Nov 14, 2022 at 4:17 PM Andres Freund wrote: > > Perhaps this would better be tackled by a new "visibility" view. It could > > show > > - number of sessions with a snapshot > > - max age of backend xmin > > - pid with max backend xmi

Re: Moving forward with TDE

2022-11-15 Thread David Christensen
> On Nov 15, 2022, at 1:08 PM, Jacob Champion wrote: > > On Mon, Oct 24, 2022 at 9:29 AM David Christensen > wrote: >> I would love to open a discussion about how to move forward and get >> some of these features built out. The historical threads here are >> quite long and complicated; is th

Re: HOT chain validation in verify_heapam()

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 11:36:21 -0500, Robert Haas wrote: > On Mon, Nov 14, 2022 at 5:02 PM Andres Freund wrote: > > It seems like we should do a bit more validation within a chain of > > tuples. E.g. that no live tuple can follow an !DidCommit xmin? > > I think this check is already present in stron

Re: [PATCH] Teach pg_waldump to extract FPIs from the WAL

2022-11-15 Thread David Christensen
Enclosed is v9. - code style consistency (FPI instead of FPW) internally. - cleanup of no-longer needed checksum-related pieces from code and tests. - test cleanup/simplification. - other comment cleanup. Passes all CI checks. Best, David v9-0001-Teach-pg_waldump-to-extract-FPIs-from-the-WAL-

Re: Meson doesn't define HAVE_LOCALE_T for mscv

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 15:35:31 +0100, Juan José Santamaría Flecha wrote: > I've seen that when building with meson on MinGW the output for version() > is 'PostgreSQL 16devel on x86_64, compiled by gcc-12.2.0', which is not > wrong but I cannot tell that it was done on MinGW. Should we include the > 'h

Re: Meson doesn't define HAVE_LOCALE_T for mscv

2022-11-15 Thread Andres Freund
Hi, Hm, the quoting was odd, making me think you had written a separate email about the define issue. Hence the separate email... On 2022-11-15 15:35:31 +0100, Juan José Santamaría Flecha wrote: > On Tue, Nov 15, 2022 at 1:49 AM Andres Freund wrote: > > Hm. Is it right that the changes are only

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-11-15 Thread Robert Haas
On Fri, Nov 4, 2022 at 4:27 AM Drouvot, Bertrand wrote: > Please find attached a rebase in v7. I don't think it's a good thing that this patch is using the progress-reporting machinery. The point of that machinery is that we want any backend to be able to report progress for any command it happen

Re: Moving forward with TDE

2022-11-15 Thread Jacob Champion
On Tue, Nov 15, 2022 at 11:39 AM David Christensen wrote: > Good to know about the next steps, thanks. You're welcome! > This was just a refresh of the old patches on the wiki to work as written on > HEAD. If there are known TODOs here this then that work is still needing to > be done. > > I w

Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)

2022-11-15 Thread Andres Freund
Hi, On 2022-11-04 09:25:52 +0100, Drouvot, Bertrand wrote: > > @@ -7023,29 +7048,63 @@ static void > CheckPointGuts(XLogRecPtr checkPointRedo, int flags) > { > CheckPointRelationMap(); > + > + pgstat_progress_update_param(PROGRESS_CHECKPOINT_PHASE, > +

Re: HOT chain validation in verify_heapam()

2022-11-15 Thread Robert Haas
On Tue, Nov 15, 2022 at 2:50 PM Andres Freund wrote: > On 2022-11-15 11:36:21 -0500, Robert Haas wrote: > > On Mon, Nov 14, 2022 at 5:02 PM Andres Freund wrote: > > > It seems like we should do a bit more validation within a chain of > > > tuples. E.g. that no live tuple can follow an !DidCommit

Re: Standardizing how pg_waldump presents recovery conflict XID cutoffs

2022-11-15 Thread Andres Freund
Hi, I like the idea of this, but: On 2022-11-15 10:24:05 -0800, Peter Geoghegan wrote: > I'm not necessarily that attached to the name latestCommittedXid. It > is more accurate, but it's also a little bit too similar to another > common XID symbol name, latestCompletedXid. Can anyone suggest an >

Re: meson oddities

2022-11-15 Thread Andrew Dunstan
On 2022-11-15 Tu 14:04, Andres Freund wrote: >> But ISTM we shouldn't be presuming what packagers will do, and that >> there is some virtue in having a default layout under ${prefix} that is >> consistent across platforms, as is now the case with autoconf/configure. > I don't think it's a virtue

Re: ssl tests aren't concurrency safe due to get_free_port()

2022-11-15 Thread Andrew Dunstan
On 2022-11-06 Su 11:30, Andrew Dunstan wrote: > > One possible addition would be to add removing the reservation files in > an END handler. That would be pretty simple. > > Here's a version with that. I suggest we try it out and see if anything breaks. cheers andrew -- Andrew Dunstan EDB: h

Re: archive modules

2022-11-15 Thread Nathan Bossart
On Tue, Nov 15, 2022 at 06:14:25PM +0100, Alvaro Herrera wrote: > On 2022-Nov-15, Nathan Bossart wrote: > >> On Tue, Nov 15, 2022 at 10:31:44AM +0100, Peter Eisentraut wrote: > >> > The surrounding code has changed a bit between PG15 and master, so if we >> > wanted to backpatch this, we'd need a

Re: SUBTRANS: Minimizing calls to SubTransSetParent()

2022-11-15 Thread Tom Lane
Simon Riggs writes: > New version attached. I looked at this patch and I do not see how it can possibly be safe. The most direct counterexample arises from the fact that HeapCheckForSerializableConflictOut checks SubTransGetTopmostTransaction in some cases. You haven't tried to analyze when, bu

Re: Speed up transaction completion faster after many relations are accessed in a transaction

2022-11-15 Thread David Rowley
Thank you for looking at the patch. On Fri, 4 Nov 2022 at 04:43, Ankit Kumar Pandey wrote: > I don't see any performance improvement in tests. Are you able to share what your test was? In order to see a performance improvement you're likely going to have to obtain a large number of locks in the

Re: meson oddities

2022-11-15 Thread Tom Lane
Andrew Dunstan writes: > On 2022-11-15 Tu 14:04, Andres Freund wrote: >> I don't think it's a virtue to break the layout of the platform by >> e.g. installing 64bit libs into the directory containing 32bit libs. > You might end up surprising people who have installed from source for > years and w

Re: allowing for control over SET ROLE

2022-11-15 Thread Nathan Bossart
On Tue, Nov 15, 2022 at 12:07:06PM -0500, Robert Haas wrote: > If anyone else wants to comment, or if either of those people want to > comment further, please speak up soon. Otherwise, I am going to press > forward with committing this. I don't think I have any further thoughts about the approach,

Re: archive modules

2022-11-15 Thread Michael Paquier
On Tue, Nov 15, 2022 at 12:57:49PM -0800, Nathan Bossart wrote: > On Tue, Nov 15, 2022 at 06:14:25PM +0100, Alvaro Herrera wrote: >> Hmm, really? It seems to me that we will have two slightly different >> behaviors in 15 and master, which may be confusing later on. I think >> it'd be better to ma

Re: Standardizing how pg_waldump presents recovery conflict XID cutoffs

2022-11-15 Thread Peter Geoghegan
On Tue, Nov 15, 2022 at 12:29 PM Andres Freund wrote: > ... I strongly dislike latestCommittedXid. That seems at least as misleading > as latestRemovedXid and has the danger of confusion with latestCompletedXid > as you mention. > How about latestAffectedXid? I get why you don't care for latestC

Re: Avoid overhead open-close indexes (catalog updates)

2022-11-15 Thread Michael Paquier
On Tue, Nov 15, 2022 at 11:42:34AM -0300, Ranier Vilela wrote: > I find it very difficult not to have some tuple to be updated, > once inside CopyStatistics and the branch cost can get in the way, > but I don't object with your solution. The code assumes that it is a possibility. > Missed AddRole

Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment

2022-11-15 Thread Greg Stark
So I think it's kind of cute that you've implemented these as agnostic wrappers that work with any allocator ... but why? I would have expected the functionality to just be added directly to the allocator to explicitly request whole aligned pages which IIRC it's already capable of doing but just d

Re: closing file in adjust_data_dir

2022-11-15 Thread Ted Yu
On Tue, Nov 15, 2022 at 10:43 AM Ted Yu wrote: > Hi, > I was looking at the commit: > > commit 2fe3bdbd691a5d11626308e7d660440be6c210c8 > Author: Peter Eisentraut > Date: Tue Nov 15 15:35:37 2022 +0100 > > Check return value of pclose() correctly > > In src/bin/pg_ctl/pg_ctl.c : > > if

Re: Slow standby snapshot

2022-11-15 Thread Tom Lane
Simon Riggs writes: > I've cleaned up the comments and used a #define for the constant. > IMHO this is ready for commit. I will add it to the next CF. I looked at this a little. It's a simple enough patch, and if it solves the problem then I sure like it better than the previous ideas in this th

Re: SUBTRANS: Minimizing calls to SubTransSetParent()

2022-11-15 Thread Simon Riggs
On Tue, 15 Nov 2022 at 21:03, Tom Lane wrote: > > Simon Riggs writes: > > New version attached. > > I looked at this patch and I do not see how it can possibly be safe. I grant you it is complex, so please bear with me. > The most direct counterexample arises from the fact that > HeapCheckForS

Re: Slow standby snapshot

2022-11-15 Thread Tom Lane
BTW, while nosing around this code I came across this statement (procarray.c, about line 4550 in HEAD): * ... To add XIDs to the array, we just insert * them into slots to the right of the head pointer and then advance the head * pointer. This wouldn't require any lock at all, except that on m

Meson add host_system to PG_VERSION_STR

2022-11-15 Thread Juan José Santamaría Flecha
Hello all, As mentioned here [1] it might be interesting to complete the returned information by version() when compiled with meson by including the host_system. [1] https://www.postgresql.org/message-id/20221115195318.5v5ynapmkusgyzks%40awork3.anarazel.de Regards, Juan José Santamaría Flecha

Re: Add palloc_aligned() to allow arbitrary power of 2 memory alignment

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 16:58:10 -0500, Greg Stark wrote: > So I think it's kind of cute that you've implemented these as agnostic > wrappers that work with any allocator ... but why? > > I would have expected the functionality to just be added directly to > the allocator to explicitly request whole al

Re: Slow standby snapshot

2022-11-15 Thread Simon Riggs
On Tue, 15 Nov 2022 at 23:06, Tom Lane wrote: > > BTW, while nosing around this code I came across this statement > (procarray.c, about line 4550 in HEAD): > > * ... To add XIDs to the array, we just insert > * them into slots to the right of the head pointer and then advance the head > * point

Bug in row_number() optimization

2022-11-15 Thread Sergey Shinderuk
Hello, We've accidentally found a subtle bug introduced by commit 9d9c02ccd1aea8e9131d8f4edb21bf1687e40782 Author: David Rowley Date: Fri Apr 8 10:34:36 2022 +1200 Teach planner and executor about monotonic window funcs On a 32-bit system Valgrind reports use-after-free when running the

Re: meson oddities

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 16:08:35 -0500, Tom Lane wrote: > Andrew Dunstan writes: > > On 2022-11-15 Tu 14:04, Andres Freund wrote: > >> I don't think it's a virtue to break the layout of the platform by > >> e.g. installing 64bit libs into the directory containing 32bit libs. > > > You might end up surp

Re: Meson add host_system to PG_VERSION_STR

2022-11-15 Thread Michael Paquier
On Wed, Nov 16, 2022 at 12:08:56AM +0100, Juan José Santamaría Flecha wrote: > As mentioned here [1] it might be interesting to complete the returned > information by version() when compiled with meson by including the > host_system. The meson build provides extra_version, which would be able to d

Re: Meson doesn't define HAVE_LOCALE_T for mscv

2022-11-15 Thread Juan José Santamaría Flecha
On Tue, Nov 15, 2022 at 8:53 PM Andres Freund wrote: > > I don't think we should print mingw - that's really just redundant with > gcc. But including host_system seems like a good idea. Not sure why I > didn't > do that. > > I'll open a new thread for this. Also, I think this is skipping collate.

Re: Slow standby snapshot

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 23:14:42 +, Simon Riggs wrote: > * COMMITs: xids are removed from the array by performing a binary > search - this gets more and more expensive as the array gets wider > * SNAPSHOTs: scanning the array for snapshots becomes more expensive > as the array gets wider > > Hence m

Re: SUBTRANS: Minimizing calls to SubTransSetParent()

2022-11-15 Thread Tom Lane
Simon Riggs writes: > On Tue, 15 Nov 2022 at 21:03, Tom Lane wrote: >> The subxidStatus.overflowed check quoted above has a similar sort >> of myopia: it's checking whether our current transaction has >> already suboverflowed. But (a) that doesn't prove it won't suboverflow >> later, and (b) the

Re: Meson doesn't define HAVE_LOCALE_T for mscv

2022-11-15 Thread Juan José Santamaría Flecha
On Tue, Nov 15, 2022 at 9:02 PM Andres Freund wrote: > > On 2022-11-15 15:35:31 +0100, Juan José Santamaría Flecha wrote: > > On Tue, Nov 15, 2022 at 1:49 AM Andres Freund > wrote: > > > Hm. Is it right that the changes are only done for msvc? win32_port.h > > > defines the types for mingw as we

Re: Slow standby snapshot

2022-11-15 Thread Tom Lane
Andres Freund writes: > On 2022-11-15 23:14:42 +, Simon Riggs wrote: >> Hence more frequent compression is effective at reducing the overhead. >> But too frequent compression slows down the startup process, which >> can't then keep up. >> So we're just looking for an optimal frequency of compr

Re: Unit tests for SLRU

2022-11-15 Thread Michael Paquier
On Tue, Nov 15, 2022 at 11:39:20AM +0100, Daniel Gustafsson wrote: > + /* write given data to the page */ > + strncpy(TestSlruCtl->shared->page_buffer[slotno], data, BLCKSZ - 1); > > Would it make sense to instead use pg_pwrite to closer match the code being > tested? Hmm. I am not exact

Re: allowing for control over SET ROLE

2022-11-15 Thread Jeff Davis
On Tue, 2022-11-15 at 12:07 -0500, Robert Haas wrote: > If anyone else wants to comment, or if either of those people want to > comment further, please speak up soon. Did you have some thoughts on: https://postgr.es/m/a41d606d03b629c2ef0ed274ae3b04a2c266.ca...@j-davis.com Regards, Je

Re: Add test module for Custom WAL Resource Manager feature

2022-11-15 Thread Jeff Davis
On Mon, 2022-11-14 at 09:34 +0530, Bharath Rupireddy wrote: > Thanks. I would like to keep it simple. > > I've added some more comments and attached v2 patch herewith. Please > review. Committed with some significant revisions (ae168c794f): * changed to insert a deterministic message, rather t

Re: Slow standby snapshot

2022-11-15 Thread Tom Lane
Simon Riggs writes: > but that is not related to the main issues: > * COMMITs: xids are removed from the array by performing a binary > search - this gets more and more expensive as the array gets wider > * SNAPSHOTs: scanning the array for snapshots becomes more expensive > as the array gets wid

Re: Slow standby snapshot

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 23:14:42 +, Simon Riggs wrote: > On Tue, 15 Nov 2022 at 23:06, Tom Lane wrote: > > > > BTW, while nosing around this code I came across this statement > > (procarray.c, about line 4550 in HEAD): > > > > * ... To add XIDs to the array, we just insert > > * them into slots t

Re: Slow standby snapshot

2022-11-15 Thread Andres Freund
Hi, On 2022-11-15 19:15:15 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-11-15 23:14:42 +, Simon Riggs wrote: > >> Hence more frequent compression is effective at reducing the overhead. > >> But too frequent compression slows down the startup process, which > >> can't then keep u

Re: Slow standby snapshot

2022-11-15 Thread Tom Lane
Andres Freund writes: > To me it sounds like known_assigned_xids_lck is pointless and the talk about > memory barriers a red herring, since all modifications have to happen with > ProcArrayLock held exlusively and all reads with ProcArrayLock held in share > mode. It can't be legal to modify head/

  1   2   >