Re: Row pattern recognition

2023-09-01 Thread Tatsuo Ishii
Attached is the v5 patch. Differences from previous patch include: * Resolve complaint from "PostgreSQL Patch Tester" https://commitfest.postgresql.org/44/4460/ - Change gram.y to use PATTERN_P instead of PATTERN. Using PATTERN seems to make trouble with Visual Studio build. : : [10:07:57.85

Impact of checkpointer during pg_upgrade

2023-09-01 Thread Amit Kapila
During pg_upgrade, we start the server for the old cluster which can allow the checkpointer to remove the WAL files. It has been noticed that we do generate certain types of WAL records (e.g XLOG_RUNNING_XACTS, XLOG_CHECKPOINT_ONLINE, and XLOG_FPI_FOR_HINT) even during pg_upgrade for old cluster, s

Re: Extract numeric filed in JSONB more effectively

2023-09-01 Thread jian he
I think the last patch failed. I am not 100% sure. https://cirrus-ci.com/task/5464366154252288 says "Created 21 hours ago", I assume the latest patch. the diff in Artifacts section. you can go to testrun/build/testrun/regress/regress/regression.diffs diff -U3 /tmp/cirrus-ci-build/src/test/regress

Re: Eager page freeze criteria clarification

2023-09-01 Thread Peter Geoghegan
On Fri, Sep 1, 2023 at 12:34 PM Robert Haas wrote: > If the table > is being vacuumed frequently, then the last-vacuum-LSN will be newer, > which means we'll freeze *more* aggressively. Sort of like how if you set autovacuum_vacuum_scale_factor low enough, with standard pgbench, with heap fill fa

Re: Why doesn't Vacuum FULL update the VM

2023-09-01 Thread Peter Geoghegan
On Fri, Sep 1, 2023 at 12:34 PM Melanie Plageman wrote: > I don't see why the visibility map shouldn't be updated so that all of > the pages show all visible and all frozen for this relation after the > vacuum full. There was a similar issue with COPY FREEZE. It was fixed relatively recently -- s

Re: SQL:2011 application time

2023-09-01 Thread Vik Fearing
On 9/1/23 21:56, Paul Jungwirth wrote: On 9/1/23 03:50, Vik Fearing wrote: On 9/1/23 11:30, Peter Eisentraut wrote: 1) If I write UNIQUE (a, b, c WITHOUT OVERLAPS), does the WITHOUT OVERLAPS clause attach to the last column, or to the whole column list? In the SQL standard, you can only have o

Re: Why doesn't Vacuum FULL update the VM

2023-09-01 Thread Vik Fearing
On 9/1/23 21:34, Melanie Plageman wrote: Hi, I noticed that VACUUM FULL actually does freeze the tuples in the rewritten table (heap_freeze_tuple()) but then it doesn't mark them all visible or all frozen in the visibility map. I don't understand why. It seems like it would save us future work.

Re: sandboxing untrusted code

2023-09-01 Thread Jeff Davis
On Fri, 2023-09-01 at 09:12 -0400, Robert Haas wrote: > Close but not quite. As you say, #2 does exercise privileges. Also, > even if no privileges are exercised, you could still refer to > CURRENT_ROLE, and I think you could also call a function like > has_table_privilege.  Your identity hasn't ch

Re: Inefficiency in parallel pg_restore with many tables

2023-09-01 Thread Nathan Bossart
On Fri, Sep 01, 2023 at 04:00:44PM -0400, Robert Haas wrote: > In hindsight, I think that making binaryheap depend on Datum was a bad > idea. I think that was my idea, and I think it wasn't very smart. > Considering that people have coded to that decision up until now, it > might not be too easy to

Re: Transaction timeout

2023-09-01 Thread Peter Eisentraut
On 12.01.23 20:46, Andrey Borodin wrote: On Sun, Dec 18, 2022 at 12:53:31PM -0800, Andrey Borodin wrote: I've rewritten this part to correctly report all timeouts that did happen. However there's now a tricky comma-formatting code which was tested only manually. I suspect this will make transla

