Fix bug with indexes on whole-row expressions

2023-12-12 Thread ywgrit
Hi, Thomas Munro and Laurenz Albe. Since I didn't subscribe to the psql-hackers mailing list before this bug was raised, please forgive me for not being able to reply to this email by placing the email message below.

Re: pg_upgrade and logical replication

2023-12-12 Thread vignesh C
On Wed, 13 Dec 2023 at 01:56, Masahiko Sawada wrote: > > On Thu, Dec 7, 2023 at 8:15 PM vignesh C wrote: > > > > On Tue, 5 Dec 2023 at 10:56, Michael Paquier wrote: > > > > > > On Mon, Dec 04, 2023 at 04:30:49PM +0530, Amit Kapila wrote: > > > > I have made minor changes in the comments and

Re: Synchronizing slots from primary to standby

2023-12-12 Thread shveta malik
On Wed, Dec 13, 2023 at 10:40 AM Amit Kapila wrote: > > On Mon, Dec 11, 2023 at 5:13 PM shveta malik wrote: > > > > On Mon, Dec 11, 2023 at 1:22 PM Drouvot, Bertrand > > wrote: > > > > > > > If we agree > > > > on that then it would be good to prohibit setting this GUC on standby > > > > or at

Re: Synchronizing slots from primary to standby

2023-12-12 Thread shveta malik
On Tue, Dec 12, 2023 at 5:56 PM Nisha Moond wrote: > > A review on v45 patch: > > If one creates a logical slot with failover=true as - > select pg_create_logical_replication_slot('logical_slot','pgoutput', > false, true, true); > > Then, uses the existing logical slot while creating a

Subsequent request from pg client

2023-12-12 Thread Abdul Matin
Can postgres client send subsequent requests without receiving response? If so, how does the postgres client correlate between a request and its response? Where can I get more hints about it?

Re: Improve eviction algorithm in ReorderBuffer

2023-12-12 Thread Dilip Kumar
On Wed, Dec 13, 2023 at 6:01 AM Masahiko Sawada wrote: > > > Thanks for working on this, I think it would be good to test other > > scenarios as well where this might have some negative impact and see > > where we stand. > > Agreed. > > > 1) A scenario where suppose you have one very large

Re: Synchronizing slots from primary to standby

