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

2023-07-19 Thread Amit Kapila
On Wed, Jul 19, 2023 at 7:33 PM Hayato Kuroda (Fujitsu) wrote: > > > 2. > > + /* > > + * Dump logical replication slots if needed. > > + * > > + * XXX We cannot dump replication slots at the same time as the schema > > + * dump because we need to separate the timing of restoring > > + *

Re: Report distinct wait events when waiting for WAL "operation"

2023-07-19 Thread Bharath Rupireddy
On Mon, Jul 17, 2023 at 10:25 PM Andres Freund wrote: > > Hi, > > Therefore I'm proposing that LWLockAcquireOrWait() and LWLockWaitForVar() not > use the "generic" LWLockReportWaitStart(), but use caller provided wait > events. The attached patch adds two new wait events for the existing

Re: Report distinct wait events when waiting for WAL "operation"

2023-07-19 Thread Michael Paquier
On Wed, Jul 19, 2023 at 06:49:57PM +0530, Amit Kapila wrote: > On Mon, Jul 17, 2023 at 10:26 PM Andres Freund wrote: >> FWIW, the former is bottlenecked by the number of WAL insertion locks, the >> second is bottlenecked by copying WAL into buffers due to needing to flush >> them. > > This gives

Re: Do we want to enable foreign key constraints on subscriber?

2023-07-19 Thread Amit Kapila
On Wed, Jul 19, 2023 at 12:21 PM Kyotaro Horiguchi wrote: > > There's an issue brought up in the -bugs list [1]. Since triggers are > deactivated on a subscriber by default, foreign key constraints don't > fire for replicated changes. The docs state this is done to prevent > repetitive data

Re: Row pattern recognition

2023-07-19 Thread Tatsuo Ishii
> Hello, > > Thanks for working on this! We're interested in RPR as well, and I've > been trying to get up to speed with the specs, to maybe make myself > useful. Thank you for being interested in this. > 19075-5 discusses that, at least; not sure about other parts of the spec. Thanks for the

Re: Make mesage at end-of-recovery less scary.

2023-07-19 Thread Kyotaro Horiguchi
At Mon, 17 Jul 2023 15:20:30 +0300, Aleksander Alekseev wrote in > Thanks for working on this, it bugged me for a while. I noticed that > cfbot is not happy with the patch so I rebased it. > postgresql:pg_waldump test suite didn't pass after the rebase. I fixed > it too. Other than that the

Re: Support worker_spi to execute the function dynamically.

2023-07-19 Thread Bharath Rupireddy
On Thu, Jul 20, 2023 at 10:09 AM Michael Paquier wrote: > > On Thu, Jul 20, 2023 at 09:43:37AM +0530, Bharath Rupireddy wrote: > > +1. However, a comment above helps one to understand why some GUCs are > > defined before if (!process_shared_preload_libraries_in_progress). As > > this is an

Re: Support worker_spi to execute the function dynamically.

2023-07-19 Thread Michael Paquier
On Thu, Jul 20, 2023 at 09:43:37AM +0530, Bharath Rupireddy wrote: > +1. However, a comment above helps one to understand why some GUCs are > defined before if (!process_shared_preload_libraries_in_progress). As > this is an example extension, it will help understand the reasoning > better. I know

Re: FATAL: operator class "xxxx" does not exist for access method "btree"

2023-07-19 Thread mao zhang
Fixed! Tom Lane 于2023年7月19日周三 11:10写道: > mao zhang writes: > > running bootstrap script ... 2023-07-19 09:40:47.083 CST [2808392] > FATAL: > > operator class "key_ops" does not exist for access method "btree" > > I'm not sure what you find so mysterious about that error message. > > >

Re: Support worker_spi to execute the function dynamically.

2023-07-19 Thread Bharath Rupireddy
On Thu, Jul 20, 2023 at 9:25 AM Michael Paquier wrote: > > > In my understanding, the restriction is not required. So, I think it's > > better to change the behavior. > > (v1-0001-Support-worker_spi-to-execute-the-function-dynamical.patch) > > > > What do you think? > > +1. I'm OK to lift this

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-07-19 Thread Peter Smith
Hi, I had a look at the latest 3 patch (v20-0003). Although this patch was recently modified, the updates are mostly only to make it compatible with the updated v20-0002 patch. Specifically, the v20-0003 updates did not yet address my review comments from v17-0003 [1]. Anyway, this post is

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-07-19 Thread Amit Kapila
On Thu, Jul 20, 2023 at 8:02 AM Peter Smith wrote: > > On Tue, Jul 18, 2023 at 1:54 AM Melih Mutlu wrote: > > > > Hi, > > > > PFA updated patches. Rebased 0003 with minor changes. Addressed Peter's > > reviews for 0001 and 0002 with some small comments below. > > > > Peter Smith , 10 Tem 2023

Re: Support worker_spi to execute the function dynamically.

2023-07-19 Thread Michael Paquier
On Thu, Jul 20, 2023 at 11:15:51AM +0900, Masahiro Ikeda wrote: > While I'm working on the thread[1], I found that the function of > worker_spi module fails if 'shared_preload_libraries' doesn't have > worker_spi. I guess that you were patching worker_spi to register dynamically a wait event and

Re: Issue in _bt_getrootheight

2023-07-19 Thread Gurjeet Singh
On Tue, Jul 11, 2023 at 9:35 AM Ahmed Ibrahim wrote: > > We have been working on the pg_adviser extension whose goal is to suggest > indexes by creating virtual/hypothetical indexes and see how it affects the > query cost. > > The hypothetical index shouldn't take any space on the disk

Re: logicalrep_message_type throws an error

2023-07-19 Thread Amit Kapila
On Thu, Jul 20, 2023 at 9:10 AM Amit Kapila wrote: > > On Wed, Jul 19, 2023 at 10:08 AM Ashutosh Bapat > wrote: > > > > On Wed, Jul 19, 2023 at 9:01 AM Amit Kapila wrote: > > > > > > On Tue, Jul 18, 2023 at 10:27 AM Masahiko Sawada > > > wrote: > > > > > > > > Or can we use snprintf() writing

Re: logicalrep_message_type throws an error

2023-07-19 Thread Amit Kapila
On Wed, Jul 19, 2023 at 10:08 AM Ashutosh Bapat wrote: > > On Wed, Jul 19, 2023 at 9:01 AM Amit Kapila wrote: > > > > On Tue, Jul 18, 2023 at 10:27 AM Masahiko Sawada > > wrote: > > > > > > Or can we use snprintf() writing "??? (%d)" to a fixed length char[8 + > > > 11] allocated on the stack

Re: Use COPY for populating all pgbench tables

2023-07-19 Thread Michael Paquier
On Wed, Jul 19, 2023 at 01:03:21PM -0500, Tristan Partin wrote: > Didn't actually include the changes in the previous patch. -initGenerateDataClientSide(PGconn *con) +initBranch(PQExpBufferData *sql, int64 curr) { - PQExpBufferData sql; + /* "filler" column defaults to NULL */ +

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-07-19 Thread Peter Smith
Some review comments for patch v20-0002 == src/backend/replication/logical/tablesync.c 1. finish_sync_worker /* * Exit routine for synchronization worker. * * If reuse_worker is false, the worker will not be reused and exit. */ ~ IMO the "will not be reused" part doesn't need saying --

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-07-19 Thread Peter Smith
On Tue, Jul 18, 2023 at 1:54 AM Melih Mutlu wrote: > > Hi, > > PFA updated patches. Rebased 0003 with minor changes. Addressed Peter's > reviews for 0001 and 0002 with some small comments below. > > Peter Smith , 10 Tem 2023 Pzt, 10:09 tarihinde şunu > yazdı: >> >> 6. LogicalRepApplyLoop >> >>