Re: lockup in parallel hash join on dikkop (freebsd 14.0-current)

2023-09-01 Thread Robert Haas
On Fri, Sep 1, 2023 at 6:13 AM Alexander Lakhin wrote: > (Placing "pg_compiler_barrier();" just after "waiting = true;" fixed the > issue for us.) Maybe it'd be worth trying something stronger, like pg_memory_barrier(). A compiler barrier doesn't prevent the CPU from reordering loads and stores a

Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)

2023-09-01 Thread Robert Haas
On Fri, Sep 1, 2023 at 11:47 AM Ranier Vilela wrote: > If a null locale is reached in these paths. > elog will dereference a null pointer. True. That's sloppy coding. I don't know enough about this code to be sure whether the error messages that you propose are for the best. -- Robert Haas EDB

Re: [17] CREATE SUBSCRIPTION ... SERVER

2023-09-01 Thread Robert Haas
On Fri, Sep 1, 2023 at 4:04 PM Jeff Davis wrote: > On Thu, 2023-08-31 at 17:17 -0400, Joe Conway wrote: > > Maybe move postgres_fdw to be a first class built in feature instead > > of > > an extension? > > That could make sense, but we still have to solve the problem of how to > present a built-in

Re: Inefficiency in parallel pg_restore with many tables

2023-09-01 Thread Robert Haas
On Tue, Jul 25, 2023 at 2:53 PM Nathan Bossart wrote: > On Mon, Jul 24, 2023 at 12:00:15PM -0700, Nathan Bossart wrote: > > Here is a sketch of this approach. It required fewer #ifdefs than I was > > expecting. At the moment, this one seems like the winner to me. > > Here is a polished patch set

Re: SQL:2011 application time

2023-09-01 Thread Paul Jungwirth
On 9/1/23 03:50, Vik Fearing wrote: On 9/1/23 11:30, Peter Eisentraut wrote: 1) If I write UNIQUE (a, b, c WITHOUT OVERLAPS), does the WITHOUT OVERLAPS clause attach to the last column, or to the whole column list? In the SQL standard, you can only have one period and it has to be listed last,

Re: Replace known_assigned_xids_lck by memory barrier

2023-09-01 Thread Robert Haas
On Fri, Sep 1, 2023 at 3:41 PM Nathan Bossart wrote: > On Wed, Aug 16, 2023 at 01:07:15PM -0700, Nathan Bossart wrote: > > Ah, that explains it. v5 of the patch is attached. > > Barring additional feedback, I plan to commit this patch in the current > commitfest. I'm not an expert on this code b

Re: Add 'worker_type' to pg_stat_subscription

2023-09-01 Thread Nathan Bossart
On Wed, Aug 16, 2023 at 07:14:18PM +1000, Peter Smith wrote: > Earlier this year I proposed a small change for the pg_stat_subscription view: > > -- > ...it would be very useful to have an additional "kind" attribute for > this view. This will save the user from needing to do mental > gymnasti

Why doesn't Vacuum FULL update the VM

2023-09-01 Thread Melanie Plageman
Hi, I noticed that VACUUM FULL actually does freeze the tuples in the rewritten table (heap_freeze_tuple()) but then it doesn't mark them all visible or all frozen in the visibility map. I don't understand why. It seems like it would save us future work. Here is an example: create extension pg_v

Re: Eager page freeze criteria clarification

2023-09-01 Thread Robert Haas
On Tue, Aug 29, 2023 at 10:22 AM Robert Haas wrote: > Let's assume for a moment that the rate at which the insert LSN is > advancing is roughly constant over time, so that it serves as a good > proxy for wall-clock time. Consider four tables A, B, C, and D that > are, respectively, vacuumed once p

Speaker Bureau

2023-09-01 Thread Dave Cramer
Greetings, If you are on the speaker list can you send an email to ugc...@postgresql.us indicating whether you are available to travel for meetups? This serves the obvious purpose but also provides your email address to us. Thanks, Dave Cramer