2023-12-12 Thread Amit Kapila
On Mon, Dec 11, 2023 at 5:13 PM shveta malik wrote: > > On Mon, Dec 11, 2023 at 1:22 PM Drouvot, Bertrand > wrote: > > > > > If we agree > > > on that then it would be good to prohibit setting this GUC on standby > > > or at least it should be a no-op even if this GUC should be set on > > >

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-12 Thread Dilip Kumar
On Tue, Dec 12, 2023 at 6:58 PM Alvaro Herrera wrote: > > [Added Andrey again in CC, because as I understand they are using this > code or something like it in production. Please don't randomly remove > people from CC lists.] Oh, glad to know that. Yeah, I generally do not remove but I have

Re: Improve upcasting for INT range and multi range types

2023-12-12 Thread Tom Lane
jian he writes: > Based on my interpretation, I don't think SELECT 2::INT4 <@ '[1, > 4)'::INT8RANGE is doable. Yeah, it would require a considerable expansion of the scope of what can be matched by a polymorphic operator. I'm afraid that the negative consequences (mainly, "ambiguous operator"

Re: Improve upcasting for INT range and multi range types

2023-12-12 Thread jian he
On Fri, Dec 8, 2023 at 4:21 AM Federico wrote: > > Hi, > > Postgresql seems to be missing upcasting when doing INT range and > multi-range operation, for example when checking if an int4 is inside > an int8 range. > Some non working example are the following > > SELECT 2::INT4 <@ '[1,

Re: Synchronizing slots from primary to standby

2023-12-12 Thread Amit Kapila
On Tue, Dec 12, 2023 at 2:44 PM shveta malik wrote: > > On Mon, Dec 11, 2023 at 7:12 PM Amit Kapila wrote: > > > > > I am > > asking this because the context used is TopMemoryContext which should > > be used only if we need something specific to be retained at the > > process level which doesn't

Re: broken master regress tests

2023-12-12 Thread Tom Lane
Noah Misch writes: > An alternative would be to declare that the tests are supported in one > encoding+locale only, then stop testing others in the buildfarm. Surely that's not even a thinkably acceptable choice. regards, tom lane

Re: broken master regress tests

2023-12-12 Thread Noah Misch
On Tue, Oct 10, 2023 at 05:54:34PM -0700, Andres Freund wrote: > On 2023-10-10 17:08:25 -0700, Jeff Davis wrote: > > After this, it seems "make check" no longer picks up the locale from > > the system environment by default. > > Yea. I wonder if the better fix would have been to copy

Re: Oversight in reparameterize_path_by_child leading to executor crash

2023-12-12 Thread Andrei Lepikhov
On 6/12/2023 14:30, Richard Guo wrote: I've self-reviewed this patch again and I think it's now in a committable state.  I'm wondering if we can mark it as 'Ready for Committer' now, or we need more review comments/feedbacks. To recap, this patch postpones reparameterization of paths until

Re: Improve eviction algorithm in ReorderBuffer

2023-12-12 Thread Masahiko Sawada
On Tue, Dec 12, 2023 at 1:33 PM Dilip Kumar wrote: > > On Tue, Dec 12, 2023 at 9:01 AM Masahiko Sawada wrote: > > > > Hi all, > > > > As the comment of ReorderBufferLargestTXN() says, it's very slow with > > many subtransactions: > > > > /* > > * Find the largest transaction (toplevel or

Re: Clean up find_typedefs and add support for Mac

2023-12-12 Thread Tom Lane
"Tristan Partin" writes: > The big patch here is adding support for Mac. objdump -W doesn't work on > Mac. So, I used dsymutil and dwarfdump to achieve the same result. We should probably nuke the current version of src/tools/find_typedef altogether in favor of copying the current buildfarm

Re: encoding affects ICU regex character classification

2023-12-12 Thread Jeremy Schneider
On 12/12/23 1:39 PM, Jeff Davis wrote: > On Sun, 2023-12-10 at 10:39 +1300, Thomas Munro wrote: >> Unless you also >> implement built-in case mapping, you'd still have to call libc or ICU >> for that, right? > > We can do built-in case mapping, see: > >

Re: encoding affects ICU regex character classification

2023-12-12 Thread Jeff Davis
On Sun, 2023-12-10 at 10:39 +1300, Thomas Munro wrote: > > How would you specify what you want? One proposal would be to have a builtin collation provider: https://postgr.es/m/9d63548c4d86b0f820e1ff15a83f93ed9ded4543.ca...@j-davis.com I don't think there are very many ctype options, but they

Clean up find_typedefs and add support for Mac

2023-12-12 Thread Tristan Partin
The script was using a few deprecated things according to POSIX: - -o instead of || - egrep - `` instead of $() I removed those for their "modern" equivalents. Hopefully no buildfarm member complains. I can remove any of those patches though. I did go ahead and remove egrep usage from the

Re: Built-in CTYPE provider

2023-12-12 Thread Jeremy Schneider
On 12/5/23 3:46 PM, Jeff Davis wrote: > === Character Classification === > > Character classification is used for regexes, e.g. whether a character > is a member of the "[[:digit:]]" ("\d") or "[[:punct:]]" > class. Unicode defines what character properties map into these > classes in TR #18 [1],

Re: pg_upgrade and logical replication

2023-12-12 Thread Masahiko Sawada
On Thu, Dec 7, 2023 at 8:15 PM vignesh C wrote: > > On Tue, 5 Dec 2023 at 10:56, Michael Paquier wrote: > > > > On Mon, Dec 04, 2023 at 04:30:49PM +0530, Amit Kapila wrote: > > > I have made minor changes in the comments and code at various places. > > > See and let me know if you are not happy

Re: Report planning memory in EXPLAIN ANALYZE

2023-12-12 Thread Alvaro Herrera
On 2023-Dec-12, Alvaro Herrera wrote: > I would replace the text in explain.sgml with this: > > + Include information on memory consumption by the query planning phase. > + This includes the precise amount of storage used by planner in-memory > + structures, as well as overall

Re: Report planning memory in EXPLAIN ANALYZE

2023-12-12 Thread Alvaro Herrera
I would replace the text in explain.sgml with this: + Include information on memory consumption by the query planning phase. + This includes the precise amount of storage used by planner in-memory + structures, as well as overall total consumption of planner memory, +

Re: Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain()

2023-12-12 Thread Euler Taveira
On Tue, Dec 12, 2023, at 12:58 PM, Drouvot, Bertrand wrote: > Currently walrcv->walRcvState is set to WALRCV_STREAMING at the > beginning of WalReceiverMain(). > > But it seems that after this assignment things could be wrong before the > walreicever actually starts streaming (like not being able

Move walreceiver state assignment (to WALRCV_STREAMING) in WalReceiverMain()

2023-12-12 Thread Drouvot, Bertrand
Hi hackers, Currently walrcv->walRcvState is set to WALRCV_STREAMING at the beginning of WalReceiverMain(). But it seems that after this assignment things could be wrong before the walreicever actually starts streaming (like not being able to connect to the primary). It looks to me that

Re: typedefs.list glitches

2023-12-12 Thread Tom Lane
"Tristan Partin" writes: > Was this patch ever committed? Yes, though not till commit dcca861554e90d6395c3c153317b0b0e3841f103 Author: Andrew Dunstan Date: Sun Jan 15 07:32:50 2023 -0500 Improve typedef logic for MacOS sifaka is currently generating typedefs, and I'm pretty certain

Re: typedefs.list glitches

2023-12-12 Thread Tristan Partin
On Thu May 12, 2022 at 4:21 PM CDT, Tom Lane wrote: I wrote: > every buildfarm member that's contributing to the typedefs list > builds with OpenSSL. That wouldn't surprise me, except that > my own animal sifaka should be filling that gap. Looking at > its latest attempt[1], it seems to be

Re: Add --check option to pgindent

2023-12-12 Thread Alvaro Herrera
On 2023-Dec-12, Tom Lane wrote: > "Euler Taveira" writes: > > When you add exceptions, it starts to complicate the UI. > > Indeed. It seems like --silent-diff was poorly defined and poorly > named, and we need to rethink that option along the way to adding > this behavior. The idea that

Re: Add --check option to pgindent

2023-12-12 Thread Tristan Partin
On Tue Dec 12, 2023 at 5:47 AM CST, Euler Taveira wrote: On Tue, Dec 12, 2023, at 7:28 AM, Michael Banck wrote: > On Tue, Dec 12, 2023 at 11:18:59AM +0100, Daniel Gustafsson wrote: > > > On 12 Dec 2023, at 01:09, Tristan Partin wrote: > > > > > > Not sold on the name, but --check is a

Re: Add --check option to pgindent

2023-12-12 Thread Tom Lane
"Euler Taveira" writes: > When you add exceptions, it starts to complicate the UI. Indeed. It seems like --silent-diff was poorly defined and poorly named, and we need to rethink that option along the way to adding this behavior. The idea that --show-diff and --silent-diff can be used together

Re: How abnormal server shutdown could be detected by tests?

2023-12-12 Thread Alexander Lakhin
Hello Shveta, 12.12.2023 11:44, shveta malik wrote: The postmaster process exits with exit code 1, but pg_ctl can't get the code and just reports that stop was completed successfully. For what it's worth, there is another thread which stated the similar problem:

Re: [PATCH]: Not to invaldiate CatalogSnapshot for local invalidation messages

2023-12-12 Thread Xiaoran Wang
Hi hackers, I would like to give more details of my patch. In postgres, it uses a global snapshot “CatalogSnapshot” to check catalog data visibility. “CatalogSnapshot” is always updated to the latest version to make the latest catalog table content visible. If there is any updating on

Re: SLRU optimization - configurable buffer pool and partitioning the SLRU lock

2023-12-12 Thread Alvaro Herrera
[Added Andrey again in CC, because as I understand they are using this code or something like it in production. Please don't randomly remove people from CC lists.] I've been looking at this some more, and I'm not confident in that the group clog update stuff is correct. I think the injection

Re: Bug in nbtree optimization to skip > operator comparisons (or < comparisons in backwards scans)

2023-12-12 Thread Alexander Korotkov
On Mon, Dec 11, 2023 at 6:16 PM Peter Geoghegan wrote: > Will you be in Prague this week? If not this might have to wait. Sorry, I wouldn't be in Prague this week. Due to my current immigration status, I can't travel. I wish you to have a lovely time in Prague. I'm OK to wait, review once you

Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

2023-12-12 Thread jian he
On Mon, Dec 11, 2023 at 10:05 PM Alena Rybakina wrote: > > Hi! Thank you for your work. Your patch looks better! > Yes, thank you! It works fine, and I see that the regression tests have been > passed.  > However, when I ran 'copy from with save_error' operation with simple csv > files

Re: Synchronizing slots from primary to standby

2023-12-12 Thread Nisha Moond
A review on v45 patch: If one creates a logical slot with failover=true as - select pg_create_logical_replication_slot('logical_slot','pgoutput', false, true, true); Then, uses the existing logical slot while creating a subscription - postgres=# create subscription sub4 connection

Re: Add --check option to pgindent

2023-12-12 Thread Euler Taveira
On Tue, Dec 12, 2023, at 7:28 AM, Michael Banck wrote: > On Tue, Dec 12, 2023 at 11:18:59AM +0100, Daniel Gustafsson wrote: > > > On 12 Dec 2023, at 01:09, Tristan Partin wrote: > > > > > > Not sold on the name, but --check is a combination of --silent-diff > > > and --show-diff. I envision

Re: Show WAL write and fsync stats in pg_stat_io

2023-12-12 Thread Nazir Bilal Yavuz
Hi, Thanks for the feedback! The new version of the patch is attached. On Tue, 5 Dec 2023 at 09:16, Michael Paquier wrote: > > - if (io_op == IOOP_WRITE || io_op == IOOP_EXTEND) > + if (io_op == IOOP_EXTEND || io_op == IOOP_WRITE) > > Unrelated diff. Done. > > + if (io_object ==

Re: brininsert optimization opportunity

2023-12-12 Thread Tomas Vondra
On 12/11/23 16:41, Tomas Vondra wrote: > On 12/11/23 16:00, Alexander Lakhin wrote: >> Hello Tomas and Soumyadeep, >> >> 25.11.2023 23:06, Tomas Vondra wrote: >>> I've done a bit more cleanup on the last version of the patch (renamed >>> the fields to start with bis_ as agreed, rephrased the

Re: Sorting regression of text function result since commit 586b98fdf1aae

2023-12-12 Thread Jehan-Guillaume de Rorthais
On Mon, 11 Dec 2023 15:43:12 -0500 Tom Lane wrote: > Jehan-Guillaume de Rorthais writes: > > It looks like since 586b98fdf1aae, the result type collation of > > "convert_from" is forced to "C", like the patch does for type "name", > > instead of the "default" collation for type "text". > >

Re: Adding facility for injection points (or probe points?) for more advanced tests

2023-12-12 Thread Michael Paquier
On Tue, Dec 12, 2023 at 10:27:09AM +0530, Dilip Kumar wrote: > Oops, I only included the code changes where I am adding injection > points and some comments to verify that, but missed the actual test > file. Attaching it here. I see. Interesting that this requires persistent connections to work.

[meson] expose buildtype debug/optimization info to pg_config

2023-12-12 Thread Junwang Zhao
build system using configure set VAL_CFLAGS with debug and optimization flags, so pg_config will show these infos. Some extensions depend on the mechanism. This patch exposes these flags with a typo fixed together. -- Regards Junwang Zhao

Re: Add --check option to pgindent

2023-12-12 Thread Michael Banck
Hi, On Tue, Dec 12, 2023 at 11:18:59AM +0100, Daniel Gustafsson wrote: > > On 12 Dec 2023, at 01:09, Tristan Partin wrote: > > > > Not sold on the name, but --check is a combination of --silent-diff > > and --show-diff. I envision --check mostly being used in CI > > environments. I recently

Re: Add --check option to pgindent

2023-12-12 Thread Daniel Gustafsson
> On 12 Dec 2023, at 01:09, Tristan Partin wrote: > > Not sold on the name, but --check is a combination of --silent-diff and > --show-diff. I envision --check mostly being used in CI environments. I > recently came across a situation where this behavior would have been useful. > Without

Re: logical decoding and replication of sequences, take 2

2023-12-12 Thread Tomas Vondra
Hi, There's been a lot discussed over the past month or so, and it's become difficult to get a good idea what's the current state - what issues remain to be solved, what's unrelated to this patch, and how to move if forward. Long-running threads tend to be confusing, so I had a short call with

RE: Synchronizing slots from primary to standby

2023-12-12 Thread Zhijie Hou (Fujitsu)
On Monday, December 11, 2023 3:32 PM Peter Smith > > Here are some review comments for v44-0001 > > == > src/backend/replication/slot.c > > > 1. ReplicationSlotCreate > > * during getting changes, if the two_phase option is enabled it can skip > * prepare because by that time

Re: Add isCatalogRel in rmgrdesc

2023-12-12 Thread Drouvot, Bertrand
Hi, On 12/12/23 10:15 AM, Michael Paquier wrote: On Tue, Dec 12, 2023 at 09:23:46AM +0100, Drouvot, Bertrand wrote: Please find attached a patch to add this field in the related rmgrdesc (i.e all the ones that already provide the snapshotConflictHorizon except the one related to

Re: Add isCatalogRel in rmgrdesc

2023-12-12 Thread Michael Paquier
On Tue, Dec 12, 2023 at 09:23:46AM +0100, Drouvot, Bertrand wrote: > Please find attached a patch to add this field in the related rmgrdesc (i.e > all the ones that already provide the snapshotConflictHorizon except the one > related to xl_heap_visible: indeed a new bit was added in its flag field

Re: Synchronizing slots from primary to standby

2023-12-12 Thread shveta malik
On Mon, Dec 11, 2023 at 7:12 PM Amit Kapila wrote: > > On Mon, Dec 11, 2023 at 2:41 PM shveta malik wrote: > > > > > > > > 5. > > > +synchronize_slots(WalReceiverConn *wrconn) > > > { > > > ... > > > ... > > > + /* The syscache access needs a transaction env. */ > > > +

Re: How abnormal server shutdown could be detected by tests?

2023-12-12 Thread shveta malik
On Sat, Dec 9, 2023 at 9:30 AM Alexander Lakhin wrote: > > Hello hackers, > > While studying bug #18158, I've come to the conclusion that the existing > testing infrastructure is unable to detect abnormal situations. of some > kind. > > Just a simple example: > With Assert(0) injected in

planner chooses incremental but not the best one

2023-12-12 Thread Nicolas Lutic
Dear Hackers, I've come across a behaviour of the planner I can't explain. After a migration from 11 to 15 (on RDS) we noticed a degradation in response time on a query, it went from a few seconds to ten minutes. A vacuum(analyze) has been realized to be sure that all is clean. The 'explain

Add isCatalogRel in rmgrdesc

2023-12-12 Thread Drouvot, Bertrand
Hi hackers, 6af1793954 added a new field namely "isCatalogRel" in some WAL records to help detecting row removal conflict during logical decoding from standby. Please find attached a patch to add this field in the related rmgrdesc (i.e all the ones that already provide the