Support worker_spi to execute the function dynamically.

2023-07-19 Thread Masahiro Ikeda
Hi, While I'm working on the thread[1], I found that the function of worker_spi module fails if 'shared_preload_libraries' doesn't have worker_spi. The reason is that the database name is NULL because the database name is initialized only when process_shared_preload_libraries_in_progress is

Re: pg_recvlogical prints bogus error when interrupted

2023-07-19 Thread Michael Paquier
On Wed, Jul 19, 2023 at 01:46:02PM +0530, Bharath Rupireddy wrote: > Printing LSN on signal exit won't be correct - if signal is received > before cur_record_lsn gets assigned, we will be showing an old LSN if > it was previously assigned or invalid LSN if it wasn't assigned > previously. Signal

Re: pg_recvlogical prints bogus error when interrupted

2023-07-19 Thread Michael Paquier
On Wed, Jul 19, 2023 at 01:33:15PM +0530, Bharath Rupireddy wrote: > I think the delay is expected for the reason specified below and is > not because of any of the changes in v5. As far as CTRL+C is > concerned, it is a clean exit and hence we can't escape the while(1) > loop. Yes, that's also

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-07-19 Thread David Rowley
On Wed, 19 Jul 2023 at 23:14, Dean Rasheed wrote: > Hmm, I'm somewhat sceptical about this second patch. It's not obvious > why adding such tests would speed it up, and indeed, testing on my > machine with 50M rows, I see a noticeable speed-up from patch 1, and a > slow-down from patch 2: I

Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans

2023-07-19 Thread Jacob Champion
On Mon, Feb 27, 2023 at 12:24 AM Heikki Linnakangas wrote: > On 22/02/2023 15:03, Aleksander Alekseev wrote: > > If memory serves I noticed that WHERE ... IS NULL queries don't even > > hit HeapKeyTest() and I was curious where the check for NULLs is > > actually made. As I understand, SeqNext()

Re: Support to define custom wait events for extensions

2023-07-19 Thread Michael Paquier
On Wed, Jul 19, 2023 at 11:16:34AM -0500, Tristan Partin wrote: > On Tue Jul 11, 2023 at 6:29 PM CDT, Michael Paquier wrote: >> This style comes from LWLockRegisterTranche() in lwlock.c. Do you >> think that it would be more adapted to change that to >> pg_nextpower2_size_t() with a Size? We

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

2023-07-19 Thread Michael Paquier
On Wed, Jul 19, 2023 at 11:21:17AM -0700, David Zhang wrote: > 1) simply start server from a base backup > > FATAL:  could not find recovery.signal or standby.signal when recovering > with backup_label > > HINT:  If you are restoring from a backup, touch >

Re: Move un-parenthesized syntax docs to "compatibility" for few SQL commands

2023-07-19 Thread Nathan Bossart
On Fri, Jun 30, 2023 at 11:25:57AM -0700, Nathan Bossart wrote: > I think these patches are in decent shape, so I'd like to commit them soon, > but I will wait at least a couple more weeks in case anyone has additional > feedback. Committed. -- Nathan Bossart Amazon Web Services:

Re: Use of additional index columns in rows filtering

2023-07-19 Thread Peter Geoghegan
On Wed, Jul 19, 2023 at 1:46 PM Jeff Davis wrote: > On Wed, 2023-07-19 at 20:03 +0200, Tomas Vondra wrote: > > Makes sense, I also need to think about maybe not having duplicate > > clauses in the two lists. What annoys me on that it partially > > prevents > > the cost-based reordering done by

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-07-19 Thread Andrew Dunstan
On 2023-07-19 We 16:44, Andrew Dunstan wrote: On 2023-07-19 We 15:20, Andrew Dunstan wrote: On 2023-07-19 We 12:05, Alvaro Herrera wrote: Maybe we need to make AdjustUpgrade just look at the major version, something like:    $old_version =

Re: Use of additional index columns in rows filtering

2023-07-19 Thread Jeff Davis
On Wed, 2023-07-19 at 20:03 +0200, Tomas Vondra wrote: > Makes sense, I also need to think about maybe not having duplicate > clauses in the two lists. What annoys me on that it partially > prevents > the cost-based reordering done by order_qual_clauses(). So maybe we > should have three lists ...

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-07-19 Thread Andrew Dunstan
On 2023-07-19 We 15:20, Andrew Dunstan wrote: On 2023-07-19 We 12:05, Alvaro Herrera wrote: Maybe we need to make AdjustUpgrade just look at the major version, something like:    $old_version = PostgreSQL::Version->new($old_version->major); It seems like that does work, but if we do

Re: Giving more detail in pg_upgrade errormessage

2023-07-19 Thread Daniel Gustafsson
> On 18 Jul 2023, at 18:04, Tom Lane wrote: > > Daniel Gustafsson writes: >> Looking at the upgrade question in [0] made me realize that we discard >> potentially useful information for troubleshooting. When we check if the >> cluster is properly shut down we might as well include the status

Re: Adding argument names to aggregate functions

2023-07-19 Thread Daniel Gustafsson
> On 19 Jul 2023, at 19:32, Dagfinn Ilmari Mannsåker wrote: > > Daniel Gustafsson writes: > >> This patch no longer applied but had a fairly trivial conflict so I've >> attached >> a rebased v3 addressing the conflict in the hopes of getting this further. > > Thanks for the heads-up! Turns

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-07-19 Thread Andrew Dunstan
On 2023-07-19 We 12:05, Alvaro Herrera wrote: On 2023-Jul-19, Andrew Dunstan wrote: On 2023-07-19 We 07:05, Alvaro Herrera wrote: I just hit a snag testing this. It turns out that the PostgreSQL::Version comparison stuff believes that 16beta2 < 16, which sounds reasonable. However, because

Re: Atomic ops for unlogged LSN