Re: lockup in parallel hash join on dikkop (freebsd 14.0-current)

2023-09-01 Thread Alexander Lakhin
Hello Tomas, 01.09.2023 16:00, Tomas Vondra wrote: Hmmm, I'm not very good at reading the binary code, but here's what objdump produced for WaitEventSetWait. Maybe someone will see what the issue is. At first glance, I can't see anything suspicious in the disassembly. IIUC, waiting = true pres

Re: [17] CREATE SUBSCRIPTION ... SERVER

2023-09-01 Thread Jeff Davis
On Thu, 2023-08-31 at 17:17 -0400, Joe Conway wrote: > Maybe move postgres_fdw to be a first class built in feature instead > of > an extension? That could make sense, but we still have to solve the problem of how to present a built-in FDW. FDWs don't have a schema, so it can't be inside pg_cata

Re: [17] CREATE SUBSCRIPTION ... SERVER

2023-09-01 Thread Jeff Davis
On Fri, 2023-09-01 at 12:28 +0530, Ashutosh Bapat wrote: > Thinking larger, how about we allow any FDW to be used here. That's a possibility, but I think that means the subscription would need to constantly re-check the parameters rather than relying on the FDW's validator. Otherwise it might be

Re: Replace known_assigned_xids_lck by memory barrier

2023-09-01 Thread Nathan Bossart
On Wed, Aug 16, 2023 at 01:07:15PM -0700, Nathan Bossart wrote: > Ah, that explains it. v5 of the patch is attached. Barring additional feedback, I plan to commit this patch in the current commitfest. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: should frontend tools use syncfs() ?

2023-09-01 Thread Nathan Bossart
On Fri, Sep 01, 2023 at 01:19:13PM -0500, Justin Pryzby wrote: > What about (per git grep no-sync doc) pg_receivewal? I don't think it's applicable there, either. IIUC that option specifies whether to sync the data as it is streamed over. -- Nathan Bossart Amazon Web Services: https://aws.amazo

Re: should frontend tools use syncfs() ?

2023-09-01 Thread Justin Pryzby
On Fri, Sep 01, 2023 at 11:08:51AM -0700, Nathan Bossart wrote: > > This should probably give a distinct error when syncfs is not supported > > than when it's truely recognized. > > Later versions of the patch should have this. Oops, right. > > The patch should handle pg_dumpall, too. > > It lo

Re: should frontend tools use syncfs() ?

2023-09-01 Thread Nathan Bossart
Thanks for taking a look. On Fri, Sep 01, 2023 at 12:58:10PM -0500, Justin Pryzby wrote: >> +if (!user_opts.sync_method) >> +user_opts.sync_method = pg_strdup("fsync"); > > why pstrdup? I believe I was just following the precedent set by some of the other options. >> +parse_sync

Re: should frontend tools use syncfs() ?

2023-09-01 Thread Justin Pryzby
> + if (!user_opts.sync_method) > + user_opts.sync_method = pg_strdup("fsync"); why pstrdup? > +parse_sync_method(const char *optarg, SyncMethod *sync_method) > +{ > + if (strcmp(optarg, "fsync") == 0) > + *sync_method = SYNC_METHOD_FSYNC; > +#ifdef HAVE_SYNCFS > +

Re: cataloguing NOT NULL constraints

2023-09-01 Thread Alvaro Herrera
On 2023-Aug-31, Alvaro Herrera wrote: > Hmm, that's some weird code I left there all right. Can you please try > this patch? (Not final; I'll review it more completely later, > particularly to add this test case.) The change in MergeAttributesIntoExisting turned out to be close but not quite th

Re: Adding a pg_get_owned_sequence function?

2023-09-01 Thread Nathan Bossart
On Fri, Sep 01, 2023 at 01:31:43PM -0400, Tom Lane wrote: > Nathan Bossart writes: >> I wonder if it'd be possible to just remove pg_get_serial_sequence(). > > A quick search at http://codesearch.debian.net/ finds uses of it > in packages like gdal, qgis, rails, ... We could maybe get rid of > i

