Why does BitmapPrefetch() skip fetch based on current block recheck flag

2024-02-12 Thread Melanie Plageman
Hi, I noticed that in the following code in BitmapPrefetch(), we use the current block's TBMIterateResult->recheck when deciding whether or not to prefetch the block returned by tbm_iterate() (which is very likely a different block). Why not use TBMIterateResult->recheck for the block we are

Re: glibc qsort() vulnerability

2024-02-12 Thread Nathan Bossart
On Mon, Feb 12, 2024 at 06:09:06PM +0100, Mats Kindahl wrote: > Here are the two fixed patches. These patches look pretty good to me. Barring additional feedback, I'll plan on committing them in the next few days. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com

Re: ALTER TYPE OWNER fails to recurse to multirange

2024-02-12 Thread Tom Lane
Robert Haas writes: > On Tue, Jan 16, 2024 at 11:46 AM Tom Lane wrote: >> Also, we already >> treat the multirange as dependent for some things: > But this seems like an entirely valid point. Yeah, it's a bit of a muddle. But there is no syntax for making a standalone multirange type, so it

Re: backend *.c #include cleanup (IWYU)

2024-02-12 Thread Andres Freund
Hi, On 2024-02-12 16:46:55 -0500, Tom Lane wrote: > Peter Eisentraut writes: > > Approaches like that as well as the in-tree pgrminclude work by "I > > removed the #include and it still compiled fine", which can be > > unreliable. IWYU on the other hand has the compiler tracking where a > >

Re: glibc qsort() vulnerability

2024-02-12 Thread Nathan Bossart
On Mon, Feb 12, 2024 at 01:31:30PM -0800, Andres Freund wrote: > One thing that's worth checking is if this ends up with *worse* code when the > comparators are inlined. I think none of the changed comparators will end up > getting used with an inlined sort, but ... Yeah, AFAICT the only inlined

Re: [PATCH] Add native windows on arm64 support

2024-02-12 Thread Andrew Dunstan
On 2024-02-12 Mo 11:44, Dave Cramer wrote: Dave Cramer www.postgres.rocks On Mon, 12 Feb 2024 at 09:19, Andrew Dunstan wrote: On 2024-02-12 Mo 08:51, Dave Cramer wrote: On Sat, 10 Feb 2024 at 13:28, Andrew Dunstan wrote: On 2024-02-10 Sa 12:20, Dave Cramer wrote:

Re: Patch: Add parse_type Function

2024-02-12 Thread Pavel Stehule
po 12. 2. 2024 v 19:20 odesílatel Tom Lane napsal: > I wrote: > > It strikes me that this is basically to_regtype() with the additional > > option to return the typmod. That leads to some questions: > > BTW, another way that this problem could be approached is to use > to_regtype() as-is, with

Re: Patch: Add parse_type Function

2024-02-12 Thread Tom Lane
"David E. Wheeler" writes: > [ v4-0001-Add-parse_type-SQL-function.patch ] It strikes me that this is basically to_regtype() with the additional option to return the typmod. That leads to some questions: * Should we choose a name related to to_regtype? I don't have any immediate suggestions,

Re: backend *.c #include cleanup (IWYU)

2024-02-12 Thread Andres Freund
Hi, On 2024-02-10 08:40:43 +0100, Peter Eisentraut wrote: > So as a test, I ran IWYU over the backend *.c files and removed all the > #includes it suggested. (Note that IWYU also suggests to *add* a bunch of > #includes, in fact that is its main purpose; I didn't do this here.) In some > cases,

Re: [PATCH] Add native windows on arm64 support

2024-02-12 Thread Andres Freund
Hi, On 2024-02-12 12:50:12 -0800, Andres Freund wrote: > On 2024-02-12 13:28:40 -0500, Andrew Dunstan wrote: > I wonder if this indicates that we are either missing memory barriers > somewhere or that the memory barriers we end up with on msvc + arm aren't > correct? Either could explain why the

Re: [PoC] Reducing planning time when tables have many partitions

2024-02-12 Thread Alena Rybakina
Hi! Sorry my delayed reply too. On 17.01.2024 12:33, Yuya Watari wrote: Hello Alena, Thank you for your quick response, and I'm sorry for my delayed reply. On Sun, Dec 17, 2023 at 12:41 AM Alena Rybakina wrote: I thought about this earlier and was worried that the index links of the

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2024-02-12 Thread Andres Freund
Hi, On 2024-02-12 11:33:24 -0800, Jeff Davis wrote: > On Wed, 2024-01-31 at 14:30 +0530, Bharath Rupireddy wrote: > > Please see the attached v22 patch set. > > Committed 0001. Yay, I think this is very cool. There are plenty other improvements than can be based on this... One thing I'm a bit

Re: Popcount optimization using AVX512

