Re: Add partial :-variable expansion to psql \copy

2025-04-01 Thread Fabien Coelho
Hello Corey, If we could do this:     COPY :"myschema".:"mytable" FROM STDIN \g < :"myfilename" that would fit our patterns most cleanly, but we would probably create a parsing hassle for ourselves if we ever wanted to mix pipe-to with pipe-from. It would also require checking on every comma

Re: add function argument name to substring and substr

2025-04-01 Thread David G. Johnston
On Tue, Apr 1, 2025 at 6:15 AM Marcos Pegoraro wrote: > Em ter., 1 de abr. de 2025 às 02:00, David G. Johnston < > david.g.johns...@gmail.com> escreveu: > > Wouldn't it be good to add the use of parentheses using posix ? It's > useful and rarely documented > substring('Thomas', '...$') >

Re: Make query cancellation keys longer

2025-04-01 Thread Heikki Linnakangas
On 22/02/2025 16:58, Jelte Fennema-Nio wrote: On Mon, 9 Sept 2024 at 17:58, Robert Haas wrote: On Fri, Aug 16, 2024 at 11:29 AM Robert Haas wrote: I'll split this patch like that, to make it easier to compare and merge with Jelte's corresponding patches. That sounds great. IMHO, comparing

Re: in BeginCopyTo make materialized view using COPY TO instead of COPY (query).

2025-04-01 Thread David G. Johnston
On Tue, Apr 1, 2025 at 6:52 AM vignesh C wrote: > > We are not changing the existing behavior. However, since copying data > from large tables can take a significant amount of time, would it be > helpful to add a cautionary note advising users to refresh the > materialized view before running cop

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-04-01 Thread Peter Geoghegan
On Tue, Apr 1, 2025 at 9:26 AM Aleksander Alekseev wrote: > Can you think of any tests specifically for 0003, or relying on the > added Asserts() is best we can do? Same question for 0002. There are many more tests than those that are included in the patch. I wrote and debugged all patches using

Re: add function argument name to substring and substr