Re: GenBKI emits useless open;close for catalogs without rows

2023-09-01 Thread Tom Lane
Alvaro Herrera writes: > On 2023-Sep-01, Matthias van de Meent wrote: >> A potential addition to the patch would to stop manually closing >> relations: initdb and check-world succeed without manual 'close' >> operations because the 'open' command auto-closes the previous open >> relation (in boot_

Re: Inefficiency in parallel pg_restore with many tables

2023-09-01 Thread Nathan Bossart
On Fri, Sep 01, 2023 at 01:41:41PM -0400, Tom Lane wrote: > I've not actually looked at any of these patchsets after the first one. > I have added myself as a reviewer and will hopefully get to it within > a week or so. Thanks! -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: GenBKI emits useless open;close for catalogs without rows

2023-09-01 Thread Matthias van de Meent
On Fri, 1 Sept 2023 at 19:43, Alvaro Herrera wrote: > > On 2023-Sep-01, Matthias van de Meent wrote: > > > A potential addition to the patch would to stop manually closing > > relations: initdb and check-world succeed without manual 'close' > > operations because the 'open' command auto-closes the

Re: GenBKI emits useless open;close for catalogs without rows

2023-09-01 Thread Alvaro Herrera
On 2023-Sep-01, Matthias van de Meent wrote: > A potential addition to the patch would to stop manually closing > relations: initdb and check-world succeed without manual 'close' > operations because the 'open' command auto-closes the previous open > relation (in boot_openrel). Testing also sugges

Re: Inefficiency in parallel pg_restore with many tables

2023-09-01 Thread Tom Lane
Nathan Bossart writes: > I'm hoping to commit these patches at some point in the current commitfest. > I don't sense anything tremendously controversial, and they provide a > pretty nice speedup in some cases. Are there any remaining concerns? I've not actually looked at any of these patchsets a

Re: Adding a pg_get_owned_sequence function?

2023-09-01 Thread Tom Lane
Nathan Bossart writes: > I wonder if it'd be possible to just remove pg_get_serial_sequence(). A quick search at http://codesearch.debian.net/ finds uses of it in packages like gdal, qgis, rails, ... We could maybe get rid of it after a suitable deprecation period, but I think we can't just summ

GenBKI emits useless open;close for catalogs without rows

2023-09-01 Thread Matthias van de Meent
Hi, Whilst looking at PostgreSQL's bootstrapping process, I noticed that postgres.bki contains quite a few occurrances of the pattern "open $catname; close $catname". I suppose this pattern isn't too expensive, but according to my limited research a combined open+close cycle doens't do anything me

Re: Inefficiency in parallel pg_restore with many tables

2023-09-01 Thread Nathan Bossart
On Tue, Jul 25, 2023 at 11:53:36AM -0700, Nathan Bossart wrote: > Here is a polished patch set for this approach. I've also added a 0004 > that replaces the open-coded heap in pg_dump_sort.c with a binaryheap. > IMHO these patches are in decent shape. I'm hoping to commit these patches at some po

Re: Adding a pg_get_owned_sequence function?

2023-09-01 Thread Nathan Bossart
On Fri, Jun 09, 2023 at 08:19:44PM +0100, Dagfinn Ilmari Mannsåker wrote: > I've always been annoyed by the fact that pg_get_serial_sequence takes > the table and returns the sequence as strings rather than regclass. And > since identity columns were added, the name is misleading as well (which > i

Is there a complete doc to describe pg's traction implementation in detail?

2023-09-01 Thread jacktby jacktby

Casual Meson fixups

2023-09-01 Thread Tristan Partin
The first two patches in the series are re-proposals that had previously been approved[0] by Andres, but fell through the cracks. The only patch that _could_ be controversial is probably the last one, but from my understanding it would match up with the autotools build. One thing that I did n

Re: PATCH: Add REINDEX tag to event triggers

2023-09-01 Thread jian he
On Fri, Sep 1, 2023 at 6:40 PM Jim Jones wrote: > > On 01.09.23 11:23, jian he wrote: > > because the change made in here: > > https://git.postgresql.org/cgit/postgresql.git/diff/src/backend/commands/indexcmds.c?id=11af63fb48d278b86aa948a5b57f136ef03c2bb7 > > > > I manually slight edited the patch

Add const qualifiers

2023-09-01 Thread David Steele
Hackers, I noticed that there was a mismatch between the const qualifiers for excludeDirContents in src/backend/backup/backup/basebackup.c and src/bin/pg_rewind/file_map.c and that led me to use ^static const.*\*.*= to do a quick search for similar cases. I think at the least we should make

Re: Initdb-time block size specification

2023-09-01 Thread Robert Haas
On Thu, Aug 31, 2023 at 2:32 PM David Christensen wrote: > Here's a patch atop the series which converts to 16-bit uints and > passes regressions, but I don't consider well-vetted at this point. For what it's worth, my gut reaction to this patch series is similar to that of Andres: I think it wil

Re: Buildfarm failures on urocryon

2023-09-01 Thread Mark Wong
Hi, On Fri, Sep 01, 2023 at 11:27:47AM +0530, vignesh C wrote: > Hi, > > Recently urocryon has been failing with the following errors at [1]: > checking for icu-uc icu-i18n... no > configure: error: ICU library not found > If you have ICU already installed, see config.log for details on the > fai

Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)