2024-02-12 Thread Andres Freund
Hi, On 2024-02-12 20:14:06 +, Amonson, Paul D wrote: > > > +# Check for header immintrin.h > > ... > > Do these all actually have to link? Invoking the linker is slow. > > I think you might be able to just use cc.has_header_symbol(). > > I took this to mean the last of the 3 new blocks.

Re: [PATCH] Add native windows on arm64 support

2024-02-12 Thread Andres Freund
Hi, On 2024-02-09 15:32:10 -0500, Dave Cramer wrote: > On Fri, 9 Feb 2024 at 14:36, Andres Freund wrote: > > That's something like a segfault. > > > > One suspicion I have is that src/port/pg_crc32c_armv8_choose.c possibly > > doesn't properly support msvc. It seems to assume that SIGILL can be

Re: Psql meta-command conninfo+

2024-02-12 Thread Pavel Luzanov
Hi, On 12.02.2024 17:16, Maiquel Grassi wrote: The "if (db == NULL)" has been removed, as well as the message inside it. To always maintain the same error messages, I changed the validation of "\conninfo" to match the validation used for "\conninfo+". Therefore, now "\conninfo" and

Re: Document efficient self-joins / UPDATE LIMIT techniques.

2024-02-12 Thread Corey Huinker
> > Do you plan to add it to the commitfest? If yes, I'd set it "ready for > committer". > > Commitfest entry reanimated.

RE: Popcount optimization using AVX512

2024-02-12 Thread Amonson, Paul D
My responses with questions, > > +# XXX: The configure.ac check for __cpuidex() is broken, we don't > > +copy that # here. To prevent problems due to two detection methods > > +working, stop # checking after one. > > This seems like a bogus copy-paste. My bad. Will remove the offending

Fix a typo in pg_rotate_logfile

2024-02-12 Thread Bharath Rupireddy
Hi, I happened to notice a typo in pg_rotate_logfile in ipc/signalfuncs.c - the hint message wrongly mentions that pg_logfile_rotate is part of the core; which is actually not. pg_logfile_rotate is an adminpack's 1.0 SQL function dropped in 2.0. The core defines pg_rotate_logfile SQL function

Re: [PATCH] Add native windows on arm64 support

2024-02-12 Thread Dave Cramer
On Mon, 12 Feb 2024 at 15:50, Andres Freund wrote: > Hi, > > On 2024-02-12 13:28:40 -0500, Andrew Dunstan wrote: > > On 2024-02-12 Mo 11:44, Dave Cramer wrote: > > > OK, so I have managed to get a debugger attached to postgres.exe when > it > > > faults and the fault occurs at > > > >

Re: Fix a typo in pg_rotate_logfile

2024-02-12 Thread Daniel Gustafsson
> On 12 Feb 2024, at 21:46, Nathan Bossart wrote: > > On Mon, Feb 12, 2024 at 09:39:06PM +0100, Daniel Gustafsson wrote: >>> On 12 Feb 2024, at 21:32, Bharath Rupireddy >>> wrote: >>> I happened to notice a typo in pg_rotate_logfile in ipc/signalfuncs.c >>> - the hint message wrongly mentions

Re: make dist using git archive

2024-02-12 Thread Tristan Partin
On Sun Feb 11, 2024 at 5:09 PM CST, Peter Eisentraut wrote: Small update: I noticed that on Windows (at least the one that is running the CI job), I need to use git -c core.autocrlf=false, otherwise git archive does line-ending conversion for the files it puts into the archive. With this fix,

Re: Fix a typo in pg_rotate_logfile

2024-02-12 Thread Nathan Bossart
On Mon, Feb 12, 2024 at 09:39:06PM +0100, Daniel Gustafsson wrote: >> On 12 Feb 2024, at 21:32, Bharath Rupireddy >> wrote: >> I happened to notice a typo in pg_rotate_logfile in ipc/signalfuncs.c >> - the hint message wrongly mentions that pg_logfile_rotate is part of >> the core; which is

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2024-02-12 Thread Jeff Davis
On Mon, 2024-02-12 at 12:18 -0800, Andres Freund wrote: > +    upto = Min(startptr + count, LogwrtResult.Write); > +    nbytes = upto - startptr; > > Shouldn't it pretty much be a bug to ever encounter this? In the current code it's impossible, though Bharath hinted at an extension which could

Re: Popcount optimization using AVX512

2024-02-12 Thread Nathan Bossart
On Sat, Feb 10, 2024 at 03:52:38PM -0800, Noah Misch wrote: > On Fri, Feb 09, 2024 at 08:33:23PM -0800, Andres Freund wrote: >> My understanding is that the ifunc mechanism just avoid the need for repeated >> indirect calls/jumps to implement a single function call, not the use of >> indirect

Re: Patch: Add parse_type Function

2024-02-12 Thread David E. Wheeler
On Feb 12, 2024, at 12:53 PM, Tom Lane wrote: > "David E. Wheeler" writes: >> [ v4-0001-Add-parse_type-SQL-function.patch ] > > It strikes me that this is basically to_regtype() with the additional > option to return the typmod. That leads to some questions: Huh. I saw it more on a par with