2025-04-01 Thread Marcos Pegoraro
Em ter., 1 de abr. de 2025 às 02:00, David G. Johnston < david.g.johns...@gmail.com> escreveu: Wouldn't it be good to add the use of parentheses using posix ? It's useful and rarely documented substring('Thomas', '...$') +substring('Email: johnj...@mymail.com, Name: John' from '@(.

Re: Restrict publishing of partitioned table with a foreign table as partition

2025-04-01 Thread Shlok Kyal
On Fri, 28 Mar 2025 at 16:35, Álvaro Herrera wrote: > > On 2025-Mar-28, Shlok Kyal wrote: > > > On Mon, 24 Mar 2025 at 21:17, Álvaro Herrera > > wrote: > > > > Also, surely we should document this restriction in the SGML docs > > > somewhere. > > > > I have added comment in create_publication.sg

Re: AIO writes vs hint bits vs checksums

2025-04-01 Thread Andres Freund
Hi, On 2025-04-01 13:34:53 +0300, Heikki Linnakangas wrote: > Here's a rebase of these patches. Thanks! Curious what made you do this? Do you need any parts of this soon? I've been hacking on this a bit more, btw, just haven't gotten around to the necessary README rephrasings... :( > I went a

Re: AIO v2.5

2025-04-01 Thread Noah Misch
On Mon, Mar 31, 2025 at 08:41:39PM -0400, Andres Freund wrote: > updated version All non-write patches (1-7) are ready for commit, though I have some cosmetic recommendations below. I've marked the commitfest entry Ready for Committer. > + # Check a page validity error in another blo

Re: Draft for basic NUMA observability

2025-04-01 Thread Bertrand Drouvot
Hi Jakub, On Tue, Apr 01, 2025 at 12:56:06PM +0200, Jakub Wartak wrote: > On Mon, Mar 31, 2025 at 4:59 PM Bertrand Drouvot > wrote: > > > Hi, > > Hi Bertrand, happy to see you back, thanks for review and here's v18 > attached (an ideal fit for PG18 ;)) Thanks for the new version! === About v1

Re: [PATCH] Fix build on MINGW on ARM64

2025-04-01 Thread Andrew Dunstan
On 2025-04-01 Tu 8:47 AM, vignesh C wrote: On Tue, 1 Apr 2025 at 16:02, Andrew Dunstan wrote: On 2025-04-01 Tu 5:16 AM, vignesh C wrote: On Sun, 2 Feb 2025 at 00:52, Lars Kanis wrote: This patch limits the workaround of using __buildin_setjmp on the Windows MINGW platform. This workaround

Re: Add partial :-variable expansion to psql \copy

2025-04-01 Thread Fabien Coelho
On 31/03/2025 17:09, Tom Lane wrote: Fabien COELHO writes: [...] The attached patch allows \copy to use variable's values in place of table and file names: Hm ... I'm on board with the general idea of the feature, but I find this implementation quite horrid. Indeed, I just added the stuff i

Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment

2025-04-01 Thread Ilia Evdokimov
On 28.03.2025 15:20, Ilia Evdokimov wrote: Then we need to decide clearly what exactly to display in EXPLAIN for the Memoize node: absolute values (estimated distinct keys and estimated cache capacity) or ratios (hit_ratio and evict_ratio). Ratios have the advantage of quickly reflecting the o

Re: Add partial :-variable expansion to psql \copy

2025-04-01 Thread Christoph Berg
Re: Fabien Coelho > (1) it seems that is the only command which is really full SQL hidden in a > backslash command Perhaps this form could be improved by changing `\copy (select) to file` to something like `select \gcopy (to file)`. That might make :expansion in the "select" part easier to handle.

Re: Add partial :-variable expansion to psql \copy

2025-04-01 Thread Pavel Stehule
Hi út 1. 4. 2025 v 12:00 odesílatel Christoph Berg napsal: > Re: Fabien Coelho > > (1) it seems that is the only command which is really full SQL hidden in > a > > backslash command > > Perhaps this form could be improved by changing `\copy (select) to file` > to something like `select \gcopy (t

Re: in BeginCopyTo make materialized view using COPY TO instead of COPY (query).

2025-04-01 Thread Kirill Reshke
On Tue, 1 Apr 2025, 11:45 vignesh C, wrote: > > One thing I noticed was that if the materialized view is not refreshed > user will get stale data > > Should we document this? > Does this patch alter thus behaviour? User will get stale data even on HEAD, why should we take a care within this thr

Re: Draft for basic NUMA observability

2025-04-01 Thread Jakub Wartak
On Mon, Mar 31, 2025 at 4:59 PM Bertrand Drouvot wrote: > Hi, Hi Bertrand, happy to see you back, thanks for review and here's v18 attached (an ideal fit for PG18 ;)) > On Mon, Mar 31, 2025 at 11:27:50AM +0200, Jakub Wartak wrote: > > On Thu, Mar 27, 2025 at 2:40 PM Andres Freund wrote: > > >

RE: Fix slot synchronization with two_phase decoding enabled

2025-04-01 Thread Zhijie Hou (Fujitsu)
On Tue, Apr 1, 2025 at 2:09 PM Amit Kapila wrote: > > On Mon, Mar 31, 2025 at 5:0 PM Zhijie Hou (Fujitsu) > wrote: > > > > Thanks for the comments, they have been addressed in V2. > > > > In the PG17 patch, we only have a check preventing failover and > two_phase in CreateSubscription. Don't

Re: AIO v2.5

2025-04-01 Thread Andres Freund
Hi, On 2025-04-01 14:56:17 +0300, Aleksander Alekseev wrote: > Hi Andres, > > > > I didn't yet push > > > > > > > > Subject: [PATCH v2.14 13/29] aio: Add README.md explaining higher > > > > > level design > > I have several notes about 0003 / README.md: > > 1. I noticed that the use of "Postgres"

Re: pgsql: Add support for OAUTHBEARER SASL mechanism

2025-04-01 Thread Daniel Gustafsson
> On 1 Apr 2025, at 02:06, Jacob Champion > wrote: > > On Mon, Mar 31, 2025 at 4:09 PM Jacob Champion > wrote: >> I don't have hurd-amd64 to test, but I'm working on a patch that will >> build and pass tests if I manually munge pg_config.h. We were skipping >> the useless tests via a $windows_o

Re: Better HINT message for "unexpected data beyond EOF"

2025-04-01 Thread Robert Haas
On Tue, Apr 1, 2025 at 7:13 AM Jakub Wartak wrote: > Thread bump. So we have the following candidates: > > 1. remove it as Andres stated: > ERROR: unexpected data beyond EOF in block 1472 of relation base/5/16387 > > 2a. Robert's idea > ERROR: unexpected data beyond EOF in block 1472 of relation

Re: Fix slot synchronization with two_phase decoding enabled

2025-04-01 Thread Amit Kapila
On Mon, Mar 31, 2025 at 5:04 PM Zhijie Hou (Fujitsu) wrote: > > Thanks for the comments, they have been addressed in V2. > In the PG17 patch, we only have a check preventing failover and two_phase in CreateSubscription. Don't we need a similar check for AlterSubscription? Apart from the above, I

Re: Better HINT message for "unexpected data beyond EOF"

2025-04-01 Thread Robert Haas
On Tue, Apr 1, 2025 at 9:54 AM Christoph Berg wrote: > Re: Robert Haas > > > Another question is should we back-patch this? I believe we should (?) > > I don't think this qualifies as a bug. The current wording isn't > > factually wrong, just unhelpful. Even if it were wrong, we need a > > pretty

Re: RFC: Logging plan of the running query

2025-04-01 Thread torikoshia
On 2025-04-01 21:32, Robert Haas wrote: Thanks for your comment. On Mon, Mar 31, 2025 at 9:43 PM torikoshia wrote: Previously, Rafael proposed a patch in this thread that added execution progress tracking. However, I felt that expanding the scope could make it harder to get the patch reviewed

Re: Better HINT message for "unexpected data beyond EOF"

2025-04-01 Thread Christoph Berg
Re: Robert Haas > > Another question is should we back-patch this? I believe we should (?) > > I don't think this qualifies as a bug. The current wording isn't > factually wrong, just unhelpful. Even if it were wrong, we need a > pretty good reason to change message strings in a stable branch, > b

Re: [PATCH] Fix build on MINGW on ARM64

2025-04-01 Thread vignesh C
On Tue, 1 Apr 2025 at 16:02, Andrew Dunstan wrote: > > > On 2025-04-01 Tu 5:16 AM, vignesh C wrote: > > On Sun, 2 Feb 2025 at 00:52, Lars Kanis wrote: > >> This patch limits the workaround of using __buildin_setjmp on the > >> Windows MINGW platform. This workaround is only necessary for legacy >

Re: Index AM API cleanup

2025-04-01 Thread Peter Eisentraut
On 20.03.25 12:59, Peter Eisentraut wrote: v22-0006-Convert-from-StrategyNumber-to-CompareType.patch This is all that remains now.  I think with a bit more polishing around the edges, some comment updates, etc., this is close to ready. Here is an updated version of this patch. I have left ou

Re: Using read stream in autoprewarm

2025-04-01 Thread Nazir Bilal Yavuz
Hi, On Tue, 1 Apr 2025 at 05:14, Melanie Plageman wrote: > > On Mon, Mar 31, 2025 at 3:45 PM Melanie Plageman > wrote: > > > > Whoops, this isn't right. It does work. I'm going to draft a version > > suggesting slightly different variable naming and a couple comments to > > make this more clear.

Re: pgsql: Add support for OAUTHBEARER SASL mechanism

2025-04-01 Thread Christoph Berg
Re: Jacob Champion > (That means that Windows builds --with-libcurl are similarly broken, I > think. Not that Windows packagers will want to use --with-libcurl -- > it doesn't do anything -- but it should build.) Does --with-libcurl still do anything useful if this feature test fails? From what yo

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

2025-04-01 Thread Ashutosh Bapat
On Tue, Apr 1, 2025 at 11:52 AM Alvaro Herrera wrote: > > On 2025-Mar-31, Daniel Gustafsson wrote: > > > Given where we are in the cycle, it seems to make sense to stick to using > > the > > schedule we already have rather than invent a new process for generating it, > > and work on that for 19?

pg_recvlogical cannot create slots with failover=true

2025-04-01 Thread Hayato Kuroda (Fujitsu)
Dear hackers, While reviewing threads I found $SUBJECT. I think it does not affect to output, but I could not find strong reasons not to support it. Also, this can be used for testing purpose, i.e., DBAs can verify the slot-sync can work on their system by only using pg_recvlogical. Attached pa

Re: [PATCH] Fix build on MINGW on ARM64

2025-04-01 Thread vignesh C
On Sun, 2 Feb 2025 at 00:52, Lars Kanis wrote: > > This patch limits the workaround of using __buildin_setjmp on the > Windows MINGW platform. This workaround is only necessary for legacy > MSVCRT based toolchain, but not for UCRT based. It is not available at > all on clang on ARM64 resulting in

Re: in BeginCopyTo make materialized view using COPY TO instead of COPY (query).

2025-04-01 Thread vignesh C
On Tue, 1 Apr 2025 at 08:43, jian he wrote: > > On Mon, Mar 31, 2025 at 11:27 PM Fujii Masao > wrote: > > > > Regarding the patch, here are some review comments: > > > > + errmsg("cannot copy from > > materialized view when the materialized view is n

Re: PRI?64 vs Visual Studio (2022)

2025-04-01 Thread Peter Eisentraut
On 31.03.25 08:28, Kyotaro Horiguchi wrote: If you're already aware of this and have taken it into account, please feel free to ignore this. As described in the recent commit a0ed19e0a9e, many %ll? format specifiers are being replaced with %. I hadn’t paid much attention to this before, but I h

Re: Better HINT message for "unexpected data beyond EOF"

2025-04-01 Thread Jakub Wartak
On Thu, Mar 27, 2025 at 4:00 PM Christoph Berg wrote: > > Re: Robert Haas > > I think that would be better than what we have now, but I still wonder > > if we should give some kind of a hint that an external process may be > > doing something to that file. Jakub and I may be biased by having just

Re: Statistics Import and Export

2025-04-01 Thread Jeff Davis
On Mon, 2025-03-31 at 13:39 -0400, Robert Haas wrote: > +1. I think I said this before, but I don't think it's correct to > regard the statistics as part of the database. It's great for > pg_upgrade to preserve them, but I think doing so for a regular dump > should be opt-in. I'm confused about th

RE: Fix 035_standby_logical_decoding.pl race conditions

2025-04-01 Thread Hayato Kuroda (Fujitsu)
Dear Bertrand, > > > s/to avoid the seeing a xl_running_xacts/to avoid seeing a > > > xl_running_xacts/? > > > > Fixed. Sorry, I misunderstood your comment and wrongly fixed. I will address in next version. > === 1 > > +* XXX What value should we return here? Originally this >

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-04-01 Thread Aleksander Alekseev
Hi Peter, > I'm now very close to committing everything. Though I do still want > another pair of eyes on the newer > 0003-Improve-skip-scan-primitive-scan-scheduling.patch stuff before > commiting (since I still intend to commit all the remaining patches > together). Can you think of any tests s

Re: Statistics Import and Export

2025-04-01 Thread Robert Haas
On Mon, Mar 31, 2025 at 6:04 PM Jeff Davis wrote: > On Mon, 2025-03-31 at 13:39 -0400, Robert Haas wrote: > > +1. I think I said this before, but I don't think it's correct to > > regard the statistics as part of the database. It's great for > > pg_upgrade to preserve them, but I think doing so fo

Re: AIO writes vs hint bits vs checksums

2025-04-01 Thread Nico Williams
On Wed, Oct 30, 2024 at 02:16:51PM +0200, Heikki Linnakangas wrote: > Acquiring the exclusive lock in step 4 is just a way to wait for all the > existing share-lockers to release the lock. You wouldn't need to block new > share-lockers. We have LW_WAIT_UNTIL_FREE, which is almost what we need, but

Re: Fix 035_standby_logical_decoding.pl race conditions

2025-04-01 Thread Bertrand Drouvot
Hi, On Tue, Apr 01, 2025 at 04:55:06PM +0530, Amit Kapila wrote: > On Tue, Apr 1, 2025 at 2:02 PM Bertrand Drouvot > wrote: > > > But if we "really" want to produce a "new" WAL record, what about using > > LogLogicalMessage()? > > > > We are using injection points for testing purposes, which me

Re: Memoize ANTI and SEMI JOIN inner

2025-04-01 Thread Richard Guo
On Mon, Mar 31, 2025 at 7:33 PM Andrei Lepikhov wrote: > and I don't get the case. As I see, ANTI/SEMI join just transforms to > the regular join and it is still not the case. May you be more specific? Upthread, you said that a qual contained in ppi_clauses will also be included in extra->restric

Re: TEMP_CONFIG vs test_aio

2025-04-01 Thread Noah Misch
On Tue, Apr 01, 2025 at 03:42:44PM -0400, Andres Freund wrote: > The reason for the failure is simple, the buildfarm animal specifies > io_method=io_uring (thanks to "cookt" for setting that up so quickly, whoever > you are :)) and the test is assuming that the -c io_method=... it passes to > initd

Re: Support NOT VALID / VALIDATE constraint options for named NOT NULL constraints

2025-04-01 Thread Alvaro Herrera
On 2025-Mar-28, jian he wrote: > ATPrepAddPrimaryKey > + if (!conForm->convalidated) > + ereport(ERROR, > + errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), > + errmsg("not-null constraint \"%s\" of table \"%s\" has not been validated", > + NameStr(conForm->conname), > + RelationGetRelationN

Re: [PATCH] Fix build on MINGW on ARM64

2025-04-01 Thread Andrew Dunstan
On 2025-04-01 Tu 11:15 AM, Andrew Dunstan wrote: On 2025-04-01 Tu 8:47 AM, vignesh C wrote: On Tue, 1 Apr 2025 at 16:02, Andrew Dunstan wrote: On 2025-04-01 Tu 5:16 AM, vignesh C wrote: On Sun, 2 Feb 2025 at 00:52, Lars Kanis wrote: This patch limits the workaround of using __buildin_se

Re: TEMP_CONFIG vs test_aio

2025-04-01 Thread Andres Freund
Hi, On 2025-04-01 20:12:29 +, Todd Cook wrote: > On 4/1/25, 3:42 PM, "Andres Freund" > wrote: > > I just committed the tests for AIO, and unfortunately they (so far) fail on > > one buildfarm animal: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=bumble

Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment

2025-04-01 Thread David Rowley
On Tue, 1 Apr 2025 at 20:52, Ilia Evdokimov wrote: > With the feature freeze coming up soon, I’d like to ask: do we plan to > include this patch in v18? I don't think there's a clear enough consensus yet on what EXPLAIN should display. We'd need that beforehand. There are now less than 7 days to

Re: Add partial :-variable expansion to psql \copy

2025-04-01 Thread Corey Huinker
> > I'm hesitating about the right syntax, though, for an input backslash > command which in effect would really only apply to COPY? ISTM that \g* is > used for "go", i.e. a semi-colon replacement which executes the SQL, and we > should want the same thing, which suggests: > making it a \g-variant

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-04-01 Thread Peter Geoghegan
On Tue, Apr 1, 2025 at 10:40 AM Matthias van de Meent wrote: > The review below was started for v31, then adapted to v32 when that > arrived. I haven't cross-checked this with v33. There's been hardly any changes to 0001- in quite a while, so that's fine. > > Teach nbtree composite index scans t

Re: AIO v2.5

2025-04-01 Thread Andres Freund
Hi, On 2025-04-01 11:55:20 -0400, Andres Freund wrote: > I haven't yet pushed the changes, but will work on that in the afternoon. There are three different types of failures in the test_aio test so far: 1) TEMP_CONFIG See https://postgr.es/m/zh5u22wbpcyfw2ddl3lsvmsxf4yvsrvgxqwwmfjddc4c2khsgp%

Re: Making sslrootcert=system work on Windows psql

2025-04-01 Thread Jacob Champion
On Tue, Apr 1, 2025 at 2:05 PM George MacKerron wrote: > > I was very pleased to see the sslrootcert=system connection option added in > Postgres 16 (I even blogged about it: > https://neon.tech/blog/avoid-mitm-attacks-with-psql-postgres-16). But > sslrootcert=system has not been widely support

Re: System views for versions reporting

2025-04-01 Thread Dmitry Dolgov
> On Sun, Mar 23, 2025 at 06:21:33PM GMT, Tom Lane wrote: > > FWIW, I think the 0004 patch is about to be mostly obsoleted by > Andrei's proposal at [1]. To the extent that it's not obsoleted, > I question whether it's something we want at all, given the ground > rule that unprivileged users are n

Re: RFC: Logging plan of the running query

2025-04-01 Thread Robert Haas
On Tue, Apr 1, 2025 at 3:05 PM Sami Imseih wrote: > > Looking at ExplainAssembleLogOutput() is making me realize that > > auto_explain is in serious need of some cleanup. That's not really the > > fault of this patch, but the hack whereby we overwrite the [] that > > would have surrounded the JSON

Re: [PATCH v1] parallel pg_restore: avoid disk seeks when jumping short distance forward

2025-04-01 Thread Dimitrios Apostolou
On Sat, 29 Mar 2025, Dimitrios Apostolou wrote: P.S. What is the recommended way to test a change, besides a generic make check? And how do I run selectively only the pg_dump/restore tests, in order to speed up my development routine? I have tested it with: make -C src/bin/pg_dump check

TEMP_CONFIG vs test_aio

2025-04-01 Thread Andres Freund
Hi, I just committed the tests for AIO, and unfortunately they (so far) fail on one buildfarm animal: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=bumblebee&dt=2025-04-01%2018%3A55%3A01 The reason for the failure is simple, the buildfarm animal specifies io_method=io_uring (thanks to

Re: macOS 15.4 versus strchrnul()

2025-04-01 Thread Tom Lane
Peter Eisentraut writes: > On 01.04.25 17:57, Tom Lane wrote: >> I speculate that the meson test for preadv/pwritev has never worked >> for macOS either, and we haven't noticed because nobody has tried to >> build with meson on a machine with low enough default deployment >> target to not have pre

Re: Small memory fixes for pg_createsubcriber

2025-04-01 Thread Ranier Vilela
Em ter., 1 de abr. de 2025 às 15:39, Noah Misch escreveu: > On Thu, Feb 27, 2025 at 10:23:31AM -0300, Ranier Vilela wrote: > > Em qui., 27 de fev. de 2025 às 02:51, Michael Paquier < > mich...@paquier.xyz> > > escreveu: > > > > > On Tue, Feb 25, 2025 at 08:54:31AM -0300, Ranier Vilela wrote: > >

Re: Improving tracking/processing of buildfarm test failures

2025-04-01 Thread Alexander Lakhin
Hello hackers, Please take a look at the March report on buildfarm failures: # SELECT br, count(*) FROM failures WHERE dt >= '2025-03-01' AND  dt < '2025-04-01' GROUP BY br; REL_13_STABLE: 5 REL_14_STABLE: 10 REL_15_STABLE: 7 REL_16_STABLE: 5 REL_17_STABLE: 12 master: 204 -- Total: 243 (Counting

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

2025-04-01 Thread Daniel Gustafsson
> On 1 Apr 2025, at 19:01, Alvaro Herrera wrote: > Thanks! Thanks for taking this one across the finishing line! -- Daniel Gustafsson

Re: macOS 15.4 versus strchrnul()

2025-04-01 Thread Peter Eisentraut
On 01.04.25 17:57, Tom Lane wrote: That is, the function exists now in macOS' libc, and so configure's does-it-link test for HAVE_STRCHRNUL finds it, but will not let you use it unless you monkey around with export MACOSX_DEPLOYMENT_TARGET=15.4 or similar. I don't think we want to require peo

Re: [PATCH v1] parallel pg_restore: avoid disk seeks when jumping short distance forward

2025-04-01 Thread Nathan Bossart
On Tue, Apr 01, 2025 at 09:33:32PM +0200, Dimitrios Apostolou wrote: > It didn't break any test, but I also don't see any difference, the > performance boost is noticeable only when restoring a huge archive that is > missing offsets. This seems generally reasonable to me, but how did you decide on

Re: Small memory fixes for pg_createsubcriber

2025-04-01 Thread Noah Misch
On Thu, Feb 27, 2025 at 10:23:31AM -0300, Ranier Vilela wrote: > Em qui., 27 de fev. de 2025 às 02:51, Michael Paquier > escreveu: > > > On Tue, Feb 25, 2025 at 08:54:31AM -0300, Ranier Vilela wrote: > > > @@ -455,7 +455,9 @@ set_locale_and_encoding(void) > > > locale->db_locale, > > > strlen

Re: Statistics Import and Export

2025-04-01 Thread Nathan Bossart
On Tue, Apr 01, 2025 at 01:20:30PM -0500, Nathan Bossart wrote: > On Mon, Mar 31, 2025 at 09:33:15PM -0500, Nathan Bossart wrote: >> My goal is to commit the attached patches on Friday morning, but of course >> that is subject to change based on any feedback or objections that emerge >> in the mean

Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)

2025-04-01 Thread Sami Imseih
I went back to look at this patch and a few things. I noticed it did not have correct indentation, so I ran pgindent. I also removed some extra lines added and made some slight adjustments to the docs. Attached my edited patch as a txt. If you agree, please revise into a v14. I also noticed that b

Re: RFC: Logging plan of the running query

2025-04-01 Thread Robert Haas
On Fri, Mar 21, 2025 at 8:40 AM torikoshia wrote: > Rebased it again. > > On 2025-03-10 14:10, torikoshia wrote: > > BTW the patch adds about 400 lines to explain.c and it may be better > > to split the file as well as 9173e8b6046, but I leave it as it is for > > now. > > This part remains unchang

Re: Small memory fixes for pg_createsubcriber

2025-04-01 Thread Ranier Vilela
Em ter., 1 de abr. de 2025 às 15:39, Noah Misch escreveu: > On Thu, Feb 27, 2025 at 10:23:31AM -0300, Ranier Vilela wrote: > > Em qui., 27 de fev. de 2025 às 02:51, Michael Paquier < > mich...@paquier.xyz> > > escreveu: > > > > > On Tue, Feb 25, 2025 at 08:54:31AM -0300, Ranier Vilela wrote: > >

Re: Proposal: Progressive explain

2025-04-01 Thread Rafael Thofehrn Castro
My bad, I mistakenly did the tests without assertion enabled in the last 2 days, so couldn't catch that Assertion failure. Was able to reproduce it, thanks. I guess when the code was designed we were not expecting to be doing explains in parallel workers. One comment is that this has nothing to d

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-04-01 Thread Alena Rybakina
On 01.04.2025 17:39, Matthias van de Meent wrote: On Fri, 28 Mar 2025 at 22:59, Peter Geoghegan wrote: On Tue, Mar 25, 2025 at 7:45 PM Peter Geoghegan wrote: Attached is v31, which has a much-improved _bt_skip_ikeyprefix (which I've once again renamed, this time to _bt_set_startikey). Attach

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2025-04-01 Thread Fujii Masao
On 2025/01/23 19:22, Yugo NAGATA wrote: On Wed, 22 Jan 2025 13:30:17 +0100 Laurenz Albe wrote: On Fri, 2024-09-13 at 16:18 +0900, Yugo Nagata wrote: I've attached a updated patch. The test is rewritten using has_largeobject_privilege() function instead of calling loread & lowrite, which m

Document SQL functions behavior regarding custom/generic plan

2025-04-01 Thread Renan Alves Fonseca
Hi, In [1], we discussed adding some lines regarding the fact that SQL functions always use generic plan. Here is the suggested patch. I've tested on V17 and V12. It does not concern V18. Regards, Renan [1] https://www.postgresql.org/message-id/CAApHDvp3EDrVhGjmb21bceJ5-Y7iXKOn2UGG3-ngp_9ob_mpL

Re: TEMP_CONFIG vs test_aio

2025-04-01 Thread Andres Freund
Hi, On 2025-04-01 17:08:49 -0400, Andrew Dunstan wrote: > On 2025-04-01 Tu 4:17 PM, Andres Freund wrote: > > For one using PG_TEST_INITDB_EXTRA_OPTS would probably require changing the > > buildfarm code, because the buildfarm code filters out environment variables > > that aren't on an allowlist

Re: Fix 035_standby_logical_decoding.pl race conditions

2025-04-01 Thread Amit Kapila
On Tue, Apr 1, 2025 at 2:02 PM Bertrand Drouvot wrote: > > Hi Kuroda-san, > > On Tue, Apr 01, 2025 at 01:22:49AM +, Hayato Kuroda (Fujitsu) wrote: > > Dear Bertrand, > > > > Thanks for the updated patch! > > > > s/to avoid the seeing a xl_running_xacts/to avoid seeing a > > > xl_running_xacts

Making sslrootcert=system work on Windows psql

2025-04-01 Thread George MacKerron
I was very pleased to see the sslrootcert=system connection option added in Postgres 16 (I even blogged about it: https://neon.tech/blog/avoid-mitm-attacks-with-psql-postgres-16). But sslrootcert=system has not been widely supported by psql installations, perhaps because people compiling Postgr

Re: Statistics Import and Export

2025-04-01 Thread Jeff Davis
On Tue, 2025-04-01 at 13:44 -0500, Nathan Bossart wrote: > Apologies for the noise.  I noticed one more way to simplify 0002.  > As > before, there should be no functional differences. To restate the problem: one of the problems being solved here is that the existing code for custom-format dumps

Re: general purpose array_sort

2025-04-01 Thread Tom Lane
Junwang Zhao writes: > On Tue, Apr 1, 2025 at 1:11 AM Tom Lane wrote: >> Attached 0001 is the same as v18, and then 0002 is the proposed >> addition to typcache. > I've applied the patches to master and regression passed. > 0002 is neat, I am +1 for this improvement. Hearing no further comments

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-01 Thread Jacob Champion
On Mon, Mar 31, 2025 at 7:06 AM Christoph Berg wrote: > Perhaps we could do the same with libldap and libgssapi? (Though > admittedly I have never seen any complaints or nagging questions from > security people about these.) If we end up happy with how the Curl indirection works, that seems like

Re: bug when apply fast default mechanism for adding new column over domain with default value

2025-04-01 Thread Tom Lane
Alexander Lakhin writes: > I've discovered that 95f650674 introduced a defect similar to bug #18297, > but this time with DEFAULT. Namely, the following script: > CREATE TABLE a (aa text); > CREATE TABLE c (cc text) INHERITS (a); > CREATE TABLE d (dd text) INHERITS (c, a); > ALTER TABLE a ADD COLU

Re: Add mention in docs about locking all partitions for generic plans

2025-04-01 Thread David Rowley
On Mon, 31 Mar 2025 at 12:19, David Rowley wrote: > I'll push these in the next few days unless anyone else wants to voice > their opinions. Thanks for the review. Pushed. David

Re: Reduce "Var IS [NOT] NULL" quals during constant folding

2025-04-01 Thread Richard Guo
On Wed, Apr 2, 2025 at 4:34 AM Robert Haas wrote: > On Tue, Apr 1, 2025 at 2:34 AM Richard Guo wrote: > > However, I gave up this idea because I realized it would require > > retrieving a whole bundle of catalog information that isn't needed > > until after the RelOptInfos are built, such as max_

Re: Statistics Import and Export

2025-04-01 Thread Robert Haas
On Tue, Apr 1, 2025 at 4:24 PM Jeff Davis wrote: > On Tue, 2025-04-01 at 09:37 -0400, Robert Haas wrote: > > I don't think I was aware of the open item; I was just catching up on > > email. > > I lean towards making it opt-in for pg_dump and opt-out for pg_upgrade. Big +1. > But I think we shoul

Re: Small memory fixes for pg_createsubcriber

2025-04-01 Thread Michael Paquier
On Apr 2, 2025, at 5:14, Noah Misch wrote:Yes, pg_upgrade should not do that.  I was trying to explain the differencebetween NULL and 'NULL'.  I didn't mean pg_upgrade should emit "IS NULL".(Apologies for the probably-weirdly-formatted message)This issue has been already mentioned around here, wit

Covering the comparison between date and timestamp, tz, type

2025-04-01 Thread Kwangwon Seo
Hi, Using the PostgreSQL code coverage report, I found that tests for comparisons between date and timestamp[tz] are missing. Some of them have only partial coverage. Attached patch will cover following functions: date_eq_timestamp date_ne_timestamp date_lt_timestamp date_gt_timestamp // already

Re: AIO v2.5

2025-04-01 Thread Noah Misch
On Tue, Apr 01, 2025 at 06:25:28PM -0400, Andres Freund wrote: > On 2025-04-01 17:47:51 -0400, Andres Freund wrote: > > 3) Some subtests fail if RELCACHE_FORCE_RELEASE and CATCACHE_FORCE_RELEASE > > are defined: > > > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2025-04-01%2

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-04-01 Thread Matthias van de Meent
On Tue, 1 Apr 2025 at 23:56, Matthias van de Meent wrote: > > On Tue, 1 Apr 2025 at 04:02, Peter Geoghegan wrote: > > > > On Fri, Mar 28, 2025 at 5:59 PM Peter Geoghegan wrote: > > > Attached is v32, which has very few changes, but does add a new patch: > > > a patch that adds skip-array-specifi

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-04-01 Thread Matthias van de Meent
On Fri, 28 Mar 2025 at 22:59, Peter Geoghegan wrote: > > On Tue, Mar 25, 2025 at 7:45 PM Peter Geoghegan wrote: > > Attached is v31, which has a much-improved _bt_skip_ikeyprefix (which > > I've once again renamed, this time to _bt_set_startikey). > > Attached is v32 Thanks! The review below wa

Re: Using read stream in autoprewarm

2025-04-01 Thread Melanie Plageman
On Tue, Apr 1, 2025 at 8:50 AM Nazir Bilal Yavuz wrote: > > I am attaching v8, which is an updated version of the v7. I tried to > get rid of these local variables and refactored code to make logic > more straightforward instead of going back and forth. > > 0001 and 0002 are v8. 0003 is another re

Re: Proposal to Enable/Disable Index using ALTER INDEX (with patch)

2025-04-01 Thread Shayon Mukherjee
On Tue, Apr 1, 2025 at 2:41 PM Sami Imseih wrote: > I went back to look at this patch and a few things. I noticed it did > not have correct > indentation, so I ran pgindent. I also removed some extra lines added and > made > some slight adjustments to the docs. Attached my edited patch as a txt.

Re: bug when apply fast default mechanism for adding new column over domain with default value

2025-04-01 Thread Tender Wang
Tom Lane 于2025年4月2日周三 09:05写道: > Alexander Lakhin writes: > > I've discovered that 95f650674 introduced a defect similar to bug #18297, > > but this time with DEFAULT. Namely, the following script: > > CREATE TABLE a (aa text); > > CREATE TABLE c (cc text) INHERITS (a); > > CREATE TABLE d (dd te

Re: general purpose array_sort

2025-04-01 Thread Junwang Zhao
On Wed, Apr 2, 2025 at 6:05 AM Tom Lane wrote: > > Junwang Zhao writes: > > On Tue, Apr 1, 2025 at 1:11 AM Tom Lane wrote: > >> Attached 0001 is the same as v18, and then 0002 is the proposed > >> addition to typcache. > > > I've applied the patches to master and regression passed. > > 0002 is n

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-04-01 Thread Matthias van de Meent
On Tue, 1 Apr 2025 at 04:02, Peter Geoghegan wrote: > > On Fri, Mar 28, 2025 at 5:59 PM Peter Geoghegan wrote: > > Attached is v32, which has very few changes, but does add a new patch: > > a patch that adds skip-array-specific primitive index scan heuristics > > to _bt_advance_array_keys (this i

Re: AIO v2.5

2025-04-01 Thread Andres Freund
Hi, On 2025-04-01 17:47:51 -0400, Andres Freund wrote: > 3) Some subtests fail if RELCACHE_FORCE_RELEASE and CATCACHE_FORCE_RELEASE > are defined: > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2025-04-01%2019%3A23%3A07 > > # +++ tap check in src/test/modules/test_aio +++

Re: [PATCH v1] parallel pg_restore: avoid disk seeks when jumping short distance forward

2025-04-01 Thread Dimitrios Apostolou
Thanks. This is the first value I tried and it works well. In the archive I have all blocks seem to be between 8 and 20KB so the jump forward before the change never even got close to 1MB. Could it be bigger in an uncompressed archive? Or in a future pg_dump that raises the block size? I don't r

Re: Hashed IN only applied to first encountered IN

2025-04-01 Thread David Rowley
On Wed, 2 Apr 2025 at 01:31, David Rowley wrote: > > On Wed, 2 Apr 2025 at 00:51, David Geier wrote: > > The hashed IN optimization is only applied to the first encountered > > ScalarArrayOpExpr during the expression tree traversal in > > convert_saop_to_hashed_saop_walker(). Reason being that th

Re: Adding skip scan (including MDAM style range skip scan) to nbtree

2025-04-01 Thread Peter Geoghegan
On Tue, Apr 1, 2025 at 5:56 PM Matthias van de Meent wrote: > 0002: > > // nbtutils.c > > > + * (safe even when "key->sk_attno <= firstchangingattnum") > > Typo: should be "key->sk_attno >= firstchangingattnum". Good catch! Though I think it should be "" safe even when "key->sk_attno

Re: TEMP_CONFIG vs test_aio

2025-04-01 Thread Andrew Dunstan
On 2025-04-01 Tu 4:17 PM, Andres Freund wrote: Hi, On 2025-04-01 20:12:29 +, Todd Cook wrote: On 4/1/25, 3:42 PM, "Andres Freund" mailto:and...@anarazel.de>> wrote: I just committed the tests for AIO, and unfortunately they (so far) fail on one buildfarm animal: https://buildfarm.postgres

Re: Improve CRC32C performance on SSE4.2

2025-04-01 Thread Nathan Bossart
On Tue, Apr 01, 2025 at 05:33:02PM +0700, John Naylor wrote: > On Thu, Mar 27, 2025 at 2:55 AM Devulapalli, Raghuveer > wrote: >> (1) zmm_regs_available() in pg_crc32c_sse42_choose.c is a duplicate of >> pg_popcount_avx512.c but perhaps that’s fine for now. I will propose a >> consolidated SIMD r

Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning

2025-04-01 Thread Ashutosh Bapat
On Tue, Apr 1, 2025 at 1:32 PM Amit Langote wrote: > > I think David’s suggestion to use 64 as the fixed initial size is > simpler and more predictable. Since list_length * 2 will always be >= > 64 anyway, unless we expect clause counts to grow significantly right > after the threshold, the fixed

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

2025-04-01 Thread Alvaro Herrera
On 2025-Apr-01, Ashutosh Bapat wrote: > Just today morning, I found something which looks like another bug in > statistics dump/restore [1]. As Daniel has expressed upthread [2], we > should go ahead and commit the test even if the bug is not fixed. But > in case it creates a lot of noise and make

Re: pgsql: Add support for OAUTHBEARER SASL mechanism

2025-04-01 Thread Jacob Champion
On Tue, Apr 1, 2025 at 6:12 AM Daniel Gustafsson wrote: > > > On 1 Apr 2025, at 15:03, Christoph Berg wrote: > > > With the libpq-oauth split, this makes even more sense because > > building a library that always throws an error isn't very useful. > > (Don't build that file at all if the feature

RE: Fix 035_standby_logical_decoding.pl race conditions

2025-04-01 Thread Hayato Kuroda (Fujitsu)
Dear Bertrand, > s/to avoid the seeing a xl_running_xacts/to avoid seeing a xl_running_xacts/? Fixed. > > === 2 (Nit) > > /* For testing slot invalidation due to the conflict */ > > Not sure "due to the conflict" is needed. > OK, removed. > About PG17-v2-0001 > > === 3 > > The commit

  1   2   >