Re: Patch: Add parse_type Function

2024-02-24 Thread Jim Jones
On 24.02.24 14:46, David E. Wheeler wrote: > What’s the protocol for marking a patch ready for committer? I guess after the review of the last assigned reviewer v9 applies cleanly, all tests pass and documentation builds correctly. Just a very small observation: The fact that a completely in

Re: Optimize planner memory consumption for huge arrays

2024-02-24 Thread Tom Lane
I wrote: > Tomas Vondra writes: >> On 2/19/24 16:45, Tom Lane wrote: >>> Tomas Vondra writes: For example, I don't think we expect selectivity functions to allocate long-lived objects, right? So maybe we could run them in a dedicated memory context, and reset it aggressively (after

Re: Relation bulk write facility

2024-02-24 Thread Thomas Munro
On Sun, Feb 25, 2024 at 11:16 AM Thomas Munro wrote: > On Sun, Feb 25, 2024 at 11:06 AM Heikki Linnakangas wrote: > > Regarding the issue at hand, perhaps we should define PG_IO_ALIGN_SIZE as > > 16 on AIX, if that's the best the linker can do on that platform. > > You'll probably get either an

Re: Relation bulk write facility

2024-02-24 Thread Thomas Munro
On Sun, Feb 25, 2024 at 11:06 AM Heikki Linnakangas wrote: > Regarding the issue at hand, perhaps we should define PG_IO_ALIGN_SIZE as 16 > on AIX, if that's the best the linker can do on that platform. You'll probably get either an error or silently fall back to buffered I/O, if direct I/O is e

Re: Relation bulk write facility

2024-02-24 Thread Heikki Linnakangas
On 24 February 2024 23:29:36 EET, Andres Freund wrote: >Hi, > >On 2024-02-24 11:50:24 -0800, Noah Misch wrote: >> > We see this happen with both xlc and gcc (new enough to know how to do >> > this). One idea would be that the AIX *linker* is unable to align it, >> > as that is the common tool-cha

Re: Relation bulk write facility