Re: psql's FETCH_COUNT (cursor) is not being respected for CTEs

2024-02-12 Thread Daniel Verite
Jakub Wartak wrote: > when I run with default pager (more or less): > \set FETCH_COUNT 1000 > WITH data AS (SELECT generate_series(1, 2000) as Total) select > repeat('a',100) || data.Total || repeat('b', 800) as total_pat from > data; > -- it enters pager, a skip couple of pages and

Re: Reducing output size of nodeToString

2024-02-12 Thread Matthias van de Meent
On Mon, 12 Feb 2024 at 19:03, Matthias van de Meent wrote: > Attached is patchset v2, which contains the improvements from these patches: Attached v3, which fixes an out-of-bounds read in pg_strtoken_next, detected by asan, that was a likely cause of the problems in CFBot's FreeBSD regression

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2024-02-12 Thread Jeff Davis
On Wed, 2024-01-31 at 14:30 +0530, Bharath Rupireddy wrote: > Please see the attached v22 patch set. Committed 0001. For 0002 & 0003, I'd like more clarity on how they will actually be used by an extension. For 0004, we need to resolve why callers are using XLOG_BLCKSZ and we can fix that

Re: backend *.c #include cleanup (IWYU)

2024-02-12 Thread Alvaro Herrera
On 2024-Feb-10, Peter Eisentraut wrote: > So as a test, I ran IWYU over the backend *.c files and removed all the > #includes it suggested. (Note that IWYU also suggests to *add* a bunch of > #includes, in fact that is its main purpose; I didn't do this here.) In some > cases, a more specific

Add test module for verifying backtrace functionality

2024-02-12 Thread Bharath Rupireddy
Hi, Postgres has a good amount of code for dealing with backtraces - two GUCs backtrace_functions and backtrace_on_internal_error, errbacktrace; all of which use core function set_backtrace from elog.c. I've not seen this code being tested at all, see code coverage report -

Re: glibc qsort() vulnerability

2024-02-12 Thread Fabrízio de Royes Mello
On Mon, Feb 12, 2024 at 5:51 PM Nathan Bossart wrote: > > On Mon, Feb 12, 2024 at 06:09:06PM +0100, Mats Kindahl wrote: > > Here are the two fixed patches. > > These patches look pretty good to me. Barring additional feedback, I'll > plan on committing them in the next few days. > Also did some

Re: Things I don't like about \du's "Attributes" column

2024-02-12 Thread Pavel Luzanov
On 28.01.2024 22:51, Pavel Luzanov wrote: I'll think about it and try to implement in the next patch version within a few days. Sorry for delay. Please look at v4. I tried to implement all of David's suggestions. The only addition - "Login" column. I still thinks this is important

[Patch] add multiple client certificate selection feature

2024-02-12 Thread Cary Huang
Hello I would like to share a patch that adds a feature to libpq to automatically select the best client certificate to send to the server (if it requests one). This feature is inspired by this email discussion years ago:

Re: Patch: Add parse_type Function

2024-02-12 Thread Tom Lane
I wrote: > It strikes me that this is basically to_regtype() with the additional > option to return the typmod. That leads to some questions: BTW, another way that this problem could be approached is to use to_regtype() as-is, with a separate function to obtain the typmod: select

Re: glibc qsort() vulnerability

2024-02-12 Thread Andres Freund
Hi, On 2024-02-12 14:51:38 -0600, Nathan Bossart wrote: > On Mon, Feb 12, 2024 at 06:09:06PM +0100, Mats Kindahl wrote: > > Here are the two fixed patches. > > These patches look pretty good to me. Barring additional feedback, I'll > plan on committing them in the next few days. One thing

Re: Reducing output size of nodeToString

2024-02-12 Thread Matthias van de Meent
On Wed, 31 Jan 2024 at 18:47, Robert Haas wrote: > > On Wed, Jan 31, 2024 at 11:17 AM Matthias van de Meent > wrote: > > I was also thinking about smaller per-attribute expression storage, for > > index attribute expressions, table default expressions, and functions. > > Other than that, less

Re: Collation version tracking for macOS

2024-02-12 Thread Jeff Davis
On Sun, 2024-02-11 at 22:04 +0530, Robert Haas wrote: > 1. Here's what we think your OS package manager is probably going to > do. > 2. That's going to interact with PostgreSQL in this way that I will > now describe. > 3. See, that sucks, because of the stuff I said above about needing > stable

Re: Fix a typo in pg_rotate_logfile

2024-02-12 Thread Daniel Gustafsson
> On 12 Feb 2024, at 21:32, Bharath Rupireddy > wrote: > I happened to notice a typo in pg_rotate_logfile in ipc/signalfuncs.c > - the hint message wrongly mentions that pg_logfile_rotate is part of > the core; which is actually not. pg_logfile_rotate is an adminpack's > 1.0 SQL function