2023-07-19 Thread John Morris
>> Why don't we just use a barrier when around reading the value? It's not like >> CreateCheckPoint() is frequent? One reason is that a barrier isn’t needed, and adding unnecessary barriers can also be confusing. With respect to the “debug only” comment in the original code, whichever value is

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

2023-07-19 Thread David Zhang
On 2023-07-16 6:27 p.m., Michael Paquier wrote: Delete a backup_label from a fresh base backup can easily lead to data corruption, as the startup process would pick up as LSN to start recovery from the control file rather than the backup_label file. This would happen if a checkpoint updates the

Re: ALTER TABLE SET ACCESS METHOD on partitioned tables

2023-07-19 Thread Justin Pryzby
On Thu, Jun 01, 2023 at 08:50:50AM -0400, Michael Paquier wrote: > On Wed, May 31, 2023 at 06:35:34PM -0500, Justin Pryzby wrote: > > What do you think the comment ought to say ? It already says: > > > > src/backend/catalog/heap.c- * Make a dependency link to force > > the relation

Re: Use of additional index columns in rows filtering

2023-07-19 Thread Tomas Vondra
On 7/19/23 19:17, Jeff Davis wrote: > On Wed, 2023-07-19 at 11:16 +0200, Tomas Vondra wrote: >> I wonder if Andres was right (in the index prefetch thread) that >> splitting regular index scans and index-only scans may not be ideal. >> In >> a way, this patch moves those nodes closer, both in

Re: Use COPY for populating all pgbench tables

2023-07-19 Thread Tristan Partin
Didn't actually include the changes in the previous patch. -- Tristan Partin Neon (https://neon.tech) From 5b934691b88b3b2c5675bc778b0a10e9eeff3dbe Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Tue, 23 May 2023 11:48:16 -0500 Subject: [PATCH v5] Use COPY instead of INSERT for populating

Re: Use COPY for populating all pgbench tables

2023-07-19 Thread Tristan Partin
On Wed Jul 12, 2023 at 10:52 PM CDT, Michael Paquier wrote: On Wed, Jul 12, 2023 at 09:29:35AM -0500, Tristan Partin wrote: > On Wed Jul 12, 2023 at 1:06 AM CDT, Michael Paquier wrote: >> This would use the freeze option only on pgbench_accounts when no >> partitioning is defined, but my point

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread Pavel Luzanov
On 19.07.2023 19:47, Tom Lane wrote: And done, with some minor editorialization. Thanks to everyone who participated in the work. Special thanks to David for moving forward this patch for a long time, and to Tom for taking commit responsibilities. -- Pavel Luzanov Postgres Professional:

Re: harmonize password reuse in vacuumdb, clusterdb, and reindexdb