2023-09-01 Thread Ranier Vilela
Hi, If a null locale is reached in these paths. elog will dereference a null pointer. best regards, Ranier Vilela 0001-Avoid-a-possible-dereference-a-null-pointer.patch Description: Binary data

Re: trying again to get incremental backup

2023-09-01 Thread Robert Haas
Hey, thanks for the reply. On Thu, Aug 31, 2023 at 6:50 PM David Steele wrote: > pg_subtrans, at least, can be ignored since it is excluded from the > backup and not required for recovery. I agree... > Welcome to the club! Thanks for the welcome, but being a member feels *terrible*. :-) > I d

Re: Should we use MemSet or {0} for struct initialization?

2023-09-01 Thread Jelte Fennema
On Fri, 1 Sept 2023 at 15:25, John Naylor wrote: > On Fri, Sep 1, 2023 at 7:48 PM Jelte Fennema wrote: > > The C standard says: > > > When a value is stored in an object of structure or union type, including in a member object, the bytes of the object representation that correspond to any padding

Re: Should we use MemSet or {0} for struct initialization?

2023-09-01 Thread Chapman Flack
On 2023-09-01 09:25, John Naylor wrote: On Fri, Sep 1, 2023 at 7:48 PM Jelte Fennema wrote: The C standard says: > When a value is stored in an object of structure or union type, > including in a member object, the bytes of the object representation that > correspond to any padding bytes take u

Re: Should we use MemSet or {0} for struct initialization?

2023-09-01 Thread John Naylor
On Fri, Sep 1, 2023 at 7:48 PM Jelte Fennema wrote: > The C standard says: > > When a value is stored in an object of structure or union type, including in a member object, the bytes of the object representation that correspond to any padding bytes take unspecified values. > > So if you set any o

Re: Fix a typo in decode.c