Re: [PATCH] Add native windows on arm64 support

2024-02-12 Thread Andres Freund
Hi, On 2024-02-12 13:28:40 -0500, Andrew Dunstan wrote: > On 2024-02-12 Mo 11:44, Dave Cramer wrote: > > OK, so I have managed to get a debugger attached to postgres.exe when it > > faults and the fault occurs at > >

Re: Fix a typo in pg_rotate_logfile

2024-02-12 Thread Bharath Rupireddy
On Tue, Feb 13, 2024 at 2:29 AM Daniel Gustafsson wrote: > > On that note though, we might want to consider just dropping it altogether in > v17 (while fixing the incorrect hint in backbranches)? I can't imagine > adminpack 1.0 being in heavy use today, and skimming pgAdmin code it seems > it's

Re: backend *.c #include cleanup (IWYU)

2024-02-12 Thread Tom Lane
Peter Eisentraut writes: > Approaches like that as well as the in-tree pgrminclude work by "I > removed the #include and it still compiled fine", which can be > unreliable. IWYU on the other hand has the compiler tracking where a > symbol actually came from, and so if it says that an #include

Re: Reducing output size of nodeToString

2024-02-12 Thread Matthias van de Meent
On Mon, 12 Feb 2024 at 20:32, Matthias van de Meent wrote: > > On Mon, 12 Feb 2024 at 19:03, Matthias van de Meent > wrote: > > Attached is patchset v2, which contains the improvements from these patches: > > Attached v3, which fixes an out-of-bounds read in pg_strtoken_next, > detected by asan,

Re: Built-in CTYPE provider

2024-02-12 Thread Jeff Davis
On Wed, 2024-02-07 at 10:53 +0100, Peter Eisentraut wrote: > Various comments are updated to include the term "character class".  > I > don't recognize that as an official Unicode term.  There are > categories > and properties.  Let's check this. It's based on

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2024-02-12 Thread Jeff Davis
On Mon, 2024-02-12 at 11:33 -0800, Jeff Davis wrote: > For 0002 & 0003, I'd like more clarity on how they will actually be > used by an extension. In patch 0002, I'm concerned about calling WaitXLogInsertionsToFinish(). It loops through all the locks, but doesn't have any early return path or

RE: Synchronizing slots from primary to standby

2024-02-12 Thread Zhijie Hou (Fujitsu)
On Tuesday, February 13, 2024 9:16 AM Zhijie Hou (Fujitsu) wrote: > > Here is the new version patch which addressed above and most of Bertrand's > comments. > > TODO: trying to add one test for the case the slot is valid on primary while > the > synced slots is invalidated on the standby.

Re: Synchronizing slots from primary to standby

2024-02-12 Thread Amit Kapila
On Tue, Feb 13, 2024 at 9:38 AM Zhijie Hou (Fujitsu) wrote: > > Here is the V85_2 patch set that added the test and fixed one typo, > there are no other code changes. > Few comments on the latest changes: == 1. +# Confirm that the invalidated slot has been dropped.

Re: RFC: Logging plan of the running query

2024-02-12 Thread torikoshia
On 2024-02-07 19:14, torikoshia wrote: On 2024-02-07 13:58, Ashutosh Bapat wrote: The prologue refers to a very populated lock hash table. I think that will happen if thousands of tables are queried in a single query OR a query runs on a partitioned table with thousands of partitions. May be

RE: Synchronizing slots from primary to standby

2024-02-12 Thread Zhijie Hou (Fujitsu)
On Monday, February 12, 2024 6:03 PM Bertrand Drouvot wrote: > > Hi, > > On Sun, Feb 11, 2024 at 01:23:19PM +, Zhijie Hou (Fujitsu) wrote: > > On Saturday, February 10, 2024 9:10 PM Amit Kapila > wrote: > > > > > > On Sat, Feb 10, 2024 at 5:31 PM Masahiko Sawada > > > > > > wrote: > > >

RE: Synchronizing slots from primary to standby

2024-02-12 Thread Zhijie Hou (Fujitsu)
On Monday, February 12, 2024 5:40 PM Amit Kapila wrote: > > On Sun, Feb 11, 2024 at 6:53 PM Zhijie Hou (Fujitsu) > wrote: > > > > Agreed. Here is the V84 patch which addressed this. > > > > Few comments: > = > 1. Isn't the new function (pg_sync_replication_slots()) allowed to sync

Re: LogwrtResult contended spinlock

2024-02-12 Thread Jeff Davis
On Fri, 2022-09-23 at 10:49 +0200, Alvaro Herrera wrote: > On 2022-Jul-28, Alvaro Herrera wrote: > > > v10 is just a trivial rebase.  No changes.  Moved to next > > commitfest. > > I realized that because of commit e369f3708636 this change is no > longer > as critical as it used to be, so I'm

