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

2023-08-06 Thread Julien Rouhaud
On Mon, Aug 07, 2023 at 09:24:02AM +0530, Amit Kapila wrote: > > I think autovacuum is not enabled during the upgrade. See comment "Use > -b to disable autovacuum." in start_postmaster(). However, I am not > sure if there can't be any additional WAL from checkpointer or > bgwriter. Checkpointer

Re: "duplicated" wait events

2023-08-06 Thread Kyotaro Horiguchi
At Fri, 4 Aug 2023 17:07:51 +0200, "Drouvot, Bertrand" wrote in > SynRep currently appears in "IPC" and "LWLock" (see [2]) > WALWrite currently appears in "IO" and "LWLock" (see [2]) > > I think that can lead to confusion and it would be better to avoid > duplicate wait event > name across

Re: Cleaning up array_in()

2023-08-06 Thread jian he
hi. based on Heikki v3. I made some changes: array_in: dim[6] all initialize with -1, lBound[6] all initialize with 1. if ReadArrayDimensions called, then corresponding dimension lBound will replace the initialized default 1 value. ReadArrayStr, since array_in main function initialized dim array,

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

2023-08-06 Thread Amit Kapila
On Wed, Aug 2, 2023 at 7:46 AM Jonathan S. Katz wrote: > > Can I take this a step further on the user interface and ask why the > flag would be "--include-logical-replication-slots" vs. being enabled by > default? > > Are there reasons why we wouldn't enable this feature by default on >

Re: CDC/ETL system on top of logical replication with pgoutput, custom client

2023-08-06 Thread Amit Kapila
On Sun, Aug 6, 2023 at 7:54 PM José Neves wrote: > > A follow-up on this. Indeed, a new commit-based approach solved my missing > data issues. > But, getting back to the previous examples, how are server times expected to > be logged for the xlogs containing these records? > I think it should

Re: Postmaster self-deadlock due to PLT linkage resolution

2023-08-06 Thread Thomas Munro
After commit 7389aad6, I think commit 8acd8f86's linker changes (+ meson.build's equivalent) must now be redundant?

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