2024-02-24 Thread Andres Freund
Hi, On 2024-02-24 11:50:24 -0800, Noah Misch wrote: > > We see this happen with both xlc and gcc (new enough to know how to do > > this). One idea would be that the AIX *linker* is unable to align it, > > as that is the common tool-chain component here (and unlike stack and > > heap objects, this

Re: Psql meta-command conninfo+

2024-02-24 Thread Nathan Bossart
On Sat, Feb 17, 2024 at 02:53:43PM +, Maiquel Grassi wrote: > The "pg_stat_ssl" view is available from >= PG 9.5, and the "pg_stat_gssapi" > view is > available from >= PG 12. The "compression" column was removed from the > "pg_stat_ssl" from >= PG 14. All of these cases introduce greater comp

Re: Relation bulk write facility

2024-02-24 Thread Noah Misch
On Sun, Feb 25, 2024 at 09:13:47AM +1300, Thomas Munro wrote: > On Sun, Feb 25, 2024 at 9:12 AM Thomas Munro wrote: > > On Sun, Feb 25, 2024 at 8:50 AM Noah Misch wrote: > > > On GNU/Linux x64, gcc correctly records alignment=2**12 for the associated > > > section (.rodata for bulk_write.o zero_b

Re: Relation bulk write facility

2024-02-24 Thread Thomas Munro
On Sun, Feb 25, 2024 at 9:12 AM Thomas Munro wrote: > On Sun, Feb 25, 2024 at 8:50 AM Noah Misch wrote: > > On GNU/Linux x64, gcc correctly records alignment=2**12 for the associated > > section (.rodata for bulk_write.o zero_buffer, .bss for pg_prewarm.o > > blockbuffer). If I'm reading this ri

Re: Relation bulk write facility

2024-02-24 Thread Thomas Munro
On Sun, Feb 25, 2024 at 8:50 AM Noah Misch wrote: > On GNU/Linux x64, gcc correctly records alignment=2**12 for the associated > section (.rodata for bulk_write.o zero_buffer, .bss for pg_prewarm.o > blockbuffer). If I'm reading this right, neither AIX gcc nor xlc is marking > the section with su

Re: Relation bulk write facility

2024-02-24 Thread Noah Misch
On Sun, Feb 25, 2024 at 07:52:16AM +1300, Thomas Munro wrote: > On Sun, Feb 25, 2024 at 6:24 AM Noah Misch wrote: > > On Fri, Feb 23, 2024 at 04:27:34PM +0200, Heikki Linnakangas wrote: > > > Committed this. Thanks everyone! > > > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mandrill&

Re: Relation bulk write facility

2024-02-24 Thread Thomas Munro
On Sun, Feb 25, 2024 at 6:24 AM Noah Misch wrote: > On Fri, Feb 23, 2024 at 04:27:34PM +0200, Heikki Linnakangas wrote: > > Committed this. Thanks everyone! > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mandrill&dt=2024-02-24%2015%3A13%3A14 > got: > TRAP: failed Assert("(uintptr_t)

Re: Adding OLD/NEW support to RETURNING

2024-02-24 Thread Tomas Vondra
On 12/4/23 13:14, Dean Rasheed wrote: > I have been playing around with the idea of adding support for OLD/NEW > to RETURNING, partly motivated by the discussion on the MERGE > RETURNING thread [1], but also because I think it would be a very > useful addition for other commands (UPDATE in particul

Re: Relation bulk write facility

2024-02-24 Thread Noah Misch
On Fri, Feb 23, 2024 at 04:27:34PM +0200, Heikki Linnakangas wrote: > Committed this. Thanks everyone! https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mandrill&dt=2024-02-24%2015%3A13%3A14 got: TRAP: failed Assert("(uintptr_t) buffer == TYPEALIGN(PG_IO_ALIGN_SIZE, buffer)"), File: "md.c"

Re: Removing unneeded self joins

2024-02-24 Thread Noah Misch
Hello, On Sat, Feb 24, 2024 at 01:02:01PM +0200, Alexander Korotkov wrote: > On Sat, Feb 24, 2024 at 7:12 AM Noah Misch wrote: > > On Sat, Feb 24, 2024 at 12:36:59AM +0200, Alexander Korotkov wrote: > > > On Thu, Feb 22, 2024 at 10:51 AM Andrei Lepikhov > > > wrote: > > > > On 21/2/2024 14:26,

Re: incremental backup mishandles XLOG_DBASE_CREATE_FILE_COPY

2024-02-24 Thread Noah Misch
On Sat, Feb 24, 2024 at 04:16:24PM +0530, Robert Haas wrote: > On Sat, Feb 24, 2024 at 10:05 AM Noah Misch wrote: > > On Fri, Feb 23, 2024 at 08:47:52PM +0530, Robert Haas wrote: > > > I thought about whether there were any other WAL records that have > > > similar problems to XLOG_DBASE_CREATE_FI

Re: Functions to return random numbers in a given range

2024-02-24 Thread Tomas Vondra
Hi Dean, I did a quick review and a little bit of testing on the patch today. I think it's a good/useful idea, and I think the code is ready to go (the code is certainly much cleaner than anything I'd written ...). I do have one minor comments regarding the docs - it refers to "random functions"

Re: locked reads for atomics

2024-02-24 Thread Nathan Bossart
On Fri, Feb 23, 2024 at 05:34:49PM -0800, Andres Freund wrote: > On 2024-02-23 14:58:12 -0600, Nathan Bossart wrote: >> +/* >> + * pg_atomic_write_membarrier_u32 - write with barrier semantics. >> + * >> + * The write is guaranteed to succeed as a whole, i.e., it's not possible to >> + * observe a

Re: RFC: Logging plan of the running query

2024-02-24 Thread James Coleman
On Fri, Feb 23, 2024 at 10:23 AM Robert Haas wrote: > > On Fri, Feb 23, 2024 at 7:50 PM Julien Rouhaud wrote: > > On Fri, Feb 23, 2024 at 10:22:32AM +0530, Robert Haas wrote: > > > On Thu, Feb 22, 2024 at 6:25 AM James Coleman wrote: > > > > This is potentially a bit of a wild idea, but I wonder

Re: Patch: Add parse_type Function

2024-02-24 Thread David E. Wheeler
On Feb 21, 2024, at 19:13, David E. Wheeler wrote: > Thanks. Anyone else? Or is it ready for committer? What’s the protocol for marking a patch ready for committer? Thanks, David

Re: locked reads for atomics

2024-02-24 Thread Andres Freund
Hi, On 2024-02-23 10:25:00 -0800, Jeff Davis wrote: > On Fri, 2024-02-23 at 10:17 -0600, Nathan Bossart wrote: > > The idea is > > to provide an easy way to remove spinlocks, etc. and use atomics for > > less > > performance-sensitive stuff.  The implementations are intended to be > > relatively i

Re: locked reads for atomics

2024-02-24 Thread Andres Freund
Hi, On 2024-02-23 14:58:12 -0600, Nathan Bossart wrote: > +/* > + * pg_atomic_write_membarrier_u32 - write with barrier semantics. > + * > + * The write is guaranteed to succeed as a whole, i.e., it's not possible to > + * observe a partial write for any reader. Note that this correctly > intera

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

2024-02-24 Thread jian he
Hi. I wrote the first draft patch of the documentation. it's under the section: Planner Method Configuration (runtime-config-query.html) but this feature's main meat is in src/backend/parser/parse_expr.c so it may be slightly inconsistent, as mentioned by others. You can further furnish it. v1-0

Re: Removing unneeded self joins

2024-02-24 Thread Alexander Korotkov
Hi, Noah! On Sat, Feb 24, 2024 at 7:12 AM Noah Misch wrote: > On Sat, Feb 24, 2024 at 12:36:59AM +0200, Alexander Korotkov wrote: > > On Thu, Feb 22, 2024 at 10:51 AM Andrei Lepikhov > > wrote: > > > On 21/2/2024 14:26, Richard Guo wrote: > > > > I think the right fix for these issues is to int

Re: incremental backup mishandles XLOG_DBASE_CREATE_FILE_COPY

2024-02-24 Thread Robert Haas
On Sat, Feb 24, 2024 at 10:05 AM Noah Misch wrote: > Regarding records the summarizer potentially can't ignore that don't deal in > relfilenodes, these come to mind: > > XLOG_DBASE_DROP - covered in this thread's patch > XLOG_RELMAP_UPDATE > XLOG_TBLSPC_CREATE > XLOG_TBLSPC_DROP > XLOG_XACT_PREPAR