Re: Synchronizing slots from primary to standby

2024-02-12 Thread shveta malik
On Tue, Feb 13, 2024 at 6:45 AM Zhijie Hou (Fujitsu) wrote: > > On Monday, February 12, 2024 5:40 PM Amit Kapila > wrote: > > Thanks for the comments, I have addressed them. > > Here is the new version patch which addressed above and > most of Bertrand's comments. Thanks for the patch. I am

Fix incorrect PG_GETARG in pgcrypto

2024-02-12 Thread shihao zhong
Hi hackers, I'd like to bring to your attention that I recently identified some functions in pgcrypto that are using PG_GETARG functions in a way that doesn't match the expected function signature of the stored procedures. This patch proposes a solution to address these inconsistencies and ensure

Re: Statistics Import and Export

2024-02-12 Thread Corey Huinker
> > Also, it says "statistics are replaced" but it's quite clear if that > applies only to matching statistics or if all stats are deleted first > and then the new stuff is inserted. (FWIW remove_pg_statistics clearly > deletes all pre-existing stats). > All are now deleted first, both in the

Do away with zero-padding assumption before WALRead()

2024-02-12 Thread Bharath Rupireddy
Hi, I noticed an assumption [1] at WALRead() call sites expecting the flushed WAL page to be zero-padded after the flush LSN. I think this can't always be true as the WAL can get flushed after determining the flush LSN before reading it from the WAL file using WALRead(). I've hacked the code up a

Re: Possibility to disable `ALTER SYSTEM`

2024-02-12 Thread Joel Jacobson
On Sun, Feb 11, 2024, at 14:58, Robert Haas wrote: > It's not entirely clear to me what our wider vision is here. Some > people seem to want a whole series of flags that can disable various > things that the superuser might otherwise be able to do, Yes, that's what bothers me a little with the

Re: glibc qsort() vulnerability

2024-02-12 Thread Andres Freund
Hi, On 2024-02-12 17:04:23 -0600, Nathan Bossart wrote: > On Mon, Feb 12, 2024 at 01:31:30PM -0800, Andres Freund wrote: > > One thing that's worth checking is if this ends up with *worse* code when > > the > > comparators are inlined. I think none of the changed comparators will end up > >

Re: Where can I find the doxyfile?

2024-02-12 Thread John Morris
Update: another patch with 1) suggested changes, 2) delete old html before generating new, and 3) added flex names for the more complex regular expressions. Exercising the “ninja doxygen” command, brought up some issues. 1. The generated html directory contained old as well as new pages.

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2024-02-12 Thread Jeff Davis
On Mon, 2024-02-12 at 15:36 -0800, Andres Freund wrote: > > It doesn't really seem like a necessary, or even particularly useful, > part. You couldn't just call WALRead() for that, since the caller > would need > to know the range up to which WAL is valid but not yet flushed as > well. Thus > the

Re: RFC: Logging plan of the running query

2024-02-12 Thread torikoshia
On 2024-02-12 09:00, jian he wrote: Thanks for you comments. On Mon, Jan 29, 2024 at 9:02 PM torikoshia wrote: Hi, Updated the patch to fix typos and move ProcessLogQueryPlanInterruptActive from errfinish() to AbortTransaction. + + + + pg_log_query_plan +

Re: Collation version tracking for macOS

2024-02-12 Thread Robert Haas
On Tue, Feb 13, 2024 at 1:55 AM Jeff Davis wrote: > Postgres can and does latch on to the version of ICU it was compiled > against. It's a normal shared library dependency. > > The problem is that databases -- and the file structures -- outlive a > particular version of Postgres. So if Postgres

Re: Built-in CTYPE provider

2024-02-12 Thread Peter Eisentraut
On 13.02.24 03:01, Jeff Davis wrote: 1. The SQL spec mentions the capitalization of "ß" as "SS" specifically. Should UCS_BASIC use the unconditional mappings in SpecialCasing.txt? I already have some code to do that (not posted yet). It is my understanding that "correct" Unicode case

Re: [PATCH] Add native windows on arm64 support

2024-02-12 Thread Thomas Munro
On Sat, Feb 10, 2024 at 8:36 AM Andres Freund wrote: > Also, yikes, that's an ugly way of doing hardware detection. Jumping out of a > signal handler into normal code. Brrr. Maybe it's a little baroque but what's actually wrong with it? OpenSSL does something similar during initialisation as a

Re: make dist using git archive

2024-02-12 Thread Peter Eisentraut
On 12.02.24 18:26, Tristan Partin wrote: On Sun Feb 11, 2024 at 5:09 PM CST, Peter Eisentraut wrote: Small update: I noticed that on Windows (at least the one that is running the CI job), I need to use git -c core.autocrlf=false, otherwise git archive does line-ending conversion for the files

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2024-02-12 Thread Andres Freund
Hi, On 2024-02-12 12:46:00 -0800, Jeff Davis wrote: > On Mon, 2024-02-12 at 12:18 -0800, Andres Freund wrote: > > +    upto = Min(startptr + count, LogwrtResult.Write); > > +    nbytes = upto - startptr; > > > > Shouldn't it pretty much be a bug to ever encounter this? > > In the current code