2023-07-19 Thread Nathan Bossart
On Wed, Jun 28, 2023 at 10:24:09PM -0700, Nathan Bossart wrote: > On Wed, Jun 28, 2023 at 09:20:03PM -0700, Gurjeet Singh wrote: >> The comment on top of connect_utils.c:connectDatabase() seems pertinent: >> >>> (Callers should not pass >>> * allow_password_reuse=true unless reconnecting to the

Re: Adding argument names to aggregate functions

2023-07-19 Thread Dagfinn Ilmari Mannsåker
Daniel Gustafsson writes: > This patch no longer applied but had a fairly trivial conflict so I've > attached > a rebased v3 addressing the conflict in the hopes of getting this further. Thanks for the heads-up! Turns out the conflict was due to the new json(b)_object_agg(_unique)(_strict)

Re: There should be a way to use the force flag when restoring databases

2023-07-19 Thread Gurjeet Singh
On Tue, Jul 18, 2023 at 12:53 AM Joan wrote: > > Since posgres 13 there's the option to do a FORCE when dropping a database > (so it disconnects current users) Documentation here: > https://www.postgresql.org/docs/current/sql-dropdatabase.html > > I am currently using dir format for the output

Re: Use of additional index columns in rows filtering

2023-07-19 Thread Jeff Davis
On Wed, 2023-07-19 at 11:16 +0200, Tomas Vondra wrote: > I wonder if Andres was right (in the index prefetch thread) that > splitting regular index scans and index-only scans may not be ideal. > In > a way, this patch moves those nodes closer, both in capability and > code > (because now both use

Re: Fix last unitialized memory warning

2023-07-19 Thread Tristan Partin
On Sun Jul 9, 2023 at 2:23 AM CDT, Peter Eisentraut wrote: On 06.07.23 15:41, Tristan Partin wrote: > On Thu Jul 6, 2023 at 3:21 AM CDT, Peter Eisentraut wrote: >> On 05.07.23 23:06, Tristan Partin wrote: >>> Thanks for following up. My system is Fedora 38. I can confirm this is >>> still

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread David G. Johnston
On Wed, Jul 19, 2023 at 9:47 AM Tom Lane wrote: > I wrote: > > Alvaro Herrera writes: > >> +1 for backpatching to 16, given that it's a psql-only change that > >> pertains to a backend change that was done in the 16 timeframe. > > > Agreed. In the interests of moving things along, I'll take

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread Tom Lane
I wrote: > Alvaro Herrera writes: >> +1 for backpatching to 16, given that it's a psql-only change that >> pertains to a backend change that was done in the 16 timeframe. > Agreed. In the interests of moving things along, I'll take point > on getting this committed. And done, with some minor

Re: Row pattern recognition

2023-07-19 Thread Jacob Champion
Hello, Thanks for working on this! We're interested in RPR as well, and I've been trying to get up to speed with the specs, to maybe make myself useful. On 6/27/23 17:58, Tatsuo Ishii wrote: > Yes. (I think the standard calls the window frame as "full window > frame" in context of RPR to make a

Re: Support to define custom wait events for extensions

2023-07-19 Thread Tristan Partin
On Tue Jul 11, 2023 at 6:29 PM CDT, Michael Paquier wrote: On Tue, Jul 11, 2023 at 12:39:52PM -0500, Tristan Partin wrote: > Given the context of our last conversation, I assume this code was > copied from somewhere else. Since this is new code, I think it would > make more sense if newalloc was

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-07-19 Thread Alvaro Herrera
On 2023-Jul-19, Andrew Dunstan wrote: > > On 2023-07-19 We 07:05, Alvaro Herrera wrote: > > I just hit a snag testing this. It turns out that the > > PostgreSQL::Version comparison stuff believes that 16beta2 < 16, which > > sounds reasonable. However, because of that, the AdjustUpgrade.pm > >

Re: Support to define custom wait events for extensions

2023-07-19 Thread Tristan Partin
Thanks for continuing to work on this patchset. I only have prose-related comments. To support custom wait events, it add 2 APIs to define new wait events for extensions dynamically. Remove the "it" here. The APIs are * WaitEventExtensionNew() * WaitEventExtensionRegisterName() These are

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread Tom Lane
Alvaro Herrera writes: > I tried this out. It looks good to me, and I like it. Not translating > the labels seems correct to me. > +1 for backpatching to 16, given that it's a psql-only change that > pertains to a backend change that was done in the 16 timeframe. Agreed. In the interests of

Re: [RFC] Add jit deform_counter

2023-07-19 Thread Dmitry Dolgov
> On Tue, Jul 18, 2023, 3:32 PM Daniel Gustafsson wrote >> Here is the patch with the proposed variation. > > This version still leaves non-text EXPLAIN formats with timing which doesn't > add up. Below are JSON and XML examples: Good point. For the structured formats it should be represented

Re: Let's make PostgreSQL multi-threaded

2023-07-19 Thread Ashutosh Bapat
I think planner would also benefit from threads. There are many tasks in planner that are independent and can be scheduled using dependency graph. They are too small to be parallelized through separate backends but large enough to be performed by threads. Planning queries involving partitioned

Re: Remove backend warnings from SSL tests

2023-07-19 Thread Tom Lane
I wrote: > Aleksander Alekseev writes: >> Alternatively we could get rid of >> ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS entirely since its practical >> value seems to be debatable. > Strong -1 on that, for the reason given above. Perhaps an alternative could be to expend some more sweat on the

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

2023-07-19 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thanks for reviewing! The patch could be available at [1]. > Few comments/questions > > 1. > +check_for_parameter_settings(ClusterInfo *new_cluster) > { > ... > + > + res = executeQueryOrDie(conn, "SHOW max_replication_slots;"); > + max_replication_slots =

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

2023-07-19 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thank you for reviewing! PSA new version patchset. > == > Commit message > > 1. > For pg_dump this commit includes a new option called > "--logical-replication-slots-only". > This option can be used to dump logical replication slots. When this option is > specified, the

Re: Remove backend warnings from SSL tests

2023-07-19 Thread Tom Lane
Aleksander Alekseev writes: >> When looking at a patch in the CFBot I realized that the SSL tests generate >> backend warnings under ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS > Good catch. I can confirm that the patch corrects the named WARNINGs > appearing with: >

pg_rewind fails with in-place tablespace

2023-07-19 Thread 赵锐(惜元)
Hello postgres hackers, Recently I encountered an issue: pg_rewind fails when dealing with in-place tablespace. The problem seems to be that pg_rewind is treating in-place tablespace as symbolic link, while in fact it should be treated as directory. Here is the output of pg_rewind: pg_rewind:

Re: Report distinct wait events when waiting for WAL "operation"

2023-07-19 Thread Amit Kapila
On Mon, Jul 17, 2023 at 10:26 PM Andres Freund wrote: > > Previously it was e.g. not really possible to distinguish that something like > this: > > ┌┬─┬┬───┐ > │ backend_type │ wait_event_type │ wait_event │ count │ >

Re: Disabling Heap-Only Tuples

2023-07-19 Thread Thom Brown
On Wed, 19 Jul 2023, 13:58 Laurenz Albe, wrote: > On Thu, 2023-07-06 at 22:18 +0200, Matthias van de Meent wrote: > > On Wed, 5 Jul 2023 at 19:55, Thom Brown wrote: > > > > > > On Wed, 5 Jul 2023 at 18:05, Matthias van de Meent > > > wrote: > > > > So what were you thinking of? A session GUC?

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-07-19 Thread Andrew Dunstan
On 2023-07-19 We 07:05, Alvaro Herrera wrote: I just hit a snag testing this. It turns out that the PostgreSQL::Version comparison stuff believes that 16beta2 < 16, which sounds reasonable. However, because of that, the AdjustUpgrade.pm stanza that tries to drop tables

Re: Disabling Heap-Only Tuples

2023-07-19 Thread Laurenz Albe
On Thu, 2023-07-06 at 22:18 +0200, Matthias van de Meent wrote: > On Wed, 5 Jul 2023 at 19:55, Thom Brown wrote: > > > > On Wed, 5 Jul 2023 at 18:05, Matthias van de Meent > > wrote: > > > So what were you thinking of? A session GUC? A table option? > > > > Both. > > Here's a small patch

Re: Remove backend warnings from SSL tests

2023-07-19 Thread Aleksander Alekseev
Hi, > When looking at a patch in the CFBot I realized that the SSL tests generate > backend warnings under ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS Good catch. I can confirm that the patch corrects the named WARNINGs appearing with: CPPFLAGS="-DENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS" There

Re: remaining sql/json patches

2023-07-19 Thread Amit Langote
On Wed, Jul 19, 2023 at 5:17 PM Amit Langote wrote: > On Wed, Jul 19, 2023 at 12:53 AM Alvaro Herrera > wrote: > > On 2023-Jul-18, Amit Langote wrote: > > > b6e1157e7d Don't include CaseTestExpr in JsonValueExpr.formatted_expr > > > > I feel a bit uneasy about this one. It seems to assume that

Re: Allow pg_archivecleanup to remove backup history files

2023-07-19 Thread torikoshia
On 2023-07-19 13:58, Michael Paquier wrote: On Fri, Jun 30, 2023 at 03:48:43PM +0900, Michael Paquier wrote: I have begun cleaning up my board, and applied 0001 for the moment. And a few weeks later.. I have come around this thread and applied 0002 and 0003. The flow of 0002 was

Re: RFC: logical publication via inheritance root?

2023-07-19 Thread Aleksander Alekseev
Hi, > v3 also fixes a nasty uninitialized stack variable, along with a bad > collation assumption I made. I decided to take a closer look at 0001. Since pg_get_relation_publishing_info() is exposed to the users I think it should be described in a bit more detail than: ``` + descr => 'get

Remove backend warnings from SSL tests

2023-07-19 Thread Daniel Gustafsson
When looking at a patch in the CFBot I realized that the SSL tests generate backend warnings under ENFORCE_REGRESSION_TEST_NAME_RESTRICTIONS due to roles and databases not following the regression test naming convention. While not impacting the tested functionality, it's pretty silly to have

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-07-19 Thread Dean Rasheed
On Wed, 19 Jul 2023 at 09:24, Masahiko Sawada wrote: > > > > 2) pg_strtoint32_safe() got substantially slower, mainly due > > >to > > > faff8f8e47f Allow underscores in integer and numeric constants. > > > 6fcda9aba83 Non-decimal integer literals > > > > Agreed. > > > I have made some

Re: Extracting cross-version-upgrade knowledge from buildfarm client

2023-07-19 Thread Alvaro Herrera
I just hit a snag testing this. It turns out that the PostgreSQL::Version comparison stuff believes that 16beta2 < 16, which sounds reasonable. However, because of that, the AdjustUpgrade.pm stanza that tries to drop tables public.gtest_normal_child{2} in versions earlier than 16 fails, because

Re: Add a perl function in Cluster.pm to generate WAL

2023-07-19 Thread Bharath Rupireddy
On Fri, Jun 16, 2023 at 8:00 AM Michael Paquier wrote: > > On Thu, Jun 15, 2023 at 01:40:15PM +0900, Kyotaro Horiguchi wrote: > > + "CREATE TABLE tt (); DROP TABLE tt; SELECT > > pg_switch_wal();"); > > > > At least since 11, we can utilize pg_logical_emit_message() for this

Re: Fix a comment in basic_archive about NO_INSTALLCHECK

2023-07-19 Thread Bharath Rupireddy
On Thu, Apr 6, 2023 at 9:26 AM Michael Paquier wrote: > > On Mon, Apr 03, 2023 at 08:56:10AM +0530, Bharath Rupireddy wrote: > > It looks like comments in make file and meson file about not running > > basic_archive tests in NO_INSTALLCHECK mode are wrong. The comments say the > > module needs to

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

2023-07-19 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > I have studied this a bit more and it seems that is true for physical > walsenders where we set the state of walsender as WALSNDSTATE_STOPPING > in XLogSendPhysical, then the checkpointer finishes writing checkpoint > record and then postmaster sends SIGUSR2 for walsender to exit.

Re: psql: Add role's membership options to the \du+ command

2023-07-19 Thread Alvaro Herrera
I tried this out. It looks good to me, and I like it. Not translating the labels seems correct to me. +1 for backpatching to 16, given that it's a psql-only change that pertains to a backend change that was done in the 16 timeframe. Regarding the controversy of showing SET for previous

Re: A minor adjustment to get_cheapest_path_for_pathkeys

2023-07-19 Thread Richard Guo
On Tue, Jul 11, 2023 at 8:16 PM Aleksander Alekseev < aleksan...@timescale.com> wrote: > Hi, > > > The check for parallel_safe should be even cheaper than cost comparison > > so I think it's better to do that first. The attached patch does this > > and also updates the comment to mention the

Re: Use of additional index columns in rows filtering

2023-07-19 Thread Tomas Vondra
On 7/19/23 01:22, Jeff Davis wrote: > On Wed, 2023-07-19 at 00:36 +0200, Tomas Vondra wrote: >>> * I'm confused about the relationship of an IOS to an index filter. >>> It >>> seems like the index filter only works for an ordinary index scan? >>> Why >>> is that? >> >> What would it do for IOS?

Re: Avoid stack frame setup in performance critical routines using tail calls

2023-07-19 Thread Andres Freund
Hi, David and I were chatting about this patch, in the context of his bump allocator patch. Attached is a rebased version that is also split up into two steps, and a bit more polished. I wasn't sure what a good test was. I ended up measuring COPY pgbench_accounts TO '/dev/null' WITH (FORMAT

Re: unrecognized node type while displaying a Path due to dangling pointer

2023-07-19 Thread Ashutosh Bapat
On Tue, Jul 18, 2023 at 5:05 AM David Rowley wrote: > > On Mon, 17 Jul 2023 at 15:31, Tom Lane wrote: > > > I also didn't do anything about ExtensibleNode types. I assume just > > > copying the ExtensibleNode isn't good enough. To flat copy the actual > > > node I think would require adding a

Re: Support to define custom wait events for extensions

2023-07-19 Thread Bharath Rupireddy
On Wed, Jul 19, 2023 at 11:49 AM Masahiro Ikeda wrote: > > I updated the patch since the cfbot found a bug. > * v7-0001-Support-custom-wait-events-for-extensions.patch Thanks for working on this feature. +1. I've wanted this capability for a while because extensions have many different wait

Re: Performance degradation on concurrent COPY into a single relation in PG16.

2023-07-19 Thread Masahiko Sawada
On Wed, Jul 12, 2023 at 5:40 PM Masahiko Sawada wrote: > > On Wed, Jul 12, 2023 at 3:52 AM Andres Freund wrote: > > > > Hi, > > > > On 2023-07-03 11:55:13 +0900, Masahiko Sawada wrote: > > > While testing PG16, I observed that in PG16 there is a big performance > > > degradation in concurrent

Re: remaining sql/json patches

2023-07-19 Thread Amit Langote
On Wed, Jul 19, 2023 at 12:53 AM Alvaro Herrera wrote: > On 2023-Jul-18, Amit Langote wrote: > > > Attached updated patches. In 0002, I removed the mention of the > > RETURNING clause in the JSON(), JSON_SCALAR() documentation, which I > > had forgotten to do in the last version which removed

Re: pg_recvlogical prints bogus error when interrupted

2023-07-19 Thread Bharath Rupireddy
On Wed, Jul 19, 2023 at 1:41 PM Michael Paquier wrote: > > > 3. pg_log_info("end position %X/%X reached on signal", For > > signal, end position is a bit vague wording and I think we can just > > say pg_log_info("received interrupt signal, exiting"); like > > pg_receivewal. We really can't

Re: pg_recvlogical prints bogus error when interrupted

2023-07-19 Thread Michael Paquier
On Wed, Jul 19, 2023 at 12:07:21PM +0530, Bharath Rupireddy wrote: > 1. I don't think we need a stop_lsn variable, the cur_record_lsn can > help if it's defined outside the loop. With this, the patch can > further be simplified as attached v6. Okay by me. > 2. And, I'd prefer not to assume the

Re: doc: improve the restriction description of using indexes on REPLICA IDENTITY FULL table.

2023-07-19 Thread Önder Kalacı
Hi Masahiko, Amit, all I've updated the patch. > I think the flow is much nicer now compared to the HEAD. I really don't have any comments regarding the accuracy of the code changes, all looks good to me. Overall, I cannot see any behavioral changes as you already alluded to. Maybe few minor

Re: pg_recvlogical prints bogus error when interrupted

2023-07-19 Thread Bharath Rupireddy
On Wed, Jul 19, 2023 at 12:07 PM Bharath Rupireddy wrote: > > 4. With v5, it was taking a while to exit after the first CTRL+C, see > multiple CTRL+Cs at the end: > ubuntu::~/postgres/inst/bin$ ./pg_recvlogical --slot=lsub1_repl_slot > --file=lsub1.data --start --verbose > pg_recvlogical:

Re: Adding argument names to aggregate functions

2023-07-19 Thread Daniel Gustafsson
This patch no longer applied but had a fairly trivial conflict so I've attached a rebased v3 addressing the conflict in the hopes of getting this further. -- Daniel Gustafsson v3-0001-Add-argument-names-to-multi-argument-aggregates.patch Description: Binary data

Re: pg_upgrade and logical replication

2023-07-19 Thread Michael Paquier
On Wed, May 10, 2023 at 05:59:24PM +1000, Peter Smith wrote: > 1. ALTER SUBSCRIPTION name ADD TABLE (relid = XYZ, state = 'x' [, lsn = > 'X/Y']) > > I was a bit confused by this relation 'state' mentioned in multiple > places. IIUC the pg_upgrade logic is going to reject anything with a >

Do we want to enable foreign key constraints on subscriber?

2023-07-19 Thread Kyotaro Horiguchi
Hello. There's an issue brought up in the -bugs list [1]. Since triggers are deactivated on a subscriber by default, foreign key constraints don't fire for replicated changes. The docs state this is done to prevent repetitive data propagation between tables on subscribers. But foreign key

Re: pg_recvlogical prints bogus error when interrupted

2023-07-19 Thread Bharath Rupireddy
On Wed, Jul 19, 2023 at 8:04 AM Michael Paquier wrote: > > It took me some time to come back to this one, but attached is what I > had in mind. This stuff has three reasons to stop: keepalive, end LSN > or signal. This makes the code easier to follow. > > Thoughts or comments? Thanks. I have

Re: Flush SLRU counters in checkpointer process

2023-07-19 Thread Anthonin Bonnefoy
I think I've managed to reproduce the issue. The test I've added to check slru flush was the one failing in the regression suite. SELECT SUM(flushes) > :slru_flushes_before FROM pg_stat_slru; ?column? -- t The origin seems to be a race condition on have_slrustats (

Re: Support to define custom wait events for extensions

2023-07-19 Thread Michael Paquier
On Wed, Jul 19, 2023 at 12:52:10PM +0900, Masahiro Ikeda wrote: > I would like to change the wait event name of contrib modules for example > postgres_fdw. But, I think it's better to do so after the APIs are > committed. Agreed to do things one step at a time here. Let's focus on the core APIs

Re: Support to define custom wait events for extensions

2023-07-19 Thread Masahiro Ikeda
On 2023-07-19 12:52, Masahiro Ikeda wrote: Hi, I updated the patches. * v6-0001-Support-custom-wait-events-for-extensions.patch I updated the patch since the cfbot found a bug. * v7-0001-Support-custom-wait-events-for-extensions.patch Regards, -- Masahiro Ikeda NTT DATA CORPORATIONFrom