Re: brininsert optimization opportunity

2023-11-26 Thread Richard Guo
On Mon, Nov 27, 2023 at 1:53 PM Soumyadeep Chakraborty < soumyadeep2...@gmail.com> wrote: > On Sun, Nov 26, 2023 at 9:28 PM Richard Guo > wrote: > > It seems that we have an oversight in this commit. If there is no tuple > > that has been inserted, we wouldn't have an available insert state in

Re: [PATCH] pg_convert improvement

2023-11-26 Thread Drouvot, Bertrand
Hi, On 11/24/23 3:32 PM, Yurii Rashkovskii wrote: Hi Bertrand, On Fri, Nov 24, 2023 at 6:26 AM Drouvot, Bertrand mailto:bertranddrouvot...@gmail.com>> wrote: The patch is pretty straightforward, I just have one remark: +       /* if no actual conversion happened, return the original

Re: Catalog domain not-null constraints

2023-11-26 Thread Peter Eisentraut
On 23.11.23 17:38, Alvaro Herrera wrote: If you create a table with column of domain that has a NOT NULL constraint, what happens? I mean, is the table column marked attnotnull, and how does it behave? No, the domain does not affect the catalog entry for the column. This is the same way it

Re: Improve rowcount estimate for UNNEST(column)

2023-11-26 Thread jian he
Hi. Since both array_op_test, arrest both are not dropped at the end of src/test/regress/sql/arrays.sql. I found using table array_op_test test more convincing. select reltuples * 10 as original, reltuples * (select floor(elem_count_histogram[array_length(elem_count_histogram,1)])

RE: Partial aggregates pushdown

2023-11-26 Thread fujii.y...@df.mitsubishielectric.co.jp
Hi Mr.Momjian, Mr.Haas, hackers. > From: Bruce Momjian > Sent: Thursday, November 23, 2023 6:16 AM > On Wed, Nov 22, 2023 at 10:16:16AM +, > fujii.y...@df.mitsubishielectric.co.jp wrote: > > 2. Approach 2 > > (1) Advantages > > (a) No need to add partial aggregate functions to the catalogs

Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

2023-11-26 Thread Alexander Lakhin
Hello Alexander, 27.11.2023 02:43, Alexander Korotkov wrote: v61 looks good to me. I'm going to push it as long as there are no objections. I've looked at the patch set and found a typo: occured And a warning: $ CC=gcc-12 CFLAGS="-Wall -Wextra -Wno-unused-parameter -Wno-sign-compare

Re: [PoC] Improve dead tuple storage for lazy vacuum

2023-11-26 Thread Masahiko Sawada
On Sat, Oct 28, 2023 at 5:56 PM John Naylor wrote: > > I wrote: > > > Seems fine at a glance, thanks. I will build on this to implement > > variable-length values. I have already finished one prerequisite which is: > > public APIs passing pointers to values. > > Since my publishing schedule has

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

2023-11-26 Thread Ashutosh Bapat
On Fri, Nov 24, 2023 at 7:37 PM Michael Paquier wrote: > > On Fri, Nov 24, 2023 at 04:37:58PM +0530, Ashutosh Bapat wrote: > > Interesting idea. For that the callback needs to know the injection > > point name. At least we should pass that to the callback. It's trivial > > thing to do. > > This

Re: pgoutput incorrectly replaces missing values with NULL since PostgreSQL 15

2023-11-26 Thread Amit Kapila
On Fri, Nov 24, 2023 at 7:23 PM Nikhil Benesch wrote: > > Thank you both for reviewing. The updated patch set LGTM. > Pushed! -- With Regards, Amit Kapila.

Re: GUC names in messages

2023-11-26 Thread Tom Lane
Laurenz Albe writes: > On Mon, 2023-11-27 at 13:41 +1100, Peter Smith wrote: >> In the documentation and in the guc_tables.c they are all described in >> MixedCase (e.g. "DateStyle" instead of "datestyle"), so I felt the >> messages should use the same case the documentation, which is why I >>

Re: GUC names in messages

2023-11-26 Thread Laurenz Albe
On Mon, 2023-11-27 at 13:41 +1100, Peter Smith wrote: > TBH, I suspect something fishy about these mixed-case GUCs. > > In the documentation and in the guc_tables.c they are all described in > MixedCase (e.g. "DateStyle" instead of "datestyle"), so I felt the > messages should use the same case

Re: Incorrect comment in tableam.h regarding GetHeapamTableAmRoutine()

2023-11-26 Thread Richard Guo
On Mon, Nov 27, 2023 at 1:50 PM Michael Paquier wrote: > I have noticed that GetHeapamTableAmRoutine() is listed as being a > member of tableamapi.c but it is a convenience routine located in > heapam_handler.c. Shouldn't the header be fixed with something like > the attached? +1. Nice catch.

Re: logical decoding and replication of sequences, take 2

2023-11-26 Thread Amit Kapila
On Mon, Nov 27, 2023 at 6:41 AM Tomas Vondra wrote: > > I've been cleaning up the first two patches to get them committed soon > (adding the decoding infrastructure + test_decoding), cleaning up stale > comments, updating commit messages etc. And I think it's ready to go, > but it's too late

Re: Assert failure on 'list_member_ptr(rel->joininfo, restrictinfo)'

2023-11-26 Thread Ashutosh Bapat
On Mon, Nov 27, 2023 at 6:35 AM Alexander Korotkov wrote: > > On Fri, Nov 24, 2023 at 3:54 PM Alexander Korotkov > wrote: > > > > On Thu, Nov 23, 2023 at 4:33 AM Richard Guo wrote: > > > > > > On Sun, Nov 19, 2023 at 9:17 AM Alexander Korotkov > > > wrote: > > >> > > >> It's here. New

Re: brininsert optimization opportunity

2023-11-26 Thread Soumyadeep Chakraborty
On Sun, Nov 26, 2023 at 9:28 PM Richard Guo wrote: > > > On Sun, Nov 26, 2023 at 4:06 AM 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 comments / docs / >> commit message a bit) and

Incorrect comment in tableam.h regarding GetHeapamTableAmRoutine()

2023-11-26 Thread Michael Paquier
Hi all, I have noticed that GetHeapamTableAmRoutine() is listed as being a member of tableamapi.c but it is a convenience routine located in heapam_handler.c. Shouldn't the header be fixed with something like the attached? Thoughts or comments? -- Michael diff --git

Re: brininsert optimization opportunity

2023-11-26 Thread Richard Guo
On Sun, Nov 26, 2023 at 4:06 AM 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 comments / docs / > commit message a bit) and pushed. It seems that we have an oversight in this commit. If

Re: Postgres picks suboptimal index after building of an extended statistics

2023-11-26 Thread Andrei Lepikhov
Second version of the patch - resolve non-symmetrical decision, thanks to Teodor Sigaev's review. -- regards, Andrei Lepikhov Postgres Professional From 604899b6afe70eccbbdbf69ce254f37808c598db Mon Sep 17 00:00:00 2001 From: "Andrey V. Lepikhov" Date: Mon, 27 Nov 2023 11:23:48 +0700 Subject:

Re: GUC names in messages[

2023-11-26 Thread Michael Paquier
On Mon, Nov 27, 2023 at 01:41:18PM +1100, Peter Smith wrote: > TBH, I suspect something fishy about these mixed-case GUCs. > > In the documentation and in the guc_tables.c they are all described in > MixedCase (e.g. "DateStyle" instead of "datestyle"), so I felt the > messages should use the same

Re: [PATCH] Add CHECK_FOR_INTERRUPTS in scram_SaltedPassword loop.

2023-11-26 Thread Bowen Shi
> I think that we should backpatch that down to v16 at least where the > GUC has been introduced as it's more like a nuisance if one sets the > GUC to an incorrect value, and I'd like to apply the patch this way. Agreed. The patch has been submitted in https://commitfest.postgresql.org/46/4671/

Re: New instability in stats regression test

2023-11-26 Thread Tom Lane
Michael Paquier writes: > With all that in mind and because we have checks for the individual > targets with pg_stat_reset_shared(), I would agree to just remove it > entirely. Say as of the attached? I'm good with that answer --- I doubt that this test sequence is proving anything that's worth

Re: [PATCH] fix race condition in libpq (related to ssl connections)

2023-11-26 Thread Michael Paquier
On Fri, Nov 24, 2023 at 04:48:58PM +0900, Michael Paquier wrote: > I've looked at this idea, and finished by being unhappy with the error > handling that we are currently assuming in my_SSL_set_fd() in the > event of an error in the bio method setup, which would be most likely > an OOM, so let's

Re: initdb --no-locale=C doesn't work as specified when the environment is not C

2023-11-26 Thread Kyotaro Horiguchi
At Wed, 22 Nov 2023 11:04:01 -0500, Tom Lane wrote in > Kyotaro Horiguchi writes: > > Commit 3e51b278db leaves lc_* conf lines as commented-out when > > their value is "C". This leads to the following behavior. > > Hmm ... I see a contributing factor here: this bit in > postgresql.conf.sample

Re: New instability in stats regression test

2023-11-26 Thread Michael Paquier
On Sat, Nov 25, 2023 at 02:34:40PM -0500, Tom Lane wrote: > -- Test that reset_shared with no argument resets all the stats types > -- supported (providing NULL as argument has the same effect). > SELECT pg_stat_reset_shared(); Right, this has switched pg_stat_reset_shared() from doing nothing to

Re: GUC names in messages

2023-11-26 Thread Peter Smith
On Mon, Nov 27, 2023 at 12:44 PM Michael Paquier wrote: > > On Mon, Nov 27, 2023 at 10:04:35AM +1100, Peter Smith wrote: > > On Fri, Nov 24, 2023 at 8:53 PM Alvaro Herrera > > wrote: > >> Yeah. Also, these could be changed to have the GUC name outside the > >> message proper, which would

Re: GUC names in messages

2023-11-26 Thread Tom Lane
Michael Paquier writes: > Is there a reason why we don't just use islower() or is that just to > get something entirely local independent? islower() and related functions are not to be trusted for this purpose. They will certainly give locale-dependent results, and they might give entirely

Re: GUC names in messages

2023-11-26 Thread Michael Paquier
On Mon, Nov 27, 2023 at 10:04:35AM +1100, Peter Smith wrote: > On Fri, Nov 24, 2023 at 8:53 PM Alvaro Herrera > wrote: >> Yeah. Also, these could be changed to have the GUC name outside the >> message proper, which would reduce the total number of messages. (But >> care must be given to the

Re: pg_upgrade and logical replication

2023-11-26 Thread Peter Smith
Here are some review comments for patch set v19* // v19-0001. No comments /// v19-0002. (I saw that both changes below seemed cut/paste from similar functions, but I will ask the questions anyway). == src/backend/commands/subscriptioncmds.c 1. +/* Potentially set by

Re: Assert failure on 'list_member_ptr(rel->joininfo, restrictinfo)'

2023-11-26 Thread Alexander Korotkov
On Fri, Nov 24, 2023 at 3:54 PM Alexander Korotkov wrote: > > On Thu, Nov 23, 2023 at 4:33 AM Richard Guo wrote: > > > > On Sun, Nov 19, 2023 at 9:17 AM Alexander Korotkov > > wrote: > >> > >> It's here. New REALLOCATE_BITMAPSETS forces bitmapset reallocation on > >> each modification. > > >

Re: Add semi-join pushdown to postgres_fdw

2023-11-26 Thread Alexander Korotkov
Hi, Alexander! On Tue, Oct 31, 2023 at 1:07 PM Alexander Pyhalov wrote: > There are several cases when we can't push down semi-join in current > patch. > > 1) When target list has attributes from inner relation, which are > equivalent to some attributes of outer > relation, we fail to notice

Re: [HACKERS] make async slave to wait for lsn to be replayed

2023-11-26 Thread Alexander Korotkov
On Mon, Nov 20, 2023 at 1:10 PM Картышов Иван wrote: > Alexander, thank you for your review and pointing this issues. According to > them I made some fixes and rebase all patch. > > But I can`t repeat your ERROR. Not with hot_standby_feedback = on nor > hot_standby_feedback = off. > > master:

Re: [HACKERS] make async slave to wait for lsn to be replayed

2023-11-26 Thread Alexander Korotkov
On Thu, Nov 23, 2023 at 5:52 AM Bowen Shi wrote: > I used the latest code and found some conflicts while applying. Which PG > version did you rebase? I've successfully applied the patch on bc3c8db8ae. But I've used "patch -p1 < wait_proc_v6.patch", git am doesn't work. -- Regards,

Re: PATCH: Add REINDEX tag to event triggers

2023-11-26 Thread jian he
On Fri, Nov 24, 2023 at 10:44 AM Michael Paquier wrote: > > As far as I can see, this patch is doing too much as presented. Could > you split the patch into more pieces, please? Based on v4 you have > sent, there are refactoring and basic piece parts like: > - Patch to make event triggers

Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

2023-11-26 Thread Alexander Korotkov
Alexander, Maxim, Thank you for revisions. On Thu, Nov 9, 2023 at 6:22 PM Maxim Orlov wrote: > Aleksander Alekseev, > > > Maxim, > > I see both of us accounted for Alexanders feedback and submitted v59. > > Your newer version seems to have issues on cfbot, so resubmitting the > > previous

Re: GUC names in messages

2023-11-26 Thread Peter Smith
On Fri, Nov 24, 2023 at 8:53 PM Alvaro Herrera wrote: > > On 2023-Nov-24, Michael Paquier wrote: > > > On Thu, Nov 23, 2023 at 06:27:04PM +1100, Peter Smith wrote: > > > There may be some changes I've missed, but hopefully, this is a nudge > > > in the right direction. > > > > Thanks for spending

Re: GUC names in messages

2023-11-26 Thread Peter Smith
On Fri, Nov 24, 2023 at 2:11 PM Michael Paquier wrote: > > On Thu, Nov 23, 2023 at 06:27:04PM +1100, Peter Smith wrote: > > There may be some changes I've missed, but hopefully, this is a nudge > > in the right direction. > > Thanks for spending some time on that. > > > +In messages

Re: Improve rowcount estimate for UNNEST(column)

2023-11-26 Thread Tom Lane
Laurenz Albe writes: > On Sat, 2023-11-25 at 09:19 -0800, Paul A Jungwirth wrote: >> Here is a patch to improve rowcount estimates for >> `UNNEST(some_array_column)`. Today we hard code this to 10, but we >> have statistics about array size, so it's easy to use them. > The idea sounds good to

Re: Improve rowcount estimate for UNNEST(column)

2023-11-26 Thread Laurenz Albe
On Sat, 2023-11-25 at 09:19 -0800, Paul A Jungwirth wrote: > Here is a patch to improve rowcount estimates for > `UNNEST(some_array_column)`. Today we hard code this to 10, but we > have statistics about array size, so it's easy to use them. > > I've seen plans where this would make a difference.

Re: Missing docs on AT TIME ZONE precedence?

2023-11-26 Thread Tom Lane
I wrote: > Comparing the precedence list in the grammar with the doc table, > the only omissions I feel bad about are AT and COLLATE. Concretely, as attached. regards, tom lane diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index 37817d0638..4dfbbd0862

Re: Schema variables - new implementation for Postgres 15

2023-11-26 Thread Pavel Stehule
Hi st 22. 11. 2023 v 7:20 odesílatel Julien Rouhaud napsal: > Hi, > > On Tue, Oct 17, 2023 at 08:52:13AM +0200, Pavel Stehule wrote: > > > > When I thought about global temporary tables, I got one maybe interesting > > idea. The one significant problem of global temporary tables is place for >

Re: Schema variables - new implementation for Postgres 15

2023-11-26 Thread Dmitry Dolgov
> On Sat, Nov 18, 2023 at 06:28:53PM +0100, Pavel Stehule wrote: > so 18. 11. 2023 v 15:54 odesílatel Dmitry Dolgov <9erthali...@gmail.com> > napsal: > > As a side note, I'm intended to go one more time through the first few > > patches introducing the basic functionality, and then mark it as

Re: Missing docs on AT TIME ZONE precedence?

2023-11-26 Thread Shay Rojansky
>> Is there a missing line in the operator precedence table in the docs? > > I think the big question is whether AT TIME ZONE is significant enough > to list there because there are many other clauses we could potentially > add there. Just to give more context, I'm a maintainer on Entity

Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement

2023-11-26 Thread Tom Lane
Ivan Trofimov writes: > Afaik changing prepared statement result structure is prohibited by > Postgres server-side, and should always lead to "ERROR: cached plan > must not change result type", see src/test/regress/sql/plancache.sql. Independently of whether we're willing to guarantee that that

Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement

2023-11-26 Thread Ivan Trofimov
In a presumably very common case of repeatedly executing the same statement, this leads to both client and server parsing/sending exactly the same RowDescritpion data over and over again. Instead, library user could acquire a statement result RowDescription once (via PQdescribePrepared), and

Re: Missing docs on AT TIME ZONE precedence?

2023-11-26 Thread Tom Lane
Bruce Momjian writes: > On Sun, Nov 26, 2023 at 11:13:39AM +0100, Shay Rojansky wrote: >> Is there a missing line in the operator precedence table in the docs? > I think the big question is whether AT TIME ZONE is significant enough > to list there because there are many other clauses we could

Re: Should timezone be inherited from template database?

2023-11-26 Thread Anton A. Melnikov
On 26.11.2023 18:53, David G. Johnston wrote: https://www.postgresql.org/docs/current/sql-createdatabase.html  Database-level configuration parameters (set via ALTER DATABASE) and database-level permissions (set via GRANT)

Re: Should timezone be inherited from template database?

2023-11-26 Thread David G. Johnston
On Sun, Nov 26, 2023 at 7:47 AM Anton A. Melnikov wrote: > > postgres=# ALTER DATABASE template1 SET TimeZone = 'UTC'; > > Could you clarify please. Is this normal, predictable behavior? > > https://www.postgresql.org/docs/current/sql-createdatabase.html Database-level configuration parameters

Should timezone be inherited from template database?

2023-11-26 Thread Anton A. Melnikov
Hello! Found that if i set a specific time zone for a template database, it will not be inherited in the database created from that template. psql (17devel) Type "help" for help. postgres=# select now(); now --- 2023-11-26 17:24:58.242086+03 (1 row)

Re: Missing docs on AT TIME ZONE precedence?

2023-11-26 Thread Bruce Momjian
On Sun, Nov 26, 2023 at 11:13:39AM +0100, Shay Rojansky wrote: > Greeting hackers, > > In the operator precedence table[1] table, AT TIME ZONE isn't explicitly > listed > out; that means it's to be interpreted in the "any other operator category". > > However, it seems that the precedence of AT

Missing docs on AT TIME ZONE precedence?

2023-11-26 Thread Shay Rojansky
Greeting hackers, In the operator precedence table[1] table, AT TIME ZONE isn't explicitly listed out; that means it's to be interpreted in the "any other operator category". However, it seems that the precedence of AT TIME ZONE is actually higher than that of the addition operator: -- Fails

Re: Add recovery to pg_control and remove backup_label

2023-11-26 Thread Stephen Frost
Greetings, * David Steele (da...@pgmasters.net) wrote: > On 11/21/23 12:41, Andres Freund wrote: > > Sure. They also receive a backup_label today. If an external solution > > forgets > > to replace pg_control copied as part of the filesystem copy, they won't get > > an > > error after the