Re: Documentation to upgrade logical replication cluster

2024-02-12 Thread vignesh C
On Mon, 12 Feb 2024 at 14:33, vignesh C wrote: > > On Fri, 9 Feb 2024 at 12:30, Peter Smith wrote: > > > > Here are some review comments for patch v7-0001. > > > > == > > doc/src/sgml/glossary.sgml > > > > 1. > > + > > + Logical replication cluster > > + > > + > > + A set of

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

2024-02-12 Thread jian he
rightop is not Const, it will be CollateExpr, it will not be used in transformation. - Maybe the previous thread mentioned it, but this thread is very long. after apply v16-0001-Transform-OR-clause-to-ANY-expressions.patch and 0002-Teach-generate_bitmap_or_paths-to-build-BitmapOr-pat-202402

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2024-02-12 Thread Andres Freund
Hi, On 2024-02-12 15:56:19 -0800, Jeff Davis wrote: > On Mon, 2024-02-12 at 11:33 -0800, Jeff Davis wrote: > > For 0002 & 0003, I'd like more clarity on how they will actually be > > used by an extension. > > In patch 0002, I'm concerned about calling > WaitXLogInsertionsToFinish(). It loops

Re: Encoding protection for pgcrypto

2024-02-12 Thread shihao zhong
On Fri, Feb 9, 2024 at 5:34 PM cary huang wrote: > > The following review has been posted through the commitfest application: > make installcheck-world: tested, failed > Implements feature: not tested > Spec compliant: not tested > Documentation:not tested > > Hello >

Re: backend *.c #include cleanup (IWYU)

2024-02-12 Thread Nathan Bossart
On Mon, Feb 12, 2024 at 05:08:40PM +0100, Peter Eisentraut wrote: > On 10.02.24 21:13, Nathan Bossart wrote: >> I haven't played with it at all, but the topic reminds me of this thread: >> >> >> https://postgr.es/m/flat/CALDaNm1B9naPDTm3ox1m_yZvOm3KA5S4kZQSWWAeLHAQ%3D3gV1Q%40mail.gmail.com

Re: Patch: Add parse_type Function

2024-02-12 Thread David E. Wheeler
On Feb 10, 2024, at 20:52, Erik Wienhold wrote: > > Let me comment on some issues since I wrote the very first version of > parse_type() on which David's patch is based. Thanks Erik. >> On 2024-02-01 01:00 +0100, jian he wrote: >> if you are wondering around other code deal with NULL,

Re: [PATCH] Add native windows on arm64 support

2024-02-12 Thread Dave Cramer
Dave Cramer www.postgres.rocks On Mon, 12 Feb 2024 at 09:19, Andrew Dunstan wrote: > > On 2024-02-12 Mo 08:51, Dave Cramer wrote: > > > > On Sat, 10 Feb 2024 at 13:28, Andrew Dunstan wrote: > >> >> On 2024-02-10 Sa 12:20, Dave Cramer wrote: >> >> >> >> On Sat, 10 Feb 2024 at 11:19, Andrew

Re: Document efficient self-joins / UPDATE LIMIT techniques.

2024-02-12 Thread Corey Huinker
> > > - About the style: there is usually an empty line between an ending > and the next starting . It does not matter for correctness, but I > think it makes the source easier to read. > Done. I've seen them with spaces and without, and have no preference. > > - I would rather have only

Re: Document efficient self-joins / UPDATE LIMIT techniques.

2024-02-12 Thread Laurenz Albe
On Mon, 2024-02-12 at 11:45 -0500, Corey Huinker wrote: > > > - I am not sure if it is necessary to have the at all. > >   I'd say that it is just a trivial variation of the UPDATE example. > >   On the other hand, a beginner might find the example useful. > >   Not sure. > > I think a beginner

Re: make BuiltinTrancheNames less ugly

2024-02-12 Thread Tristan Partin
On Wed Jan 24, 2024 at 8:09 AM CST, Alvaro Herrera wrote: From 3d24b89855888a6650ec1aafb3579d810bfec5ac Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 23 Jan 2024 10:36:14 +0100 Subject: [PATCH] Remove IndividualLWLockNames We can just merge the lwlock names into the

Re: glibc qsort() vulnerability

2024-02-12 Thread Mats Kindahl
On Mon, Feb 12, 2024 at 4:57 PM Nathan Bossart wrote: > On Sun, Feb 11, 2024 at 03:44:42PM +0100, Mats Kindahl wrote: > > On Sat, Feb 10, 2024 at 9:53 PM Nathan Bossart > > > wrote: > >> and I think we should expand on some of the commentary in int.h. > >> For example, the comment at the top of

