Re: Inval reliability, especially for inplace updates

2024-10-31 Thread Noah Misch
On Thu, Oct 31, 2024 at 01:01:39PM -0700, Noah Misch wrote: > On Thu, Oct 31, 2024 at 05:00:02PM +0300, Alexander Lakhin wrote: > > I've accidentally discovered an incorrect behaviour caused by commit > > 4eac5a1fa. Running this script: > > Thanks. This looks important. > > > parallel -j40 --lin

Re: define pg_structiszero(addr, s, r)

2024-10-31 Thread Bertrand Drouvot
Hi, On Fri, Nov 01, 2024 at 05:45:44PM +1300, David Rowley wrote: > On Thu, 31 Oct 2024 at 19:17, Michael Paquier wrote: > > Seems kind of OK seen from here. I am wondering if others more > > comments about the name of the macro, its location, the fact that we > > still have pagebytes in bufpage

Re: UUID v7

2024-10-31 Thread Masahiko Sawada
On Thu, Oct 31, 2024 at 9:53 PM Andrey M. Borodin wrote: > > > > > On 1 Nov 2024, at 03:00, Masahiko Sawada wrote: > > > > Therefore, if the > > system clock moves backward due to NTP, we cannot guarantee > > monotonicity and sortability. Is that right? > > Not exactly. Monotonicity is ensured fo

Re: Eager aggregation, take 3

