Re: Windows: openssl & gssapi dislike each other

2025-01-22 Thread Dave Page
On Wed, 22 Jan 2025 at 09:17, Daniel Gustafsson wrote: > > On 10 Jul 2024, at 19:06, Imran Zaheer wrote: > > (Reviving an old thread to give them a chance to finish before v18) > > > For now maybe we can do the future proofing for gssapi & openssl includes > > and do testing if openssl clashes w

Re: [PATCH] Hex-coding optimizations using SVE on ARM.

2025-01-22 Thread chiranmoy.bhattacha...@fujitsu.com
> The approach looks generally reasonable to me, but IMHO the code needs much more commentary to explain how it works. Added comments to explain the SVE implementation. > I would be interested to see how your bytea test compares with the improvements added in commit e24d770 and with sending the

Re: [PATCH] Fix a tiny typo in the documentation

2025-01-22 Thread Daniel Gustafsson
> On 22 Jan 2025, at 11:23, Daniel Gustafsson wrote: >> On 22 Jan 2025, at 09:27, Robin Dupret wrote: >> -special provision: you must write >> +special provision you must write: > > Nice catch, will fix. Re-reading it I think both placements of ':' are grammatically correct (not being

Re: [PATCH] SVE popcount support

2025-01-22 Thread chiranmoy.bhattacha...@fujitsu.com
> This looks good. Thanks Chiranmoy and team. Can you address any other > feedback from Nathan or others here? Then we can pursue further reviews and > merging of the patch. Thank you for the review. If there is no further feedback from the community, may we submit the patch for the next commit

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-22 Thread Japin Li
On Wed, 22 Jan 2025 at 17:02, Yura Sokolov wrote: > I believe, I know why it happens: I was in hurry making v2 by > cherry-picking internal version. I reverted some changes in > CalcCuckooPositions manually and forgot to add modulo > PREV_LINKS_HASH_CAPA. > > Here's the fix: > > pos->pos[0

Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size

2025-01-22 Thread Shubham Khanna
On Fri, Jan 17, 2025 at 3:39 AM Peter Smith wrote: > > Patch v11-0001 LGTM. > > == Following the recent comments on Patch v11-0001, the patch was not applied to the HEAD. I have addressed the feedback and prepared a rebased version to incorporate the necessary adjustments. Please find the upd

Re: doc: explain pgstatindex fragmentation

2025-01-22 Thread Bertrand Drouvot
Hi, On Tue, Nov 05, 2024 at 06:36:47PM +0100, Frédéric Yhuel wrote: > Hi, I thought it would be nice to give the user a better idea of what > avg_leaf_density and leaf_fragmentation mean. > > Patch attached. What do you think? Yeah, I think that can not hurt to give more details, thanks for the

Re: [PATCH] Add roman support for to_number function

2025-01-22 Thread Hunaid Sohail
Hi, I have attached a new patch v8 with the following changes: 1. Fixed cases reported by Maciek. 2. Handles leading spaces in input string. I have also added a few more negative tests after Maciek reported a few cases. I have also updated the format in the round trip test: ...to_char(i, 'FMRN')

Re: [PATCH] Fix a tiny typo in the documentation

2025-01-22 Thread David G. Johnston
On Wednesday, January 22, 2025, Daniel Gustafsson wrote: > > On 22 Jan 2025, at 11:23, Daniel Gustafsson wrote: > >> On 22 Jan 2025, at 09:27, Robin Dupret wrote: > > >> -special provision: you must write > >> +special provision you must write: > > > > Nice catch, will fix. > > Re-readi

Converting pqsignal to void return

2025-01-22 Thread Paul Ramsey
Nathan, I just ran across this change when a bunch of CI’s I run barfed. https://github.com/postgres/postgres/commit/d4a43b283751b23d32bbfa1ecc2cad2d16e3dde9 The problem we are having in extension land is that we often run functions in external libraries that take a long time to return, and w

Re: create subscription with (origin = none, copy_data = on)

2025-01-22 Thread Sergey Tatarintsev
22.01.2025 18:41, Shlok Kyal пишет: On Wed, 22 Jan 2025 at 09:00, Zhijie Hou (Fujitsu) wrote: On Tuesday, January 21, 2025 1:31 AM vignesh C wrote: Hi, On Mon, 20 Jan 2025 at 17:31, Amit Kapila wrote: On Sat, Jan 18, 2025 at 10:31 AM vignesh C wrote: Attached patch has the fix for thi

Inconsistent string comparison using modified ICU collations

2025-01-22 Thread Oleg Tselebrovskiy
Greetings, everyone! I've discovered a bug with string comparison using modified ICU collations Using a direct comparison and sorting values gives different results The easiest way to reproduce is the following: postgres=# create collation "en-US-u-kr-latn-digit-x-icu" (provider = icu, loca

[PATCH] Fix a tiny typo in the documentation

2025-01-22 Thread Robin Dupret
Hello, This is a patch (against the master branch) to fix a tiny typo in the documentation. Here is the only file changed: * doc/src/sgml/ddl.sgml (This is the first time I send a patch so sorry if I missed something.) Have a nice day. --- doc/src/sgml/ddl.sgml | 2 +- 1 file changed, 1 inser

Re: Pgoutput not capturing the generated columns

2025-01-22 Thread Amit Kapila
On Tue, Jan 21, 2025 at 1:58 PM vignesh C wrote: > I have pushed the 0001 patch. I don't think 0002 and 0003 need to be committed separately. So, combine them in 0004 and post a new version. -- With Regards, Amit Kapila.

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-01-22 Thread Tatsuo Ishii
> Attached version moves the setting of IGNORE_NULLS to the window > function itself, with the functions that don't allow it erroring out. > This is done with a new api: WinCheckAndInitializeNullTreatment. > > Custom functions that don't call this will simply not have the > IGNORE_NULLS option set

Re: Pgoutput not capturing the generated columns

2025-01-22 Thread Peter Eisentraut
On 21.01.25 09:27, vignesh C wrote: Maybe I have some fundamental misunderstanding here, but I don't see why "this approach cannot be used with psql because older version servers may not have these columns". Not having the columns is the whole point of using an alias approach in the first place e

Re: pg_stat_statements: improve loading and saving routines for the dump file

2025-01-22 Thread m . litsarev
What does this patch give on aglobal scale? Does it save much memory or increase performance? How many times? This patch makes the code semantically more correct and we don't lose anything. It is obviously not about performance or memory optimisation. This will only reduce the size of the $P

Re: Pre-allocating WAL files

2025-01-22 Thread Andres Freund
Hi, On 2025-01-22 01:14:22 +, Andy Fan wrote: > Andres Freund writes: > > FWIW, I've seen the fsyncs around recycling being a rather substantial > > bottleneck. To the point of the main benefit of larger segments being the > > reduction in number of fsyncs at the end of a checkpoint. I think

Re: RFC: Additional Directory for Extensions

2025-01-22 Thread Peter Eisentraut
On 14.01.25 21:01, David E. Wheeler wrote: I tried `prefix` with semver[3] and it did not work: ``` console ❯ make PG_CONFIG=~/dev/misc/postgres/pgsql-devel/bin/pg_config prefix=/Users/david/pgsql-test gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -We

Re: Converting pqsignal to void return

2025-01-22 Thread Nathan Bossart
On Wed, Jan 22, 2025 at 07:57:52AM -0800, Paul Ramsey wrote: > I just ran across this change when a bunch of CI´s I run barfed. Oops, sorry. > The problem we are having in extension land is that we often run > functions in external libraries that take a long time to return, and we > would like to

Re: Quadratic planning time for ordered paths over partitioned tables

2025-01-22 Thread Alvaro Herrera
Hello, On 2025-Jan-22, Alexander Kuzmenkov wrote: > Hi hackers, > > There's currently an unfortunate CPU sink in the planning for > partitioned tables. It happens both for the declarative partitioning, > and for the partitioning through inheritance like we use in > TimescaleDB. > > The gist of

Re: Proposal for Updating CRC32C with AVX-512 Algorithm.

2025-01-22 Thread John Naylor
On Wed, Jan 22, 2025 at 12:46 AM Devulapalli, Raghuveer wrote: > > Is there any additional feedback for this patch? Hi Raghuveer, I raised one question and one concern upthread. I will repeat them here for convenience. #1 - The choice of AVX-512. There is no such thing as a "CRC instruction ope

Re: Orphaned users in PG16 and above can only be managed by Superusers

2025-01-22 Thread Ashutosh Sharma
Hi Robert, On Tue, Jan 21, 2025 at 10:22 PM Robert Haas wrote: > > On Thu, Jan 9, 2025 at 12:31 AM Ashutosh Sharma wrote: > > Starting from PG16, it seems that orphaned users can only be managed > > by superusers. For example, if userA creates userB, and userB creates > > userC, then both userB

Re: [PATCH] Hex-coding optimizations using SVE on ARM.

2025-01-22 Thread chiranmoy.bhattacha...@fujitsu.com
I realized I didn't attach the patch. v2-0001-SVE-support-for-hex-encode-and-hex-decode.patch Description: v2-0001-SVE-support-for-hex-encode-and-hex-decode.patch

Re: An improvement of ProcessTwoPhaseBuffer logic

2025-01-22 Thread Vitaly Davydov
Dear Hackers, I hope you may find this patch worth to consider. You may consider this patch as one more step to a complete migration to FullTransactionId in twophase.c for 17+ versions. The patch fixes TwoPhaseFilePath function. The current version gets TransactionId as an argument and makes a

Re: Set AUTOCOMMIT to on in script output by pg_dump

2025-01-22 Thread Shinya Kato
Hi, thank you for the reviews. On 2025-01-18 00:45, Robert Treat wrote: This looks pretty good to me. I think there are a couple of minor grammar changes that could be made, and I think the pg_dumpall section could use a couple tweaks, specifically 1) not all incantations of pg_dumpall emit psql

Re: create subscription with (origin = none, copy_data = on)

2025-01-22 Thread Shlok Kyal
On Wed, 22 Jan 2025 at 09:00, Zhijie Hou (Fujitsu) wrote: > > On Tuesday, January 21, 2025 1:31 AM vignesh C wrote: > > Hi, > > > > > On Mon, 20 Jan 2025 at 17:31, Amit Kapila wrote: > > > > > > On Sat, Jan 18, 2025 at 10:31 AM vignesh C wrote: > > > > > > > > Attached patch has the fix for thi

Quadratic planning time for ordered paths over partitioned tables

2025-01-22 Thread Alexander Kuzmenkov
Hi hackers, There's currently an unfortunate CPU sink in the planning for partitioned tables. It happens both for the declarative partitioning, and for the partitioning through inheritance like we use in TimescaleDB. The gist of it is that there's a linear search of the EM corresponding to the gi

Re: Pre-allocating WAL files

2025-01-22 Thread Nathan Bossart
On Tue, Jan 21, 2025 at 11:23:06AM -0500, Andres Freund wrote: > On 2025-01-21 10:13:14 -0600, Nathan Bossart wrote: >> On Tue, Jan 21, 2025 at 09:52:51AM -0600, Nathan Bossart wrote: >> > On Tue, Jan 21, 2025 at 03:31:27AM +, Andy Fan wrote: >> >> 3. Why is the purpose of preallocated_segments

Re: Pre-allocating WAL files

2025-01-22 Thread Nathan Bossart
On Wed, Jan 22, 2025 at 01:14:22AM +, Andy Fan wrote: > Andres Freund writes: >> FWIW, I've seen the fsyncs around recycling being a rather substantial >> bottleneck. To the point of the main benefit of larger segments being the >> reduction in number of fsyncs at the end of a checkpoint. I t

Re: [PATCH] SVE popcount support

2025-01-22 Thread Nathan Bossart
On Wed, Jan 22, 2025 at 11:04:22AM +, chiranmoy.bhattacha...@fujitsu.com wrote: > If there is no further feedback from the community, may we submit the > patch for the next commit fest? I would encourage you to create a commitfest entry so that it is picked up by our automated patch testing t

Re: pg_createsubscriber TAP test wrapping makes command options hard to read.

2025-01-22 Thread Dagfinn Ilmari Mannsåker
Hi Michael, Thanks for committing! Michael Paquier writes: > On Tue, Jan 21, 2025 at 02:17:03PM +, Dagfinn Ilmari Mannsåker wrote: >> Thanks again for reviewing this monster patch. > > +$node->command_checks_all( > + [ 'pg_amcheck', '--exclude-user' => 'no_such_user', 'postgres' ], > > Ex

Re: [PATCH] Fix a tiny typo in the documentation

2025-01-22 Thread Tom Lane
"David G. Johnston" writes: > On Wednesday, January 22, 2025, Daniel Gustafsson wrote: >> On 22 Jan 2025, at 11:23, Daniel Gustafsson wrote: >>> On 22 Jan 2025, at 09:27, Robin Dupret wrote: -special provision: you must write +special provision you must write: >> Re-reading i

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-01-22 Thread Bertrand Drouvot
Hi, On Mon, Jan 06, 2025 at 10:32:52PM -0800, Masahiko Sawada wrote: > On Mon, Jan 6, 2025 at 3:20 AM Ashutosh Bapat > wrote: > > > > On Sat, Jan 4, 2025 at 6:03 AM Masahiko Sawada > > wrote: > > > > > > On Fri, Jan 3, 2025 at 6:31 AM Euler Taveira wrote: > > > > > > > > On Fri, Jan 3, 2025, a

Re: Conflict detection for update_deleted in logical replication

2025-01-22 Thread Nisha Moond
On Sat, Jan 18, 2025 at 9:15 AM Zhijie Hou (Fujitsu) wrote: > > > Here is the V24 patch set. I modified 0004 patch to implement the slot > Invalidation part. Since the automatic recovery could be an optimization and > the discussion is in progress, I didn't implement that part. Few comments for p

Re: Windows: openssl & gssapi dislike each other

2025-01-22 Thread Daniel Gustafsson
> On 10 Jul 2024, at 19:06, Imran Zaheer wrote: (Reviving an old thread to give them a chance to finish before v18) > For now maybe we can do the future proofing for gssapi & openssl includes > and do testing if openssl clashes with some other lib too. Where did this end up, is compilation on W

Re: Adding a '--two-phase' option to 'pg_createsubscriber' utility.

2025-01-22 Thread Shubham Khanna
Hi, Following the recent comments on Patch v13-0001, the patch was not applied to the HEAD. I have addressed the feedback and prepared a rebased version to incorporate the necessary adjustments. Please find the updated patch. Thanks and regards, Shubham Khanna. v14-0001-Add-support-for-two-phas

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2025-01-22 Thread Laurenz Albe
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 makes the test a bit > simpler. > Thare are no other changes. When I tried to apply this patch, I

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-22 Thread Japin Li
On Wed, 22 Jan 2025 at 16:49, Japin Li wrote: > On Wed, 22 Jan 2025 at 11:22, Yura Sokolov wrote: >> 22.01.2025 10:54, Japin Li пишет: >>> On Wed, 22 Jan 2025 at 10:25, Yura Sokolov wrote: 22.01.2025 09:09, Japin Li пишет: > Hi, Yura Sokolov > Thanks for updating the patch. > I

Re: IWYU annotations

2025-01-22 Thread Peter Geoghegan
On Wed, Jan 22, 2025 at 9:08 AM Peter Eisentraut wrote: > > It might be worth holding off for now. It's possible that I'll find > > --header-insertion=iwyu has big problems in some unforeseen way. But > > offhand it looks like a real improvement, even though I foresee > > certain minor downsides.

Re: doc: explain pgstatindex fragmentation

2025-01-22 Thread Benoit Lobréau
Here is an updated patch to save you some time. -- Benoit Lobréau Consultant http://dalibo.com From 5d89ca0a36e98d1e5be858166a8394c09e0fa129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Yhuel?= Date: Tue, 5 Nov 2024 17:59:44 +0100 Subject: [PATCH] doc: explain pgstatindex fragme

Re: [PATCH] Fix a tiny typo in the documentation

2025-01-22 Thread Daniel Gustafsson
> On 22 Jan 2025, at 09:27, Robin Dupret wrote: > > Hello, > > This is a patch (against the master branch) to fix a tiny typo in the > documentation. > > Here is the only file changed: > > * doc/src/sgml/ddl.sgml > > (This is the first time I send a patch so sorry if I missed something.) No

Re: doc: explain pgstatindex fragmentation

2025-01-22 Thread Frédéric Yhuel
On 1/22/25 10:24, Benoit Lobréau wrote: Here is an updated patch to save you some time. Thanks ! it does seems better that way.

Enhance 'pg_createsubscriber' to retrieve databases automatically when no database is provided.

2025-01-22 Thread Shubham Khanna
Hi all, I am writing to propose an enhancement to the pg_createsubscriber utility that enables it to automatically fetch all non-template databases from the publisher when no specific databases are specified by the user. This was an open item from [1] that was planned for future implementation. Th

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-22 Thread Yura Sokolov
22.01.2025 15:37, Japin Li пишет: On Wed, 22 Jan 2025 at 16:49, Japin Li wrote: On Wed, 22 Jan 2025 at 11:22, Yura Sokolov wrote: 22.01.2025 10:54, Japin Li пишет: On Wed, 22 Jan 2025 at 10:25, Yura Sokolov wrote: 22.01.2025 09:09, Japin Li пишет: Hi, Yura Sokolov Thanks for updating the

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

2025-01-22 Thread Aleksander Alekseev
Hi everyone, Many thanks for all your great feedback. > In any case, Aleksander, I don't mean to sign you up for all that; the > `ssl` suite also seems good enough to me if you're interested in > pursuing that side of the patch further. OK, I moved the named tests to src/test/ssl/t/003_sslinfo.p

Re: IWYU annotations

2025-01-22 Thread Peter Eisentraut
On 15.01.25 20:51, Peter Geoghegan wrote: On Wed, Jan 15, 2025 at 2:21 PM Peter Eisentraut wrote: I have committed this. Thanks for the feedback. Thanks for working on this. Is it worth documenting how to get clangd working sensibly with "--header-insertion=iwyu"? I enabled it just now. I

Re: [RFC] Lock-free XLog Reservation from WAL

2025-01-22 Thread Yura Sokolov
22.01.2025 10:54, Japin Li wrote: On Wed, 22 Jan 2025 at 10:25, Yura Sokolov wrote: 22.01.2025 09:09, Japin Li пишет: Hi, Yura Sokolov Thanks for updating the patch. I test the v2 patch using BenchmarkSQL 1000 warehouse, and here is the tpmC result: case | min| avg

dblink: Add SCRAM pass-through authentication

2025-01-22 Thread Matheus Alcantara
Hi, The attached patch enables SCRAM authentication for dblink connections when using dblink_fdw without requiring a plain-text password on user mapping properties. The implementation is very similar to what was implemented on postgres_fdw [0]. To make it more closer to what was implemented on po

Re: Converting pqsignal to void return

2025-01-22 Thread Andres Freund
Hi, On 2025-01-22 07:57:52 -0800, Paul Ramsey wrote: > I just ran across this change when a bunch of CI’s I run barfed. > > https://github.com/postgres/postgres/commit/d4a43b283751b23d32bbfa1ecc2cad2d16e3dde9 > > The problem we are having in extension land is that we often run functions > in exter

Re: Quadratic planning time for ordered paths over partitioned tables

2025-01-22 Thread Alexander Kuzmenkov
On Wed, Jan 22, 2025 at 5:36 PM Alvaro Herrera wrote: > I think this is closely related to the work Yuya Watari has been doing > at > https://postgr.es/m/caj2pmkzzhrhgq5uv0y+stkqx7xvgzenmhl98ubkm-oarvk9...@mail.gmail.com > Perhaps you could contribute by reviewing that patch series. Yeah, I'm ref

Re: pg_attribute_noreturn(), MSVC, C11

2025-01-22 Thread Peter Eisentraut
On 06.01.25 15:52, Peter Eisentraut wrote: On 03.01.25 21:51, Dagfinn Ilmari Mannsåker wrote: Peter Eisentraut writes: I suggest we define pg_noreturn as 1. If C11 is supported, then _Noreturn, else 2. If GCC-compatible, then __attribute__((noreturn)), else Would it be worth also checking

Re: Replace current implementations in crypt() and gen_salt() to OpenSSL

2025-01-22 Thread Joe Conway
On 1/21/25 17:57, Daniel Gustafsson wrote: On 21 Jan 2025, at 22:13, Joe Conway wrote: I think this is a non-issue. Every implementation I have seen, the OS-level enabling of FIPS mode is just a way to ensure openssl is automatically put into FIPS mode when the library is loaded, just as if

Re: Converting pqsignal to void return

2025-01-22 Thread Andres Freund
Hi, On 2025-01-22 09:50:18 -0800, Paul Ramsey wrote: > > On Jan 22, 2025, at 9:36 AM, Andres Freund wrote: > > On 2025-01-22 10:22:45 -0600, Nathan Bossart wrote: > >> On Wed, Jan 22, 2025 at 07:57:52AM -0800, Paul Ramsey wrote: > >>> The problem we are having in extension land is that we often r

Re: Wrong security context for deferred triggers?

2025-01-22 Thread Tom Lane
Laurenz Albe writes: > [ v4-0001-Make-AFTER-triggers-run-with-the-correct-user.patch ] I started to look at this and got distracted by wondering why afterTriggerAddEvent's scanning loop wasn't checking ats_modifiedcols. That led to ea68ea632, which means this now needs a minor rebase. I have a c

Re: Update Unicode data to Unicode 16.0.0

2025-01-22 Thread Jeff Davis
On Wed, 2025-01-22 at 19:08 +0100, Peter Eisentraut wrote: > But I don't think it would be a compile-time decision.  I think it > would > be a run-time selection, similar to the theorized multiple-ICU- > versions > feature.  (Those two features might even go together, since a given > ICU > versi

Re: XMLDocument (SQL/XML X030)

2025-01-22 Thread Robert Treat
On Tue, Jan 21, 2025 at 6:36 PM Jim Jones wrote: > On 21.01.25 23:45, Robert Treat wrote: > > Is there some concrete use case you have seen that this would help > > with? Not objecting to adding it, but you've mentioned this migration > > idea twice but it seems to me this doesn't conform with exi

Re: Issue with markers in isolation tester? Or not?

2025-01-22 Thread Noah Misch
On Sun, Jan 19, 2025 at 09:55:32PM +0100, Michail Nikolaev wrote: > > Stepping back, any variation in the total ordering of step-start and > > step-complete events necessarily changes the expected output. Hence, we > want > > to freeze that ordering. We could do that directly, by having > isola

Re: [PATCH] Add roman support for to_number function

2025-01-22 Thread Tom Lane
Hunaid Sohail writes: > I have attached a new patch v8 with the following changes: > 1. Fixed cases reported by Maciek. > 2. Handles leading spaces in input string. I pushed this after fooling with it a bit more: * The way you did the leading-space skip would actually skip anything whatsoever un

Re: Update Unicode data to Unicode 16.0.0

2025-01-22 Thread Peter Eisentraut
On 20.01.25 22:39, Jeff Davis wrote: On Fri, 2024-11-15 at 17:09 +0100, Peter Eisentraut wrote: The practice of regularly updating the Unicode files is older than the builtin collation provider.  It is similar to updating the time zone files, the encoding conversion files, the snowball files, et

Re: attndims, typndims still not enforced, but make the value within a sane threshold

2025-01-22 Thread Bruce Momjian
On Tue, Jan 21, 2025 at 03:23:31PM -0500, Tom Lane wrote: > Bruce Momjian writes: > > I did write a patch in Novemer 2023 to pass the dimension to the layers > > that needed it, but it was considered too much code compared to its > > value: > > https://www.postgresql.org/message-id/zvwi_ozt8z9

Re: Sample rate added to pg_stat_statements

2025-01-22 Thread Ilia Evdokimov
On 20.01.2025 17:20, Ilia Evdokimov wrote: On 15.01.2025 20:16, Sami Imseih wrote: Probably, but first I suggest benchmarking with sampling applied to all queries. If the results are good, we can later filter certain queries based on different characteristics. Absolutely. The benchmark numbe

Re: Wrong security context for deferred triggers?

2025-01-22 Thread Tom Lane
I wrote: > * It's kind of sad that we have to add yet another field to > AfterTriggerSharedData, especially since this one will cost 8 bytes > thanks to alignment considerations. I'm not sure if there's another > way, but it seems like ats_relid, ats_rolid, and ats_modifiedcols > are all going to

Re: Update Unicode data to Unicode 16.0.0

2025-01-22 Thread Jeff Davis
On Wed, 2025-01-22 at 19:03 +0100, Peter Eisentraut wrote: > Building a collation provider on this came much later.  It was > possibly > a mistake how that was done. It wasn't a mistake. "Stability within a PG major version" was called a *benefit* near the top of the first email on the subject[1]

Re: Converting pqsignal to void return

2025-01-22 Thread Paul Ramsey
> On Jan 22, 2025, at 9:36 AM, Andres Freund wrote: > > Hi, > > On 2025-01-22 10:22:45 -0600, Nathan Bossart wrote: >> On Wed, Jan 22, 2025 at 07:57:52AM -0800, Paul Ramsey wrote: >>> The problem we are having in extension land is that we often run >>> functions in external libraries that tak

Invalid index on partitioned table - is this a bug or feature?

2025-01-22 Thread Dmitry Koval
Hi! If you create an index on a partitioned table using a method that uses pg_dump: (a) "ALTER TABLE ONLY ... ADD CONSTRAINT .. PRIMARY KEY ..." or (b) "CREATE INDEX ... ON ONLY ..." then the index for the partitioned table is created with the INVALID flag.This can be verified using an exampl

Re: Converting pqsignal to void return

2025-01-22 Thread Paul Ramsey
> On Jan 22, 2025, at 8:50 AM, Andres Freund wrote: > >> It is possible we have been Doing It Wrong all this time, and would love >> some pointers on the right way to do this. > > All your interrupt handler is doing "for you" is setting > http_interrupt_requested, right? Why do you need tha

Re: Converting pqsignal to void return

2025-01-22 Thread Andres Freund
Hi, On 2025-01-22 11:50:30 -0500, Andres Freund wrote: > On 2025-01-22 07:57:52 -0800, Paul Ramsey wrote: > > It is possible we have been Doing It Wrong all this time, and would love > > some pointers on the right way to do this. > > All your interrupt handler is doing "for you" is setting > htt

Re: Pre-allocating WAL files

2025-01-22 Thread Nathan Bossart
On Wed, Jan 22, 2025 at 11:21:03AM -0500, Andres Freund wrote: > fsync(open(oldname1)); > fsync(open(oldname2)); > .. > fsync(open(oldnameN)); > > rename(oldname1, newname1); > rename(oldname2, newname2); > .. > rename(oldnameN, newnameN); > > fsync(open(newname1)); > fsync(open(newname2)); > ..

Re: Converting pqsignal to void return

2025-01-22 Thread Andres Freund
Hi, On 2025-01-22 10:22:45 -0600, Nathan Bossart wrote: > On Wed, Jan 22, 2025 at 07:57:52AM -0800, Paul Ramsey wrote: > > The problem we are having in extension land is that we often run > > functions in external libraries that take a long time to return, and we > > would like to ensure that PgSQ

Re: Proposal: "query_work_mem" GUC, to distribute working memory to the query's individual operators

2025-01-22 Thread Tomas Vondra
On 1/21/25 22:26, Jeff Davis wrote: > On Fri, 2025-01-10 at 10:00 -0800, James Hunter wrote: >> How should “query_work_mem” work? Let’s start with an example: >> suppose >> we have an OLAP query that has 2 Hash Joins, and no other operators >> that use work_mem. > > So we plan first, and then assi

Re: 回复:Re: 回复:Re: speed up pg_upgrade with large number of tables

2025-01-22 Thread Nathan Bossart
On Sun, Jan 19, 2025 at 03:57:18PM -0800, Hari Krishna Sunder wrote: > The restore side speedups suggested by Yang seem reasonable and can > potentially speed up the process. We can even go a bit further by starting > the new postgres in a --binary-upgrade mode and skip some of these locks > comple

Re: XMLDocument (SQL/XML X030)

2025-01-22 Thread Jim Jones
Hi Chapman & Robert Many thanks for the input On 22.01.25 22:35, Chapman Flack wrote: > On 01/22/25 13:41, Robert Treat wrote: >> So even if we are following the spec (which I think technically we may >> not be), > There are definite ways in which we're not following the SQL/XML spec, > which we

Re: Pgoutput not capturing the generated columns

2025-01-22 Thread Peter Smith
Some review comments for patch v54-0004. (since preparing this post, I saw you have already posted v55-0001 but AFAIK, since 55-0001 is just a merge, the same review comments are still applicable) == doc/src/sgml/catalogs.sgml 1. - If true, this publication replicates the store

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-01-22 Thread Masahiko Sawada
On Fri, Jan 10, 2025 at 12:33 AM Masahiko Sawada wrote: > > On Thu, Jan 9, 2025 at 3:29 AM Ashutosh Bapat > wrote: > > > > On Tue, Dec 31, 2024 at 10:15 AM Masahiko Sawada > > wrote: > > > > > > Hi all, > > > > > > Logical decoding (and logical replication) are available only when > > > wal_lev

Re: Pgoutput not capturing the generated columns

2025-01-22 Thread Peter Smith
On Thu, Jan 23, 2025 at 1:00 AM vignesh C wrote: > > On Wed, 22 Jan 2025 at 16:22, Amit Kapila wrote: > > > > On Tue, Jan 21, 2025 at 1:58 PM vignesh C wrote: > > > > > > > I have pushed the 0001 patch. I don't think 0002 and 0003 need to be > > committed separately. So, combine them in 0004 and

Re: POC: enable logical decoding when wal_level = 'replica' without a server restart

2025-01-22 Thread Masahiko Sawada
On Wed, Jan 22, 2025 at 2:04 AM Bertrand Drouvot wrote: > > Hi, > > On Mon, Jan 06, 2025 at 10:32:52PM -0800, Masahiko Sawada wrote: > > On Mon, Jan 6, 2025 at 3:20 AM Ashutosh Bapat > > wrote: > > > > > > On Sat, Jan 4, 2025 at 6:03 AM Masahiko Sawada > > > wrote: > > > > > > > > On Fri, Jan 3

Re: Purpose of wal_init_zero

2025-01-22 Thread Robert Pang
On Wed, Jan 15, 2025 at 12:05 PM Andres Freund wrote: > > If you have wal_recycle=true, this overhead will only be paid the first time a > WAL segment is used, of course, not after recycling. Today, our pg_stat_wal view [1] does not report the no. of WAL segments recycled. How about if we add a c

Re: Proposal: "query_work_mem" GUC, to distribute working memory to the query's individual operators

2025-01-22 Thread Tomas Vondra
On 1/10/25 19:00, James Hunter wrote: > ... > > **Proposal:** > > I propose that we add a “query_work_mem” GUC, which works by > distributing (using some algorithm to be described in a follow-up > email) the entire “query_work_mem” to the query’s operators. And then > each operator will spill when

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-01-22 Thread Melanie Plageman
On Mon, Dec 9, 2024 at 1:22 AM Dilip Kumar wrote: > > Are we planning to commit this refactoring? I think this refactoring > makes the overall code of BitmapHeapNext() quite clean and readable. > I haven't read all patches but 0001-0006 including 0009 makes this > code quite clean and readable. I

Re: Invalid index on partitioned table - is this a bug or feature?

2025-01-22 Thread Álvaro Herrera
On 2025-Jan-22, Dmitry Koval wrote: > Hi! > If you create an index on a partitioned table using a method that uses > pg_dump: > > (a) "ALTER TABLE ONLY ... ADD CONSTRAINT .. PRIMARY KEY ..." > or > (b) "CREATE INDEX ... ON ONLY ..." > > then the index for the partitioned table is created with th

Re: Quadratic planning time for ordered paths over partitioned tables

2025-01-22 Thread Alexander Kuzmenkov
On Wed, Jan 22, 2025 at 6:15 PM Tom Lane wrote: > Really I'd think the right place to be fixing this is at a higher > level. Where are the repetitive find_ec_member_matching_expr calls > coming from? I'm not aware of the repeated calls for the same child, and I mostly see it called once for ever

Re: Quadratic planning time for ordered paths over partitioned tables

2025-01-22 Thread Tom Lane
Alexander Kuzmenkov writes: > Yeah, I'm referencing this one in my email, but it's a series of > patches that does a major refactoring changing thousands of lines. I'm > not sure when or if it's going to land, do you think applying a quick > fix first would make sense? It makes trivial changes in

Re: Pre-allocating WAL files

2025-01-22 Thread Andres Freund
Hi, On 2025-01-22 11:43:20 -0600, Nathan Bossart wrote: > On Wed, Jan 22, 2025 at 11:21:03AM -0500, Andres Freund wrote: > > fsync(open(oldname1)); > > fsync(open(oldname2)); > > .. > > fsync(open(oldnameN)); > > > > rename(oldname1, newname1); > > rename(oldname2, newname2); > > .. > > rename(old

Re: Invalid index on partitioned table - is this a bug or feature?

2025-01-22 Thread Dmitry Koval
22.01.2025 20:57, Álvaro Herrera пишет: Yes. You need to attach child indexes on all partitions so that this index becomes valid. Thanks! -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com

Re: Update Unicode data to Unicode 16.0.0

2025-01-22 Thread Peter Eisentraut
On 21.01.25 02:06, Jeremy Schneider wrote: FWIW, after adding ICU support I personally don't think there's a pressing need to continue updating the tables anymore. That appears to ignore what these tables are actually used for. They are used for Unicode normalization, which is used by SCRAM.

Re: [PATCH] Add get_bytes() and set_bytes() functions

2025-01-22 Thread Peter Eisentraut
On 20.01.25 15:01, Aleksander Alekseev wrote: > This should use ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE, rather than > ERRCODE_INVALID_PARAMETER_VALUE, for consistency with other similar > errors. > > The bytea -> int[248] cast functions should not be marked as leakproof > -- see the docs on the

Re: Set AUTOCOMMIT to on in script output by pg_dump

2025-01-22 Thread Robert Treat
On Wed, Jan 22, 2025 at 8:02 AM Shinya Kato wrote: > > Hi, thank you for the reviews. > > On 2025-01-18 00:45, Robert Treat wrote: > > This looks pretty good to me. I think there are a couple of minor > > grammar changes that could be made, and I think the pg_dumpall section > > could use a couple

Re: Proposal: "query_work_mem" GUC, to distribute working memory to the query's individual operators

2025-01-22 Thread Jeff Davis
On Wed, 2025-01-22 at 21:48 +0100, Tomas Vondra wrote: > But these estimates are often pretty fundamentally unreliable - maybe > not for simple examples, but once you put an aggregate on top of a > join, > the errors can be pretty wild. It would be conditional on whether there's some kind of memor

Re: Eagerly scan all-visible pages to amortize aggressive vacuum

2025-01-22 Thread Melanie Plageman
On Sat, Jan 18, 2025 at 12:10 PM Robert Treat wrote: > > Hey Melanie, took a walk through this version, some minor thoughts below. Thanks! Attached v9 incorporates all your suggested changes. > --- a/doc/src/sgml/config.sgml > +++ b/doc/src/sgml/config.sgml > @@ -9128,9 +9128,10 @@ COPY postgres

Re: Replace current implementations in crypt() and gen_salt() to OpenSSL

2025-01-22 Thread Daniel Gustafsson
> On 22 Jan 2025, at 19:59, Joe Conway wrote: > I found it necessary to add: > #include > in > contrib/pgcrypto/openssl.c > to avoid a symbol not defined warning. Makes sense, it doesn't reproduce in my tree but reading OpenSSL code it seems very plausible (and clearly happens in your environ

Re: Extended Statistics set/restore/clear functions.

2025-01-22 Thread Tomas Vondra
Hi, Thanks for continuing to work on this. On 1/22/25 19:17, Corey Huinker wrote: > This is a separate thread for work started in [1] but focused purely on > getting the following functions working: > > * pg_set_extended_stats > * pg_clear_extended_stats > * pg_restore_extended_stats > > These

Re: Quadratic planning time for ordered paths over partitioned tables

2025-01-22 Thread Alvaro Herrera
On 2025-Jan-22, Alexander Kuzmenkov wrote: > On Wed, Jan 22, 2025 at 5:36 PM Alvaro Herrera > wrote: > > I think this is closely related to the work Yuya Watari has been doing > > at > > https://postgr.es/m/caj2pmkzzhrhgq5uv0y+stkqx7xvgzenmhl98ubkm-oarvk9...@mail.gmail.com > > Perhaps you could

Re: XMLDocument (SQL/XML X030)

2025-01-22 Thread Chapman Flack
On 01/22/25 13:41, Robert Treat wrote: > So even if we are following the spec (which I think technically we may > not be), There are definite ways in which we're not following the SQL/XML spec, which we document in an appendix[1]. The one that matters here is that we just have a single XML type in

Re: Change GUC hashtable to use simplehash?

2025-01-22 Thread Anton A. Melnikov
Hi! On 22.01.2025 11:37, John Naylor wrote: On Fri, Jan 17, 2025 at 4:50 PM John Naylor wrote: It would be a lot more readable to revert the offending commit instead, since its predecessor had a much simpler bytewise loop. Agreed that reverting seems as a preferable way, and here's why. I f

Re: create subscription with (origin = none, copy_data = on)

2025-01-22 Thread Amit Kapila
On Wed, Jan 22, 2025 at 9:44 PM Sergey Tatarintsev wrote: > > 22.01.2025 18:41, Shlok Kyal пишет: > > Also we still don't care about foreign partitions (as I wrote earlier > we should raise an ERROR for such publications). > I think dealing with this separately from the origin vs. partitioned ta

Re: Skip collecting decoded changes of already-aborted transactions

2025-01-22 Thread Amit Kapila
On Wed, Jan 22, 2025 at 9:21 AM Peter Smith wrote: > > On Wed, Jan 22, 2025 at 5:36 AM Masahiko Sawada wrote: > > > > On Sun, Jan 19, 2025 at 7:53 PM Amit Kapila wrote: > > > > > > On Fri, Jan 17, 2025 at 11:19 PM Masahiko Sawada > > > wrote: > > > > > > > > On Wed, Jan 15, 2025 at 4:43 PM Pet

Re: Doc: Move standalone backup section, mention -X argument

2025-01-22 Thread David G. Johnston
On Wed, Jan 22, 2025 at 1:54 AM Benoit Lobréau wrote: > I don’t think pg_basebackup fits naturally under the "File System Level > Backup" section. I considered creating a "Standalone Physical Backup" > section with two subsections: FS-level backups and pg_basebackup, but > that didn’t feel right

Re: Adding a '--two-phase' option to 'pg_createsubscriber' utility.

2025-01-22 Thread Peter Smith
Patch v14-0001 LGTM == Kind Regards, Peter Smith. Fujitsu Australia

Re: Converting pqsignal to void return

2025-01-22 Thread Michael Paquier
On Wed, Jan 22, 2025 at 09:01:09AM -0800, Paul Ramsey wrote: > This is the Knowledge that was sitting right in front of me, but I could not > see. > From the road to Damascus, Note also that there is some documentation showing how to write a signal handler and what should not be done: https://www

  1   2   >