Re: backend *.c #include cleanup (IWYU)

2024-02-12 Thread Tristan Partin
On Sat Feb 10, 2024 at 1:40 AM CST, Peter Eisentraut wrote: I played with include-what-you-use (IWYU), "a tool for use with clang to analyze #includes in C and C++ source files".[0] I came across this via clangd (the language server), because clangd (via the editor) kept suggesting a bunch of

Re: Synchronizing slots from primary to standby

2024-02-12 Thread Amit Kapila
On Mon, Feb 12, 2024 at 3:33 PM Bertrand Drouvot wrote: > > A few random comments: > > > 003 === > > + If, after executing the function, > + > + hot_standby_feedback is disabled on > + the standby or the physical slot configured in > + > +

Re: Catalog domain not-null constraints

2024-02-12 Thread Alvaro Herrera
On 2024-Feb-11, Peter Eisentraut wrote: > But I see that table constraints do not work that way. A command like ALTER > TABLE t1 ADD NOT NULL c1 does nothing if the column already has a NOT NULL > constraint. I'm not sure this is correct. At least it's not documented. > We should probably make

[PATCH] Avoid mixing custom and OpenSSL BIO functions

2024-02-12 Thread David Benjamin
Hi all, I've attached a patch for the master branch to fix up the custom BIOs used by PostgreSQL, in light of the issues with the OpenSSL update recently. While c82207a548db47623a2bfa2447babdaa630302b9 (switching from BIO_get_data to BIO_get_app_data) resolved the immediate conflict, I don't

Re: Add semi-join pushdown to postgres_fdw

2024-02-12 Thread Pavel Luzanov
Hi, Alexander! On 12.02.2024 05:27, Alexander Korotkov wrote: But the worst thing is that replacing AND with OR causes breaking session and server restart: I haven't managed to reproduce this yet. Could you give more details: machine, OS, compile options, backtrace? We already had off-list

Re: Documentation to upgrade logical replication cluster

2024-02-12 Thread vignesh C
On Fri, 9 Feb 2024 at 12:30, Peter Smith wrote: > > Here are some review comments for patch v7-0001. > > == > doc/src/sgml/glossary.sgml > > 1. > + > + Logical replication cluster > + > + > + A set of publisher and subscriber instance with publisher instance > + replicating

Re: Unnecessary smgropen in {heapam_relation,index}_copy_data?

2024-02-12 Thread Heikki Linnakangas
On 25/01/2024 17:22, Japin Li wrote: On Thu, 25 Jan 2024 at 21:43, Aleksander Alekseev wrote: I find heapam_relation_copy_data() and index_copy_data() have the following code: dstrel = smgropen(*newrlocator, rel->rd_backend); ...

Re: SQL:2011 application time

2024-02-12 Thread Peter Eisentraut
I have done a review of the temporal foreign key patches in this patch series (0002 and 0003, v24). The patch set needs a rebase across c85977d8fef. I was able to do it manually, but it's a bit tricky, so perhaps you can post a new set to help future reviews. (Also, the last (0007) patch has

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

2024-02-12 Thread Alena Rybakina
Hi! I can't unnderstand this part of code: /* Time to generate index paths */ MemSet(, 0, sizeof(clauseset)); match_clauses_to_index(root, list_make1(rinfo1), index, ); As I understand it, match_clauses_to_index is necessary if you have a RestrictInfo (rinfo1) variable, so maybe we should

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

2024-02-12 Thread Andrei Lepikhov
On 12/2/2024 15:55, Alena Rybakina wrote: Hi! I can't unnderstand this part of code: /* Time to generate index paths */ MemSet(, 0, sizeof(clauseset)); match_clauses_to_index(root, list_make1(rinfo1), index, ); As I understand it, match_clauses_to_index is necessary if you have a

Re: Synchronizing slots from primary to standby

2024-02-12 Thread Amit Kapila
On Sun, Feb 11, 2024 at 6:53 PM Zhijie Hou (Fujitsu) wrote: > > Agreed. Here is the V84 patch which addressed this. > Few comments: = 1. Isn't the new function (pg_sync_replication_slots()) allowed to sync the slots from physical standby to another cascading standby? Won't it be

Re: Remove WIN32 conditional compilation from win32common.c

2024-02-12 Thread Heikki Linnakangas
On 05/12/2023 20:37, Tristan Partin wrote: The file is only referenced in Meson and MSVC scripts from what I can tell, and the Meson reference is protected by a Windows check. There are a bunch of files like win32common.c: $ ls src/port/win32*.c src/port/win32common.c src/port/win32dlopen.c

Re: Synchronizing slots from primary to standby

2024-02-12 Thread Bertrand Drouvot
Hi, On Sun, Feb 11, 2024 at 01:23:19PM +, Zhijie Hou (Fujitsu) wrote: > On Saturday, February 10, 2024 9:10 PM Amit Kapila > wrote: > > > > On Sat, Feb 10, 2024 at 5:31 PM Masahiko Sawada > > wrote: > > > > > > On Fri, Feb 9, 2024 at 4:08 PM Zhijie Hou (Fujitsu) > > > wrote: > > > > > >