2023-08-06 Thread Amit Kapila
On Sun, Aug 6, 2023 at 6:02 PM Masahiko Sawada wrote: > > On Wed, Aug 2, 2023 at 5:13 PM Hayato Kuroda (Fujitsu) > wrote: > > > > > 4. > > > + /* > > > + * Check that all logical replication slots have reached the current WAL > > > + * position. > > > + */ > > > + res = executeQueryOrDie(conn, >

Re: Extract numeric filed in JSONB more effectively

2023-08-06 Thread Andy Fan
Hi: > For all the people who are interested in this topic, I will post a > planner support function soon, you can check that then. > > The updated patch doesn't need users to change their codes and can get better performance. Thanks for all the feedback which makes things better. To verify

Re: pgbench: allow to exit immediately when any client is aborted

2023-08-06 Thread Yugo NAGATA
On Mon, 7 Aug 2023 11:02:48 +0900 Yugo NAGATA wrote: > On Sat, 05 Aug 2023 12:16:11 +0900 (JST) > Tatsuo Ishii wrote: > > > > Hi, > > > > > > I would like to propose to add an option to pgbench so that benchmark > > > can quit immediately when any client is aborted. Currently, when a > > >

Re: pgbench: allow to exit immediately when any client is aborted

2023-08-06 Thread Yugo NAGATA
On Sat, 05 Aug 2023 12:16:11 +0900 (JST) Tatsuo Ishii wrote: > > Hi, > > > > I would like to propose to add an option to pgbench so that benchmark > > can quit immediately when any client is aborted. Currently, when a > > client is aborted due to some error, for example, network trouble, > >

Re: Sync scan & regression tests

2023-08-06 Thread Tom Lane
Thomas Munro writes: > On Mon, Aug 7, 2023 at 7:21 AM Konstantin Knizhnik wrote: >> Two tests are failed because of sync scan - this tests cluster.sql and >> portals.sql perform seqscan without explicit order by and expect that >> data will be returned in particular order. But because of sync

Re: Use of additional index columns in rows filtering

2023-08-06 Thread Peter Geoghegan
On Sun, Aug 6, 2023 at 3:28 PM Peter Geoghegan wrote: > I decided to verify my understanding by checking what would happen > when I ran the OR-heavy tenk1 regression test query against a > combination of your patch, and v7 of the OR-to-SAOP transformation > patch. (To be clear, this is without my

Re: Sync scan & regression tests

2023-08-06 Thread Thomas Munro
On Mon, Aug 7, 2023 at 7:21 AM Konstantin Knizhnik wrote: > Two tests are failed because of sync scan - this tests cluster.sql and > portals.sql perform seqscan without explicit order by and expect that > data will be returned in particular order. But because of sync scan it > doesn't happen.

Re: Sync scan & regression tests

2023-08-06 Thread Tom Lane
Konstantin Knizhnik writes: > Is it is ok, that regression tests do not pass with small value of > shared buffers (for example 1Mb)? There are quite a few GUC settings with which you can break the regression tests. I'm not especially bothered by this one. > More general question - is it

Re: Use of additional index columns in rows filtering

2023-08-06 Thread Peter Geoghegan
On Sun, Aug 6, 2023 at 1:13 PM Peter Geoghegan wrote: > Since you're not relying on the nbtree work at all here, really (just > on the transformation process itself), the strategic risk that this > adds to your project isn't too great. It's not like this ties the > success of your patch to the

Re: A failure in 031_recovery_conflict.pl on Debian/s390x

2023-08-06 Thread Thomas Munro
On Mon, Aug 7, 2023 at 8:40 AM Christoph Berg wrote: > 2023-08-06 17:21:24.078 UTC [127] 031_recovery_conflict.pl FATAL: > unrecognized conflict mode: 7 Thanks for testing! Would you mind trying v8 from that thread? V7 had a silly bug (I accidentally deleted a 'case' label while cleaning

Re: Adding a pg_servername() function

2023-08-06 Thread Christoph Moench-Tegeder
Hi, ## Laetitia Avrot (laetitia.av...@gmail.com): > I understand your point and sure enough, my customer could set and use the > cluster_name for that purpose. I totally disagree with using > inet_server_addr() for that purpose as there are so many different network > settings with VIPs and so

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

2023-08-06 Thread Peter Geoghegan
On Sat, Aug 5, 2023 at 7:01 PM Peter Geoghegan wrote: > Of course this immediately makes me wonder: shouldn't your patch be > able to perform an additional transformation here? You know, by > transforming "a.x = 42 OR a.x = 44" into "a IN (42, 44)"? Although I > haven't checked for myself, I

Re: A failure in 031_recovery_conflict.pl on Debian/s390x

2023-08-06 Thread Christoph Berg
Re: Thomas Munro > It's great that you can reproduce this semi-reliably! I've rebased > the patch, hoping you can try it out. Unfortunately very semi, today I didn't get to the same point where it exited after test 7, but got some other timeouts. Not even sure they are related to this (?)

Re: Use of additional index columns in rows filtering

2023-08-06 Thread Peter Geoghegan
On Sun, Aug 6, 2023 at 10:23 AM Tomas Vondra wrote: > > The index AM is entitled to make certain assumptions of opclass > > members -- assumptions that cannot be made during expression > > evaluation. > Thanks for reminding me, I keep forgetting about this. I was almost certain that you already

Re: Configurable FP_LOCK_SLOTS_PER_BACKEND

2023-08-06 Thread Andres Freund
Hi, On 2023-08-02 16:51:29 -0700, Matt Smiley wrote: > I thought it might be helpful to share some more details from one of the > case studies behind Nik's suggestion. > > Bursty contention on lock_manager lwlocks recently became a recurring cause > of query throughput drops for GitLab.com, and

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

2023-08-06 Thread Ahmed Ibrahim
Hi all, I have addressed the pg version compatibility with the FORCE option in drop. Here is the last version of the patch On Tue, Aug 1, 2023 at 6:19 PM Ahmed Ibrahim wrote: > Hi Gurjeet, > > I have addressed all your comments except for the tests. > > I have tried adding test cases but I

Sync scan & regression tests

2023-08-06 Thread Konstantin Knizhnik
Hi hackers, Is it is ok, that regression tests do not pass with small value of shared buffers (for example 1Mb)? Two tests are failed because of sync scan - this tests cluster.sql and portals.sql perform seqscan without explicit order by and expect that data will be returned in particular

Re: Use of additional index columns in rows filtering

2023-08-06 Thread Tomas Vondra
On 8/5/23 02:53, Peter Geoghegan wrote: > ... > >> Right. This however begs a question - why would we actually need to >> check the visibility map before evaluating the index filter, when the >> index tuple alone is clearly good enough for the bitmapOr plan? >> >> Because if we didn't need to do

Re: Configurable FP_LOCK_SLOTS_PER_BACKEND

2023-08-06 Thread Tomas Vondra
On 8/3/23 22:39, Tomas Vondra wrote: > On 8/3/23 01:51, Matt Smiley wrote: >> I thought it might be helpful to share some more details from one of the >> case studies behind Nik's suggestion. >> >> Bursty contention on lock_manager lwlocks recently became a recurring >> cause of query

RE: CDC/ETL system on top of logical replication with pgoutput, custom client

2023-08-06 Thread José Neves
Hi there, hope to find you all well. A follow-up on this. Indeed, a new commit-based approach solved my missing data issues. But, getting back to the previous examples, how are server times expected to be logged for the xlogs containing these records? With these 2 transactions: T-1 INSERT

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

2023-08-06 Thread Masahiko Sawada
On Wed, Aug 2, 2023 at 5:13 PM Hayato Kuroda (Fujitsu) wrote: > > > 4. > > + /* > > + * Check that all logical replication slots have reached the current WAL > > + * position. > > + */ > > + res = executeQueryOrDie(conn, > > + "SELECT slot_name FROM pg_catalog.pg_replication_slots " > > + "WHERE

Re: Improve join_search_one_level readibilty (one line change)

2023-08-06 Thread David Rowley
On Fri, 4 Aug 2023 at 16:05, Richard Guo wrote: > > > On Fri, Aug 4, 2023 at 10:36 AM David Rowley wrote: >> >> The whole lnext() stuff all feels a bit old now that Lists are arrays. >> I think we'd be better adjusting the code to pass the List index where >> we start from rather than the

Re: How to add a new operator for parser?

2023-08-06 Thread Julien Rouhaud
On Sun, Aug 06, 2023 at 01:37:42PM +0800, jacktby jacktby wrote: > > I need to build a new datatype. It can contains different datatypes, like > ‘(1,’a’,2.0)’,it’s a (interger,string,float) tuple type Is there any reason why you can't simply rely on the record datatype? > and Then I need to >