2023-09-01 Thread Amit Kapila
On Fri, Sep 1, 2023 at 5:09 PM Zhijie Hou (Fujitsu) wrote: > > When reading the code, I noticed a typo in the description of WAL record. > > /* > - * Decode XLOG_HEAP2_MULTI_INSERT_insert record into multiple tuplebufs. > + * Decode XLOG_HEAP2_MULTI_INSERT record into multiple tuplebufs. > * > >

Re: sandboxing untrusted code

2023-09-01 Thread Robert Haas
On Thu, Aug 31, 2023 at 8:57 PM Jeff Davis wrote: > > As a refresher, the scenario I'm talking about is any one in which > > one > > user, who I'll call Bob, does something that results in executing > > code > > provided by another user, who I'll call Alice. The most obvious way > > that this can

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-01 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thank you for reviewing! New patch can be available in [1]. > + /* > + * Note: This must be done after doing the pg_resetwal command because > + * pg_resetwal would remove required WALs. > + */ > + if (count_old_cluster_logical_slots()) > + { > + start_postmaster(&new_cluster, true); >

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-01 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thanks for reviewing! New patch can be available in [1]. > > == > src/bin/pg_upgrade/check.c > > 1. check_old_cluster_for_valid_slots > > + /* Quick exit if the cluster does not have logical slots. */ > + if (count_old_cluster_logical_slots() == 0) > + return; > > /Quick exit

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-01 Thread Hayato Kuroda (Fujitsu)
Dear Dilip, Thank you for reviewing! > > 1. > + conn = connectToServer(&new_cluster, "template1"); > + > + prep_status("Checking for logical replication slots"); > + > + res = executeQueryOrDie(conn, "SELECT slot_name " > + "FROM pg_catalog.pg_replication_slots " > + "WHERE slot_type = 'logical

Re: lockup in parallel hash join on dikkop (freebsd 14.0-current)

2023-09-01 Thread Tomas Vondra
On 9/1/23 10:00, Alexander Lakhin wrote: > Hello Thomas, > > 31.08.2023 14:15, Thomas Munro wrote: > >> We have a signal that is pending and not blocked, so I don't >> immediately know why poll() hasn't returned control. > > When I worked at the Postgres Pro company, we observed a similar lock

Re: Move bki file pre-processing from initdb to bootstrap

2023-09-01 Thread Peter Eisentraut
On 01.09.23 14:37, Tom Lane wrote: Krishnakumar R writes: This patch moves the pre-processing for tokens in the bki file from initdb to bootstrap. With these changes the bki file will only be opened once in bootstrap and parsing will be done by the bootstrap parser. You haven't provided any i

Re: Commitfest 2023-09 starts soon

2023-09-01 Thread Peter Eisentraut
Okay, here we go, starting with: Status summary: Needs review: 227. Waiting on Author: 37. Ready for Committer: 30. Committed: 40. Rejected: 1. Returned with Feedback: 1. Withdrawn: 1. Total: 337. (which is less than CF 2023-07) I have also already applied one round of the waiting-on-author-

Re: Unlogged relations and WAL-logging

2023-09-01 Thread Peter Eisentraut
Is the patch 0003-Remove-unnecessary-smgrimmedsync-when-creating-unlog.patch still relevant, or can this commitfest entry be closed? On 23.08.23 16:40, Heikki Linnakangas wrote: 5. In heapam_relation_set_new_filenode(), we do this:     /* * If required, set up an init fork for

Re: Should we use MemSet or {0} for struct initialization?

2023-09-01 Thread Jelte Fennema
On Thu, 31 Aug 2023 at 13:35, Junwang Zhao wrote: > > > If the struct has padding or aligned, {0} only guarantee the struct > > > members initialized to 0, while memset sets the alignment/padding > > > to 0 as well, but since we will not access the alignment/padding, so > > > they give the same ef

Re: Move bki file pre-processing from initdb to bootstrap

2023-09-01 Thread Tom Lane
Krishnakumar R writes: > This patch moves the pre-processing for tokens in the bki file from > initdb to bootstrap. With these changes the bki file will only be > opened once in bootstrap and parsing will be done by the bootstrap > parser. You haven't provided any iota of evidence why this would

Re: Assert failure in ATPrepAddPrimaryKey

2023-09-01 Thread Alvaro Herrera
On 2023-Sep-01, Richard Guo wrote: > I ran into an Assert failure in ATPrepAddPrimaryKey() with the query > below: > > CREATE TABLE t0(c0 boolean); > CREATE TABLE t1() INHERITS(t0); > > # ALTER TABLE t0 ADD CONSTRAINT m EXCLUDE ((1) WITH =); > server closed the connection unexpectedly Ugh, righ

Re: generate syscache info automatically

2023-09-01 Thread John Naylor
On Thu, Aug 31, 2023 at 6:23 PM Peter Eisentraut wrote: > Attached is an updated patch set. > > One win here is that the ObjectProperty lookup now uses a hash function > instead of a linear search. So hopefully the performance is better (to > be confirmed) and it could now be used for things lik

Re: Show inline comments from pg_hba lines in the pg_hba_file_rules view

2023-09-01 Thread Jim Jones
On 01.09.23 12:44, Michael Paquier wrote: I am not sure what you have in mind, but IMO any solution would live better as long as a solution is: - not linked to hba.c, handled in a separate code path. - linked to all configuration files where comments are supported, if need be. If I understood y

Re: SQL:2011 application time

2023-09-01 Thread Vik Fearing
On 9/1/23 11:30, Peter Eisentraut wrote: 1) If I write UNIQUE (a, b, c WITHOUT OVERLAPS), does the WITHOUT OVERLAPS clause attach to the last column, or to the whole column list? In the SQL standard, you can only have one period and it has to be listed last, so this question does not arise.  Bu

Re: Show inline comments from pg_hba lines in the pg_hba_file_rules view

2023-09-01 Thread Michael Paquier
On Fri, Sep 01, 2023 at 11:32:35AM +0200, Jim Jones wrote: > Would you be in favor of parsing #comments instead? Given that # is > currently already being parsed (ignored), it shouldn't add too much > complexity to the code. I am not sure what you have in mind, but IMO any solution would live bett

Re: PATCH: Add REINDEX tag to event triggers

2023-09-01 Thread Jim Jones
On 01.09.23 11:23, jian he wrote: because the change made in here: https://git.postgresql.org/cgit/postgresql.git/diff/src/backend/commands/indexcmds.c?id=11af63fb48d278b86aa948a5b57f136ef03c2bb7 I manually slight edited the patch content: from static List *ChooseIndexColumnNames(List *indexEl

Fix a typo in decode.c

2023-09-01 Thread Zhijie Hou (Fujitsu)
Hi, When reading the code, I noticed a typo in the description of WAL record. /* - * Decode XLOG_HEAP2_MULTI_INSERT_insert record into multiple tuplebufs. + * Decode XLOG_HEAP2_MULTI_INSERT record into multiple tuplebufs. * And attach a small patch to fix it. Best Regards, Hou Zhijie 0001-

Re: Show inline comments from pg_hba lines in the pg_hba_file_rules view

2023-09-01 Thread Jim Jones
Hi Michael On 01.09.23 03:18, Michael Paquier wrote: hba.c is complex enough these days (inclusion logic, tokenization of the items) that I am not in favor of touching its code paths for anything like that. This is not something that can apply only to pg_hba.conf, but to all configuration files

Re: SQL:2011 application time

2023-09-01 Thread Peter Eisentraut
On 31.08.23 23:26, Paul Jungwirth wrote: I've tried to clean up the first four patches to get them ready for committing, since they could get committed before the PERIOD patch. I think there is a little more cleanup needed but they should be ready for a review. Looking at the patch 0001 "Add

Re: PATCH: Add REINDEX tag to event triggers

2023-09-01 Thread jian he
On Wed, Aug 30, 2023 at 8:38 PM Jim Jones wrote: > > Greetings > > > > I was unable to apply it in 7ef5f5f > > $ git apply -v v2-0001-Add-REINDEX-tag-to-event-triggers.patch > Checking patch doc/src/sgml/event-trigger.sgml... > Checking patch src/backend/commands/indexcmds.c... > error: while sear

Re: persist logical slots to disk during shutdown checkpoint

2023-09-01 Thread Amit Kapila
On Fri, Sep 1, 2023 at 1:11 PM Ashutosh Bapat wrote: > > On Thu, Aug 31, 2023 at 7:28 PM Amit Kapila wrote: > > > > On Thu, Aug 31, 2023 at 6:12 PM Ashutosh Bapat > > wrote: > > > > > > > + qr/Streaming transactions committing after ([A-F0-9]+\/[A-F0-9]+), > > > > reading WAL from ([A-F0-9]+\/[

Re: Eliminate redundant tuple visibility check in vacuum

2023-09-01 Thread David Geier
Hi, On 9/1/23 03:25, Peter Geoghegan wrote: On Thu, Aug 31, 2023 at 3:35 PM Melanie Plageman wrote: Any inserting transaction which aborts after heap_page_prune()'s visibility check will now be of no concern to lazy_scan_prune(). Since we don't do the visibility check again, we won't find the

Re: Synchronizing slots from primary to standby

2023-09-01 Thread Peter Smith
Hi Shveta. Here are some comments for patch v14-0002 The patch is large, so my code review is a WIP... more later next week... == GENERAL 1. Patch size The patch is 2700 lines. Is it possible to break this up into smaller self-contained parts to make the reviews more manageable? ~~~ 2. P

PATCH: document for regression test forgets libpq test

2023-09-01 Thread Ryo Matsumura (Fujitsu)
Hi, I found a small mistake in document in 33.1.3. Additional Test Suites. > The additional tests that can be invoked this way include: The list doesn't include interface/libpq/test. I attached patch. Thank you. Best Regards Ryo Matsumura Fujitsu Limited regress_doc_fix.diff Description: reg

Move bki file pre-processing from initdb to bootstrap

2023-09-01 Thread Krishnakumar R
Hi All, This patch moves the pre-processing for tokens in the bki file from initdb to bootstrap. With these changes the bki file will only be opened once in bootstrap and parsing will be done by the bootstrap parser. The flow of bki file processing will be as follows: - In initdb gather the value

Re: lockup in parallel hash join on dikkop (freebsd 14.0-current)

2023-09-01 Thread Alexander Lakhin
Hello Thomas, 31.08.2023 14:15, Thomas Munro wrote: We have a signal that is pending and not blocked, so I don't immediately know why poll() hasn't returned control. When I worked at the Postgres Pro company, we observed a similar lockup under rather specific conditions (we used Elbrus CPU an

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-01 Thread Peter Smith
Here are some review comments for v29-0002 == src/bin/pg_upgrade/check.c 1. check_old_cluster_for_valid_slots + /* Quick exit if the cluster does not have logical slots. */ + if (count_old_cluster_logical_slots() == 0) + return; /Quick exit/Quick return/ I know they are kind of the same, b

Re: Incremental View Maintenance, take 2

2023-09-01 Thread jian he
hi based on v29. based on https://stackoverflow.com/a/4014981/1560347: I added a new function append_update_set_caluse, and deleted functions: {append_set_clause_for_count, append_set_clause_for_sum, append_set_clause_for_avg, append_set_clause_for_minmax} I guess this way is more extensible/gene

Re: persist logical slots to disk during shutdown checkpoint

2023-09-01 Thread Ashutosh Bapat
On Thu, Aug 31, 2023 at 7:28 PM Amit Kapila wrote: > > On Thu, Aug 31, 2023 at 6:12 PM Ashutosh Bapat > wrote: > > > > On Thu, Aug 31, 2023 at 2:52 PM Amit Kapila wrote: > > > > > > I > > > > > > think we should shut down subscriber, restart publisher and then > > > > > > make this > > > > > >

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-09-01 Thread Amit Kapila
On Fri, Sep 1, 2023 at 10:16 AM Hayato Kuroda (Fujitsu) wrote: > + /* + * Note: This must be done after doing the pg_resetwal command because + * pg_resetwal would remove required WALs. + */ + if (count_old_cluster_logical_slots()) + { + start_postmaster(&new_cluster, true); + create_logical_repl

Assert failure in ATPrepAddPrimaryKey

2023-09-01 Thread Richard Guo
I ran into an Assert failure in ATPrepAddPrimaryKey() with the query below: CREATE TABLE t0(c0 boolean); CREATE TABLE t1() INHERITS(t0); # ALTER TABLE t0 ADD CONSTRAINT m EXCLUDE ((1) WITH =); server closed the connection unexpectedly The related codes are foreach(lc, stmt->indexParams)