RE: Feature request support MS Entra ID Authentication from On-premises PostreSQL server

2024-02-12 Thread rs.trevk
Azure Postgres login authentication : This is how I do it for the Azure PostgreSQL, I will have to test to see if it will log in the same way, as I need to be able to get the token from Azure and pass that in as the password for the User/group account in the on-prem database. Thanks

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

2024-02-12 Thread Alena Rybakina
On 12.02.2024 12:01, Andrei Lepikhov wrote: On 12/2/2024 15:55, Alena Rybakina wrote: Hi! I can't unnderstand this part of code: /* Time to generate index paths */ MemSet(, 0, sizeof(clauseset)); match_clauses_to_index(root, list_make1(rinfo1), index, ); As I understand it,

Re: table inheritance versus column compression and storage settings

2024-02-12 Thread Peter Eisentraut
On 08.02.24 08:20, Ashutosh Bapat wrote: On Wed, Feb 7, 2024 at 12:47 PM Ashutosh Bapat wrote: 0001 fixes compression inheritance 0002 fixes storage inheritance The first patch does not update compression_1.out which makes CI unhappy. Here's patchset fixing that. The changed behavior

Re: Support a wildcard in backtrace_functions

2024-02-12 Thread Peter Eisentraut
On 12.02.24 14:27, Jelte Fennema-Nio wrote: And honestly wanting to get backtraces for non-ERROR log entries seems quite niche to me, which to me makes it a weird default. I think one reason for this is that non-ERRORs are fairly unique in their wording, so you don't have to isolate them by

Re: [PATCH] allow pg_current_logfile() execution under pg_monitor role

2024-02-12 Thread Nathan Bossart
On Mon, Feb 12, 2024 at 12:27:54PM +, Pavlo Golub wrote: >> Are there any other >> functions that pg_monitor ought to have privileges for? >> > Not that I'm aware of at the moment. This one was found by chance. Okay. I'll plan on committing this in the next few days. -- Nathan Bossart

Re: glibc qsort() vulnerability

2024-02-12 Thread Nathan Bossart
On Sun, Feb 11, 2024 at 03:44:42PM +0100, Mats Kindahl wrote: > On Sat, Feb 10, 2024 at 9:53 PM Nathan Bossart > wrote: >> and I think we should expand on some of the commentary in int.h. >> For example, the comment at the top of int.h seems very tailored to the >> existing functions and should

Re: clarify equalTupleDescs()

2024-02-12 Thread Tom Lane
Peter Eisentraut writes: > On 06.02.24 16:14, Tom Lane wrote: >> +1 for the general idea, but it seems like "row type equality" >> might still be a slightly fuzzy concept. > I did another pass across the callers to check what pg_attribute fields > might be relevant. > Collation definitely

Re: backend *.c #include cleanup (IWYU)

2024-02-12 Thread Peter Eisentraut
On 10.02.24 21:13, Nathan Bossart wrote: (Interestingly, IWYU has been mentioned in src/tools/pginclude/README since 2012. Has anyone else played with it? Was it not mature enough back then?) I haven't played with it at all, but the topic reminds me of this thread:

Re: cpluspluscheck complains about use of register

2024-02-12 Thread Tom Lane
Christoph Berg writes: > Should the removal of "register" be backported to support that better? Perhaps. It's early days yet, but nobody has complained that that broke anything in v16, so I'm guessing it'd be fine. regards, tom lane

Re: Small fix on query_id_enabled

2024-02-12 Thread Yugo NAGATA
On Sat, 10 Feb 2024 10:19:15 +0900 Michael Paquier wrote: > On Fri, Feb 09, 2024 at 04:37:23PM +0800, Julien Rouhaud wrote: > > On Fri, Feb 09, 2024 at 03:38:23PM +0900, Yugo NAGATA wrote: > >> Also, I think the name is a bit confusing for the same reason, that is, > >> query_id_enabled may be

Re: [PATCH] Avoid mixing custom and OpenSSL BIO functions

2024-02-12 Thread Daniel Gustafsson
> On 11 Feb 2024, at 19:19, David Benjamin wrote: > > Hi all, > > I've attached a patch for the master branch to fix up the custom BIOs used by > PostgreSQL, in light of the issues with the OpenSSL update recently. While > c82207a548db47623a2bfa2447babdaa630302b9 (switching from BIO_get_data

Add publisher and subscriber to glossary documentation.

2024-02-12 Thread Shlok Kyal
Hi, There are several places where publisher and subscriber terms are used across the documentation. But the publisher and subscriber were missing in the documentation. I felt this should be added in the glossary. I have created a patch for the same. Thanks and Regards Shlok Kyal

  1   2   >