2024-10-31 Thread Richard Guo
On Thu, Oct 31, 2024 at 9:16 PM jian he wrote: > > hi. > still trying to understand v13. found a bug. > > minimum test : > drop table if exists t1, t2; > CREATE TABLE t1 (a int, b int, c int); > CREATE TABLE t2 (a int, b int, c int); > SET enable_eager_aggregate TO on; > explain(costs off, setting

Re: define pg_structiszero(addr, s, r)

2024-10-31 Thread Michael Paquier
On Fri, Nov 01, 2024 at 05:45:44PM +1300, David Rowley wrote: > I think this should be passing BLCKSZ rather than (BLCKSZ / > sizeof(size_t)), otherwise, it'll just check the first 1 kilobyte is > zero rather than the entire page. Ugh, Friday brain fart. The attached should be able to fix that, t

Re: Eager aggregation, take 3

2024-10-31 Thread Richard Guo
On Thu, Oct 31, 2024 at 12:25 AM Robert Haas wrote: > Well, the key thing here is the reasoning, which you don't really > spell out either here or in the patch. The patch's justification for > the use of BTEQUALIMAGE_PROC Is that, if we use non-equal-image > operators, "we may lose some informatio

Re: Eager aggregation, take 3

2024-10-31 Thread Richard Guo
On Wed, Oct 30, 2024 at 5:06 AM Robert Haas wrote: > On Tue, Sep 24, 2024 at 11:20 PM Richard Guo wrote: > > The reason is that it is very tricky to set the size estimates for a > > grouped join relation. For a non-grouped join relation, we know that > > all its paths have the same rowcount esti

Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.

2024-10-31 Thread jian he
On Thu, Oct 31, 2024 at 9:09 PM Amit Langote wrote: > > > I think we should insist that the join key collation and the partition > collation are exactly the same and refuse to match them if they are > not. > > + { > + Oid colloid = exprCollation((Node *) expr); > + > +

Re: Showing applied extended statistics in explain Part 2

2024-10-31 Thread Tatsuro Yamada
Hi All, I apologize for not being able to continue development due to various circumstances. The attached file is the rebased patch. I will now catch up on the discussion and try to revise the patch. Regards, Tatsuro Yamada On Fri, Jul 19, 2024 at 7:17 PM wrote: > > On 7/18/24 12:37, masahiro

Re: UUID v7

2024-10-31 Thread Andrey M. Borodin
> On 1 Nov 2024, at 03:00, Masahiko Sawada wrote: > > Therefore, if the > system clock moves backward due to NTP, we cannot guarantee > monotonicity and sortability. Is that right? Not exactly. Monotonicity is ensured for a given backend. We make sure that timestamp is advanced at least for

Re: define pg_structiszero(addr, s, r)

2024-10-31 Thread David Rowley
On Thu, 31 Oct 2024 at 19:17, Michael Paquier wrote: > Seems kind of OK seen from here. I am wondering if others more > comments about the name of the macro, its location, the fact that we > still have pagebytes in bufpage.c, etc. This change looks incorrect: @@ -126,18 +124,9 @@ PageIsVerified

Re: Relcache refactoring

2024-10-31 Thread Tom Lane
Heikki Linnakangas writes: > I was finally able to reproduce this, by running the failing pg_regress > tests concurrently with repeated "vacuum full pg_database" calls. It's > curious that 'prion' failed on the first run after the commit, I was not > able to reproduce it by just running the unm

Re: Pgoutput not capturing the generated columns

2024-10-31 Thread Peter Smith
On Thu, Oct 31, 2024 at 3:16 AM vignesh C wrote: > Thanks for committing this patch, here is a rebased version of the > remaining patches. > Hi Vignesh. Here are my review comments for the docs patch v1-0002. == Commit message 1. This patch updates docs to describe the new feature allowin

Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.

2024-10-31 Thread Tender Wang
Amit Langote 于2024年10月31日周四 21:09写道: > > 0001 is the patch for the partitionwise grouping issue (bug #18568). > I concluded that even partial aggregate should be disallowed when the > grouping collation doesn't match partitioning collation. The result > with partial partitionwise grouping is not

Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.

2024-10-31 Thread Tender Wang
Amit Langote 于2024年10月31日周四 21:09写道: > On Wed, Oct 30, 2024 at 9:36 PM Junwang Zhao wrote: > > On Wed, Oct 30, 2024 at 11:58 AM jian he > wrote: > > > > > > I missed a case when column collation and partition key collation are > > > the same and indeterministic. > > > that should be fine for pa

Re: Eager aggregation, take 3

2024-10-31 Thread Richard Guo
On Tue, Oct 29, 2024 at 9:59 PM Robert Haas wrote: > On Wed, Sep 25, 2024 at 3:03 AM Richard Guo wrote: > > On Wed, Sep 11, 2024 at 10:52 AM Tender Wang wrote: > > > 1. In make_one_rel(), we have the below codes: > > > /* > > > * Build grouped base relations for each base rel if possible. > > >

Re: Consider the number of columns in the sort cost model

2024-10-31 Thread Andrei Lepikhov
On 10/31/24 21:00, Alena Rybakina wrote: On 29.10.2024 05:47, Andrei Lepikhov wrote: I played around with the examples a bit and couldn't figure out something. When I added the same values ​​to different columns - firstly in a, later in b, the order of the columns for sort operation doesn't ch

Re: Pgoutput not capturing the generated columns

2024-10-31 Thread Peter Smith
On Thu, Oct 31, 2024 at 3:16 AM vignesh C wrote: > Thanks for committing this patch, here is a rebased version of the > remaining patches. > Hi Vignesh, thanks for the rebased patches. Here are my review comments for patch v1-0001. == Commit message. 1. The commit message text is stale, so

Re: [PATCH] Add array_reverse() function

2024-10-31 Thread Michael Paquier
On Thu, Oct 31, 2024 at 11:10:09AM +0900, Michael Paquier wrote: > So it looks rather OK seen from here, as you are proposing. After a second lookup, bumped CATALOG_VERSION_NO, then applied. -- Michael signature.asc Description: PGP signature

Re: Remove useless casts to (void *)

2024-10-31 Thread Bruce Momjian
On Tue, Oct 29, 2024 at 10:20:03AM -0400, Tom Lane wrote: > Peter Eisentraut writes: > > There are a bunch of (void *) casts in the code that don't make sense to > > me. I think some of these were once necessary because char * was used > > in place of void * for some function arguments. And so

Re: libedit history seems to be misbehaving / broken

2024-10-31 Thread Bruce Momjian
On Sun, Oct 27, 2024 at 09:07:44PM +0100, Tomas Vondra wrote: > On 10/27/24 20:03, Tom Lane wrote: > > FWIW, I don't observe any particular misbehavior with the very ancient > > libedit that macOS ships. On Fedora 39, I notice something related to > > what you say: it seems like the "\q" ending a

Re: Making error message more user-friendly with spaces in a URI

2024-10-31 Thread Michael Paquier
On Thu, Oct 31, 2024 at 10:35:41PM +0700, Stepan Neretin wrote: > Hi, Yushi! I could not find this line in the master branch and I couldn't > apply this patch. I only see this error in the test (I think the test > should also be changed), but the idea of fixing the error looks good to me. This lin

Re: pg_upgrade check for invalid databases

2024-10-31 Thread Bruce Momjian
On Fri, Oct 25, 2024 at 01:55:57PM +0200, Daniel Gustafsson wrote: > > On 14 Oct 2024, at 18:57, Bruce Momjian wrote: > > > What might be acceptable would be to add an option that would make > > pg_upgrade more tolerant of problems in many areas, that is a lot more > > research and discussion. >

Re: Time to add a Git .mailmap?

2024-10-31 Thread Michael Paquier
On Thu, Oct 31, 2024 at 02:45:02PM -0500, Nathan Bossart wrote: > On Thu, Oct 31, 2024 at 11:37:13AM +0100, Daniel Gustafsson wrote: >> When looking at our Git tree for a recent conference presentation I happened >> to >> notice that we have recently gained duplicate names in the shortlog. Not >

Re: vacuumdb --analyze-only (e.g., after a major upgrade) vs. partitioned tables: pg_statistic missing stats for the partitioned table itself

2024-10-31 Thread Bruce Momjian
On Thu, Oct 24, 2024 at 02:48:42PM -0700, Nikolay Samokhvalov wrote: > [ACg8ocIyQq] > Nikolay Samokhvalov  2:47 PM (0 minutes ago) >[cleardot] > to pglsql-hackers [cleardot] > [cleardot] > I

Re: Using Expanded Objects other than Arrays from plpgsql

2024-10-31 Thread Michel Pelletier
On Thu, Oct 24, 2024 at 11:32 AM Tom Lane wrote: > I wrote: > > ... I'm still writing up > > details, but right now I'm envisioning completely separate sets of > > rules for the prosupport case versus the no-prosupport case. > > So here is the design I've come up with for optimizing R/W expanded

Re: Using Expanded Objects other than Arrays from plpgsql

2024-10-31 Thread Michel Pelletier
Here's two backtraces from gdb from this function: CREATE OR REPLACE FUNCTION test2(graph matrix) RETURNS bigint LANGUAGE plpgsql AS $$ BEGIN perform set_element(graph, 1, 1, 1); RETURN nvals(graph); end; $$; https://gist.githubusercontent.com/michelp/d02e3e30071044345

Re: Add ExprState hashing for GROUP BY and hashed SubPlans

2024-10-31 Thread David Rowley
On Thu, 31 Oct 2024 at 15:30, Andrei Lepikhov wrote: > Comparing the master with and without your patch, the first, I see is > more extensive usage of memory (see complete explains in the attachment): > > Current master: >Batches: 1 Memory Usage: 74513kB > Patched: >Batches: 261 Memory

Re: UUID v7

2024-10-31 Thread Masahiko Sawada
On Thu, Oct 31, 2024 at 11:46 AM Andrey M. Borodin wrote: > > > > > On 31 Oct 2024, at 22:15, Masahiko Sawada wrote: > > > > On Sat, Oct 26, 2024 at 10:05 AM Andrey M. Borodin > > wrote: > > > > I think we typically avoid this kind of check failure by assigning > > uuidv7() and uuidv7(interval)

Re: Test to dump and restore objects left behind by regression

2024-10-31 Thread Michael Paquier
On Thu, Oct 31, 2024 at 10:26:01AM -0400, Tom Lane wrote: > I'd be okay with adding it in a form where the default behavior > is to do no additional checking. Whether that's worth maintaining > is hard to say though. In terms of maintenance, it would be nice if we are able to minimize the code ad

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Melanie Plageman
Thanks for the review! On Thu, Oct 31, 2024 at 2:13 PM Masahiko Sawada wrote: > > > Some small suggestions: > > + vmbits = visibilitymap_set(vacrel->rel, blkno, buf, > + InvalidXLogRecPtr, > + vmbuffer, InvalidTra

Re: IPC::Run::time[r|out] vs our TAP tests

2024-10-31 Thread Heikki Linnakangas
On 31/10/2024 14:27, Daniel Gustafsson wrote: On 28 Oct 2024, at 11:56, Heikki Linnakangas wrote: On 09/04/2024 20:10, Daniel Gustafsson wrote: =item $session->quit Close the session and clean up resources. Each test run must be closed with C. Returns TRUE when the session was cleanly termina

Re: [PATCH] New predefined role pg_manage_extensions

2024-10-31 Thread Michael Banck
Hi, Even though there has not been a lot of discussion on this, here is a rebased patch. I have also added it to the upcoming commitfest. On Sat, Jan 13, 2024 at 09:20:40AM +0100, Michael Banck wrote: > On Fri, Jan 12, 2024 at 04:13:27PM +0100, Jelte Fennema-Nio wrote: > > But I'm not sure that

Re: In-placre persistance change of a relation

2024-10-31 Thread Heikki Linnakangas
On 31/10/2024 10:01, Kyotaro Horiguchi wrote: After some delays, here’s the new version. In this update, UNDO logs are WAL-logged and processed in memory under most conditions. During checkpoints, they’re flushed to files, which are then read when a specific XID’s UNDO log is accessed for the fir

Re: pg_parse_json() should not leak token copies on failure

2024-10-31 Thread Jacob Champion
On Mon, Oct 7, 2024 at 3:45 PM Jacob Champion wrote: > I've added a 0002 as well. 0002 has since been applied [1] so I'm reattaching v4-0001 to get the cfbot happy again. --Jacob [1] https://git.postgresql.org/cgit/postgresql.git/commit/?id=41b023946d v4-0001-jsonapi-add-lexer-option-to-keep-

Re: make all ereport in gram.y print out relative location

2024-10-31 Thread Tom Lane
I wrote: > I can take a look at this, since it's basically a followup > to 774171c4f. Pushed with some cleanup and further hacking. regards, tom lane

Re: RFC: Extension Packaging & Lookup

2024-10-31 Thread David E. Wheeler
On Oct 31, 2024, at 15:41, David E. Wheeler wrote: > Other Options? > -- > > I kind of like Option 2, as it would allow us to eventually support > non-`CREATE EXTENSION` modules as extensions, too. I imagine distributing, > say `auto_explain` in an extension directory of its own, w

Re: MultiXact\SLRU buffers configuration

2024-10-31 Thread Thom Brown
On Thu, 31 Oct 2024, 17:33 Andrey M. Borodin, wrote: > > > > On 31 Oct 2024, at 17:29, Thom Brown wrote: > > > > On Thu, 31 Oct 2024 at 10:47, Andrey M. Borodin > wrote: > >> > >> > >> > >>> On 29 Oct 2024, at 21:45, Thom Brown wrote: > >>> > >>> It clearly checks for interrupts, but when I sa

Re: Inval reliability, especially for inplace updates

2024-10-31 Thread Noah Misch
On Thu, Oct 31, 2024 at 05:00:02PM +0300, Alexander Lakhin wrote: > I've accidentally discovered an incorrect behaviour caused by commit > 4eac5a1fa. Running this script: Thanks. This looks important. > parallel -j40 --linebuffer --tag .../reproi.sh ::: `seq 40` This didn't reproduce it for me,

Re: Popcount optimization using AVX512

2024-10-31 Thread Nathan Bossart
On Wed, Oct 30, 2024 at 04:10:10PM -0500, Nathan Bossart wrote: > On Wed, Oct 30, 2024 at 08:53:10PM +, Raghuveer Devulapalli wrote: >> BTW, I just realized function attributes for xsave and avx512 don't work >> on MSVC (see >> https://developercommunity.visualstudio.com/t/support-function-targ

RE: Popcount optimization using AVX512

2024-10-31 Thread Devulapalli, Raghuveer
> Here is an updated patch with this change. LGTM. Raghuveer

Re: Time to add a Git .mailmap?

2024-10-31 Thread Nathan Bossart
On Thu, Oct 31, 2024 at 11:37:13AM +0100, Daniel Gustafsson wrote: > When looking at our Git tree for a recent conference presentation I happened > to > notice that we have recently gained duplicate names in the shortlog. Not sure > if we care enough to fix that with a .mailmap, but if we do the

Re: RFC: Extension Packaging & Lookup

2024-10-31 Thread David E. Wheeler
Fellow Humans, I’m working on an updated proposal with more detail, and more comprehensive. But I keep getting a bit caught up on this bit: On Oct 28, 2024, at 18:19, David E. Wheeler wrote: >> * Binary-only extensions might also be installed here; the difference is >> they have no control

Re: Use "protocol options" name instead of "protocol extensions" everywhere

2024-10-31 Thread Jacob Champion
On Thu, Oct 31, 2024 at 7:51 AM Heikki Linnakangas wrote: > Or keep using "protocol extension" and add a paragraph to the docs to > say explicitly that there's no support for extensions to create protocol > extensions. TLS extensions is a good comparison. Of the three proposed, this last one is m

Re: UUID v7

2024-10-31 Thread Stepan Neretin
> > I think we typically avoid this kind of check failure by assigning > > uuidv7() and uuidv7(interval) different C functions that call the > > common function. That is, we have pg_proc entries like: > > > > Done. > > >>> > >>> It's odd to me that only uuid_extract_timestamp() supports UUID v6 in

Re: Using read stream in autoprewarm

2024-10-31 Thread Stepan Neretin
Dear Nazir, At first A quick look it looks good. I will take a closer look at it tomorrow. Could you please let me know about the performance tests and graphics? Best regards, Stepan Neretin!

Re: Multi delete wal IDEA

2024-10-31 Thread Melanie Plageman
On Thu, Oct 31, 2024 at 11:42 AM Stepan Neretin wrote: > > Hi there, hackers! How about trying out an idea to add an analog to save > memory in WAL files for deleting records, similar to multi-insert > optimization? This patch is trying to do just that. Hi, Thanks for the patch! Could you expla

Re: Fix for consume_xids advancing XIDs incorrectly

2024-10-31 Thread Masahiko Sawada
On Wed, Oct 30, 2024 at 12:00 AM Yushi Ogiwara wrote: > > I made a new patch (skip_xid_correctly.diff) that incorporates the > points we discussed: > > 1. Fix the issue that consume_xids consumes nxids+1 XIDs. > 2. Update lastxid when calling GetTopFullTransactionId() to support > nxids==1 case. >

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Melanie Plageman
On Thu, Oct 31, 2024 at 11:56 AM Alastair Turner wrote: > > For user consumption, to reduce the number of puzzled questions, I'd suggest > adding a line to the log output of the form > > visibility map: %u pages set all frozen, up to %u may have been removed from > the table > > rather than appe

Re: UUID v7

2024-10-31 Thread Andrey M. Borodin
> On 31 Oct 2024, at 22:15, Masahiko Sawada wrote: > > On Sat, Oct 26, 2024 at 10:05 AM Andrey M. Borodin > wrote: > > I think we typically avoid this kind of check failure by assigning > uuidv7() and uuidv7(interval) different C functions that call the > common function. That is, we have pg

Re: [PATCH] Improve code coverage of network address functions

2024-10-31 Thread Aleksander Alekseev
Hi Stepan, > Hello Aleksander! I'm a beginner and I would like to see and try your patch. > However, I have never worked with coverage in regression tests for > PostgreSQL. Could you please tell me how it works and help me understand the > process? Thanks! You are going to need some Linux dist

Re: Using read stream in autoprewarm

2024-10-31 Thread Andrey M. Borodin
> On 8 Aug 2024, at 11:32, Nazir Bilal Yavuz wrote: > > Any feedback would be appreciated. I've took a look into the patch. It seems to me that you add new block numbers to the read stream until you have buffers. So when there are no more buffers you will still have some queued blocks. Mayb

Re: MultiXact\SLRU buffers configuration

2024-10-31 Thread Thom Brown
On Thu, 31 Oct 2024 at 10:47, Andrey M. Borodin wrote: > > > > > On 29 Oct 2024, at 21:45, Thom Brown wrote: > > > > It clearly checks for interrupts, but when I saw this issue happen, it > > wasn't interruptible. > > Perhaps, that was different multixacts? > When I was observing this pathology o

Re: UUID v7

2024-10-31 Thread Masahiko Sawada
On Sat, Oct 26, 2024 at 10:05 AM Andrey M. Borodin wrote: > > > > > --- > > - oid | proname | oid | proname > > --+-+-+- > > -(0 rows) > > + oid | proname | oid | proname > > +--+-+--+- > > + 9896 | uuidv7 | 9897 | uuidv7 > > +(1 row) > > > > I th

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Masahiko Sawada
On Wed, Oct 30, 2024 at 2:42 PM Melanie Plageman wrote: > > Vacuum currently counts and logs the number of pages of a relation > with newly frozen tuples. It does not count the number of pages newly > set all-frozen in the visibility map. > > The number of pages set all-frozen in the visibility ma

Re: [PATCH] Improve code coverage of network address functions

2024-10-31 Thread Stepan Neretin
Hello Aleksander! I'm a beginner and I would like to see and try your patch. However, I have never worked with coverage in regression tests for PostgreSQL. Could you please tell me how it works and help me understand the process? Thanks! Best Regards, Stepan Neretin!

Re: WIP: parallel GiST index builds

2024-10-31 Thread Andrey M. Borodin
> On 8 Oct 2024, at 17:05, Tomas Vondra wrote: > > Here's an updated patch adding the queryid. I've took another round of looking through the patch. Everything I see seems correct to me. It just occurred to me that we will have: buffered build, parallel build, sorting build. All 3 aiming to

[PATCH] Add support for displaying database service in psql prompt

2024-10-31 Thread Michael Banck
Hi, I think it might be useful to sometimes display the database service (i.e. what is defined in ~/.pg_service.conf and used via psql service=foo) in the psql prompt, e.g. if you have 'test' and 'prod' services, but both have the same database name. This was also suggested to me during a recent c

Re: meson and check-tests

2024-10-31 Thread Nazir Bilal Yavuz
Hi Ashutosh and Jian, Sorry for the late reply and thanks for the feedback! On Fri, 4 Oct 2024 at 16:13, jian he wrote: > > v3, 0001 documentation: > We can at least write something on > https://wiki.postgresql.org/wiki/Meson about this feature. I agree. It seems that I need to apply for an edi

Re: Changing the default random_page_cost value

2024-10-31 Thread Tom Lane
Bruce Momjian writes: > On Thu, Oct 24, 2024 at 08:01:11PM -0400, Greg Sabino Mullane wrote: >> Okay, but we have no documented logic on why 4.0 was chosen either. :) > Uh, we do, and it is in the docs: > Random access to mechanical disk storage is normally much more > expensive >

Re: Changing the default random_page_cost value

2024-10-31 Thread Bruce Momjian
On Thu, Oct 24, 2024 at 08:01:11PM -0400, Greg Sabino Mullane wrote: > On Mon, Oct 14, 2024 at 5:15 PM Bruce Momjian wrote: > > I am not a fan of this patch.  I don't see why _removing_ the magnetic > part helps because you then have no logic for any 1.2 was chosen. > > > Okay, but we h

Re: "command cannot affect row a second time" in INSERT ... ON CONFLICT

2024-10-31 Thread David G. Johnston
On Thu, Oct 31, 2024 at 9:52 AM Karthik Ramanathan < karthikram.3...@gmail.com> wrote: > I am looking to better understand the applicability of the error message > "command cannot affect row a second time". > > Consider the following table and data: > CREATE TABLE ioc (i int, UNIQUE(i)); > INSERT

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Alastair Turner
On Thu, 31 Oct 2024 at 15:26, Melanie Plageman wrote: > On Thu, Oct 31, 2024 at 11:15 AM Peter Geoghegan wrote: > > > > On Thu, Oct 31, 2024 at 10:22 AM Melanie Plageman > > wrote: > > > It seems a better solution would be to find a way to document it or > > > phrase it clearly in the log. It i

Re: DOCS - pg_replication_slot . Fix the 'inactive_since' description

2024-10-31 Thread Bruce Momjian
On Thu, Oct 24, 2024 at 08:32:54AM +1100, Peter Smith wrote: > Hi. Here are a couple of minor comments. > > 1. > +The time slot synchronization (see +linkend="logicaldecoding-replication-slots-synchronization"/>) > +was most recently stopped. > > /The time slot/The time w

Re: MultiXact\SLRU buffers configuration

2024-10-31 Thread Andrey M. Borodin
> On 31 Oct 2024, at 17:29, Thom Brown wrote: > > On Thu, 31 Oct 2024 at 10:47, Andrey M. Borodin wrote: >> >> >> >>> On 29 Oct 2024, at 21:45, Thom Brown wrote: >>> >>> It clearly checks for interrupts, but when I saw this issue happen, it >>> wasn't interruptible. >> >> Perhaps, that

Re: Use "protocol options" name instead of "protocol extensions" everywhere

2024-10-31 Thread Jelte Fennema-Nio
On Thu, 31 Oct 2024 at 17:09, Robert Haas wrote: > I don't think it's really viable to promise that we'll never talk > about extending anything other than in the context of what CREATE > EXTENSION does. Agreed, but it seems nice to avoid confusion by not overloading terminology, if we can find a

Re: DOCS - pg_replication_slot . Fix the 'inactive_since' description

2024-10-31 Thread Bruce Momjian
On Fri, Oct 18, 2024 at 04:25:33PM +0530, Amit Kapila wrote: > Few comments: > = > 1. > > - True if this slot is currently actively being used > + True if this slot is currently currently being streamed > > > currently shouldn't be used twice. > > 2. > - /* The ti

Re: "command cannot affect row a second time" in INSERT ... ON CONFLICT

2024-10-31 Thread Aleksander Alekseev
Hi Karthik, > I am looking to better understand the applicability of the error message > "command cannot affect row a second time". > > Consider the following table and data: > CREATE TABLE ioc (i int, UNIQUE(i)); > INSERT INTO ioc VALUES (1); > > The following two queries produce different error

Re: Use "protocol options" name instead of "protocol extensions" everywhere

2024-10-31 Thread Jelte Fennema-Nio
On Thu, 31 Oct 2024 at 15:50, Heikki Linnakangas wrote: > Bikeshedding time: Another few options: 4. Protocol enhancement 5. Protocol flag 6. Protocol feature-flag 7. Protocol configuration 8. Protocol parameter One thing to consider is that there's two ways of using them: 1. Turning an optional

"command cannot affect row a second time" in INSERT ... ON CONFLICT

2024-10-31 Thread Karthik Ramanathan
Hello hackers, I am looking to better understand the applicability of the error message "command cannot affect row a second time". Consider the following table and data: CREATE TABLE ioc (i int, UNIQUE(i)); INSERT INTO ioc VALUES (1); The following two queries produce different errors: *Query 1*

Re: Having problems generating a code coverage report

2024-10-31 Thread Aleksander Alekseev
Hi Jian, > > I downgraded to lcov 1.16 [1] and it helped. This is merely a > > workaround of course, not a long-time solution. > > > > [1]: https://github.com/linux-test-project/lcov/releases/tag/v1.16 > > > > -- > > my ubuntu meson version: 0.61.2, which also fails. > with similar errors you've p

[PATCH] Improve code coverage of network address functions

2024-10-31 Thread Aleksander Alekseev
Hi hackers, Recently I played with lcov [1]. In the process it was discovered that the following functions are not executed by our tests: - abbrev(inet) - set_masklen(cidr,int4) - netmask(inet) - hostmask(inet) - inet_client_addr() - inet_client_port() - inet_server_addr() - inet_server_port() T

Re: Relcache refactoring

2024-10-31 Thread Heikki Linnakangas
On 31/10/2024 12:06, Heikki Linnakangas wrote: On 31/10/2024 10:14, Heikki Linnakangas wrote: Committed with those fixes, thanks for the review! There is a failure in the buildfarm animal 'prion', which builds with -DRELCACHE_FORCE_RELEASE -DCATCACHE_FORCE_RELEASE options. I'll look into tha

Re: [PoC] Federated Authn/z with OAUTHBEARER

2024-10-31 Thread Jacob Champion
On Thu, Oct 31, 2024 at 4:05 AM Antonin Houska wrote: > > > And regardless, the library appears to be loaded by every backend during > > > authentication. Why isn't it loaded by postmaster like libraries listed > > > in > > > shared_preload_libraries? fork() would then ensure that the backe

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Peter Geoghegan
On Thu, Oct 31, 2024 at 12:02 PM Robert Haas wrote: > I don't see it quite the same way. I agree that what users are really > concerned about is the excessive number of unfrozen pages in the VM. > But that's not the question here. The question is what should > log_autovacuum_min_duration log. And

Re: Use "protocol options" name instead of "protocol extensions" everywhere

2024-10-31 Thread Robert Haas
On Thu, Oct 31, 2024 at 10:51 AM Heikki Linnakangas wrote: > Bikeshedding time: > > "protocol option" makes me think of GUCs. > > "optional protocol features" perhaps. A bit long though.. > > Or keep using "protocol extension" and add a paragraph to the docs to > say explicitly that there's no sup

Re: small pg_combinebackup improvements

2024-10-31 Thread Robert Haas
On Thu, Oct 31, 2024 at 11:41 AM Bertrand Drouvot wrote: > 0001 looks pretty straightforward and good to me. Thanks for the review. > What about moving the new comment just before the new "else if"? Well, the block comment applies to the whole if-else if-else construction. If we get too many el

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Robert Haas
On Thu, Oct 31, 2024 at 11:15 AM Peter Geoghegan wrote: > Probably not, but I don't think that it's worth worrying about. ISTM > that it's inevitable that somebody might get confused whenever we > expose implementation details such as these. This particular example > doesn't seem particularly conc

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Robert Haas
On Thu, Oct 31, 2024 at 11:49 AM Peter Geoghegan wrote: > The emphasis on the work that one particular VACUUM operation > performed doesn't seem like the most relevant thing to users (I get > why you'd care about it in the context of your work, though). What > matters to users is that the overall

Re: small pg_combinebackup improvements

2024-10-31 Thread Bertrand Drouvot
Hi, On Wed, Oct 30, 2024 at 03:50:53PM -0400, Robert Haas wrote: > Hi, > > Here are two small patches to improve pg_combinebackup slightly. > > 0001: I noticed that there is some logic in reconstruct.c that > constructs a pathname of the form a/b//c instead of a/b/c. AFAICT, > this still works f

Re: minor doc issue in 9.16.2.1.1. Boolean Predicate Check Expressions

2024-10-31 Thread Bruce Momjian
On Fri, Oct 18, 2024 at 10:00:54AM +0800, jian he wrote: > On Fri, Oct 18, 2024 at 2:05 AM Bruce Momjian wrote: > > Yes, updated patch attached. > > > looks good. > > in the meantime, do you think it's necessary to slightly rephrase > jsonb_path_match doc entry: > > currently doc entry: > jsonb_

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Peter Geoghegan
On Thu, Oct 31, 2024 at 11:26 AM Melanie Plageman wrote: > I'm biased because I want the count of pages newly set all-frozen in > the VM for another patch. You think exposing the total number of > all-frozen pages at the end of the vacuum is more useful to users? The emphasis on the work that one

Multi delete wal IDEA

2024-10-31 Thread Stepan Neretin
Hi there, hackers! How about trying out an idea to add an analog to save memory in WAL files for deleting records, similar to multi-insert optimization? This patch is trying to do just that. Best Regards, Stepan Neretin! diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/no

Re: Having problems generating a code coverage report

2024-10-31 Thread jian he
On Thu, Oct 31, 2024 at 10:02 PM Aleksander Alekseev wrote: > > Hi, > > > On Wed, Oct 30, 2024 at 05:26:49PM -0400, Peter Geoghegan wrote: > > > I use Debian unstable for most of my day to day work. Apparently > > > Debian unstable has exactly the same version of lcov as Ubuntu 24.04. > > > > > >

Re: Making error message more user-friendly with spaces in a URI

2024-10-31 Thread Stepan Neretin
> > I made a patch to make the error message more user-friendly when using a > URI to connect a database with psql. > Hi, Yushi! I could not find this line in the master branch and I couldn't apply this patch. I only see this error in the test (I think the test should also be changed), but the id

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Melanie Plageman
On Thu, Oct 31, 2024 at 11:15 AM Peter Geoghegan wrote: > > On Thu, Oct 31, 2024 at 10:22 AM Melanie Plageman > wrote: > > It seems a better solution would be to find a way to document it or > > phrase it clearly in the log. It is true that these pages were set > > all-frozen in the VM. It is jus

Re: Consider the number of columns in the sort cost model

2024-10-31 Thread Alena Rybakina
I played around with the examples a bit and couldn't figure out something. When I added the same values ​​to different columns - firstly in a, later in b, the order of the columns for sort operation doesn't change. Isn't this a mistake? create table a (x1 int, y1 int); create table b (x2 int,

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Peter Geoghegan
On Thu, Oct 31, 2024 at 10:22 AM Melanie Plageman wrote: > It seems a better solution would be to find a way to document it or > phrase it clearly in the log. It is true that these pages were set > all-frozen in the VM. It is just that some of them were later removed. > And we don't know which one

Re: make all ereport in gram.y print out relative location

2024-10-31 Thread Tom Lane
jian he writes: > now changed to > static PartitionStrategy parsePartitionStrategy(char *strategy, int location, > core_yyscan_t yyscanner); I can take a look at this, since it's basically a followup to 774171c4f. regards, tom lane

Re: Use "protocol options" name instead of "protocol extensions" everywhere

2024-10-31 Thread Heikki Linnakangas
On 30/10/2024 15:58, Jelte Fennema-Nio wrote: It was pointed out by Heikki in the thread around protocol-level wait-for-LSN that "protocol extensions" is a pretty confusing name, since it suggests a relation to Postgres extensions. Even though there is no such relationship at all. Attached is a s

Re: Proper object locking for GRANT/REVOKE

2024-10-31 Thread Bertrand Drouvot
Hi, On Mon, Oct 28, 2024 at 04:20:42PM +0100, Peter Eisentraut wrote: > This patch started out as a refactoring, thinking that objectNamesToOids() > in aclchk.c should really mostly be a loop around get_object_address(). > This is mostly true, with a few special cases because the node > representa

Re: Test to dump and restore objects left behind by regression

2024-10-31 Thread Tom Lane
Michael Paquier writes: > On my laptop, testing the plain format adds roughly 12s, in a test > that now takes 1m20s to run vs 1m32s. Enabling regress_dump_formats > and adding three more formats counts for 45s of runtime. For a test > that usually shows up as the last one to finish for a heavily

Re: Count and log pages set all-frozen by vacuum

2024-10-31 Thread Melanie Plageman
Thanks for taking a look, Alastair! On Thu, Oct 31, 2024 at 5:47 AM Alastair Turner wrote: > > The values returned in a case pages are removed (cases where the empty pages > are at the end of the table) are a bit confusing. > > In an example similar to yours, but with a normal vacuum operation,

Re: Having problems generating a code coverage report

2024-10-31 Thread Aleksander Alekseev
Hi, > On Wed, Oct 30, 2024 at 05:26:49PM -0400, Peter Geoghegan wrote: > > I use Debian unstable for most of my day to day work. Apparently > > Debian unstable has exactly the same version of lcov as Ubuntu 24.04. > > > > I've also been unable to generate coverage reports for some time (at > > lea

Re: Consider the number of columns in the sort cost model

2024-10-31 Thread Alena Rybakina
On 29.10.2024 05:47, Andrei Lepikhov wrote: On 10/28/24 16:48, Alena Rybakina wrote: On 23.10.2024 04:39, Andrei Lepikhov wrote: On 15/10/2024 12:15, David Rowley wrote: And the last patch is a demo of how I'm going to use the previous three patches and add one more strategy to improve the ord

Re: Inval reliability, especially for inplace updates

2024-10-31 Thread Alexander Lakhin
Hello Noah, 31.10.2024 04:39, Noah Misch wrote: I had pushed this during the indicated week, before your mail. Reverting it is an option. Let's see if more opinions arrive. I've accidentally discovered an incorrect behaviour caused by commit 4eac5a1fa. Running this script: for ((j=1; j<=100;

Re: Separate memory contexts for relcache and catcache

2024-10-31 Thread Melih Mutlu
Hi Jeff, Jeff Davis , 30 Eki 2024 Çar, 01:00 tarihinde şunu yazdı: > On Wed, 2024-04-03 at 16:12 +0300, Melih Mutlu wrote: > > Rebased. PSA. > > Thank you. I missed your patch and came up with a similar patch over > here: > > > https://www.postgresql.org/message-id/flat/78599c442380ddb5990117e281

Re: Statistics Import and Export

2024-10-31 Thread Corey Huinker
> > > (c) we are considering whether to use an in-place heap update for the > relation stats, so that a large restore doesn't bloat pg_class -- I'd > like feedback on this idea > I'd also like feedback, though I feel very strongly that we should do what ANALYZE does. In an upgrade situation, nea

Re: protocol-level wait-for-LSN

2024-10-31 Thread Jelte Fennema-Nio
On Thu, 31 Oct 2024 at 13:59, Jesper Pedersen wrote: > And, it will be confusing to clean-room implementations: When you have > this startup parameter then you get these message formats, when you have > this startup parameter then you get these message formats -- and what > about combinations ? Li

Re: Wrong result when enable_partitionwise_join is on if collation of PartitionKey and Column is different.

2024-10-31 Thread Amit Langote
On Wed, Oct 30, 2024 at 9:36 PM Junwang Zhao wrote: > On Wed, Oct 30, 2024 at 11:58 AM jian he wrote: > > > > I missed a case when column collation and partition key collation are > > the same and indeterministic. > > that should be fine for partition-wise join. > > so v2 attached. > > > > have_p

  1   2   >