Re: [PATCH] Optionally record Plan IDs to track plan changes for a query

2025-01-23 Thread Lukas Fittl
On Tue, Jan 21, 2025 at 10:47 AM Artem Gavrilov wrote: > We have another extension that does plan ID tracking: pg_stat_monitor. So > I think it would be great to have this functionality in core. > Thanks! I had forgotten that pg_stat_monitor can optionally track plan statistics. Its actually ano

Re: POC: track vacuum/analyze cumulative time per relation

2025-01-23 Thread Michael Paquier
On Mon, Jan 20, 2025 at 11:04:40AM -0600, Sami Imseih wrote: >> + PgStat_Counter total_vacuum_time; >> + PgStat_Counter total_autovacuum_time; >> + PgStat_Counter total_analyze_time; >> + PgStat_Counter total_autoanalyze_time; >> } PgStat_StatTabEntry; >> These are time val

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread vignesh C
On Fri, 24 Jan 2025 at 10:36, vignesh C wrote: > > On Fri, 24 Jan 2025 at 09:51, Tom Lane wrote: > > > > Amit Kapila writes: > > > On Fri, Jan 24, 2025 at 8:39 AM Tom Lane wrote: > > >> I think the problem is not so much the underscore as the > > >> inconsistency. You've got "pub", "gen", and

Re: pure parsers and reentrant scanners

2025-01-23 Thread Peter Eisentraut
On 17.01.25 16:40, Peter Eisentraut wrote: Here are some more patches.  This should cover the last sub-topic of this topic: not passing the yyparse() result via global variables.  This uses techniques that are already in use in some parsers in the tree, for example cube and jsonpath.  The syncr

Re: Improve verification of recovery_target_timeline GUC.

2025-01-23 Thread Michael Paquier
On Thu, Jan 23, 2025 at 02:53:39PM +, David Steele wrote: > Currently check_recovery_target_timeline() converts any value that is not > current, latest, or a valid integer to 0. So for example: > > recovery_target_timeline = 'currrent' > > results in the following error: > > FATAL: 22023: r

Re: Disabling vacuum truncate for autovacuum

2025-01-23 Thread Gurjeet Singh
(moving discussion to -hackers, for patch-review) On Mon, Dec 16, 2024 at 11:30 PM Laurenz Albe wrote: > > On Mon, 2024-12-16 at 16:25 -0800, Will Storey wrote: > > I would like to disable vacuum's truncate behaviour for autovacuum. > > Previously I had an outage due to its access exclusive lock

Re: XMLDocument (SQL/XML X030)

2025-01-23 Thread Pavel Stehule
čt 23. 1. 2025 v 16:06 odesílatel Jim Jones napsal: > Hi > > On 23.01.25 07:50, Pavel Stehule wrote: > > I think so in this form (just forward input to output) I have no > > objection. > > > > There is a benefit with a) possible zero work with migration from db2, > > b) nobody needs to repeat a w

RE: Proposal: Filter irrelevant change before reassemble transactions during logical decoding

2025-01-23 Thread Zhijie Hou (Fujitsu)
Hi, I think the proposed feature is interesting, and after reviewing the original discussion thread, I'd like to help move it forward. To that end, I've summarized the key points of the discussion so far, including the challenges highlighted in the thread and some issues I identified off-list, alo

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

2025-01-23 Thread Michael Paquier
On Thu, Jan 23, 2025 at 08:25:45PM +, Dagfinn Ilmari Mannsåker wrote: > Here's a patch for that. Thanks. I had a bit of time today and applied it. - 'multiple -c options with different case'); + 'multiple ---set options with different case'); This description had one character i

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread vignesh C
On Fri, 24 Jan 2025 at 09:51, Tom Lane wrote: > > Amit Kapila writes: > > On Fri, Jan 24, 2025 at 8:39 AM Tom Lane wrote: > >> I think the problem is not so much the underscore as the > >> inconsistency. You've got "pub", "gen", and "cols" run together, > >> but then you feel a need to separate

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

2025-01-23 Thread Shlok Kyal
On Thu, 23 Jan 2025 at 17:54, Zhijie Hou (Fujitsu) wrote: > > On Thursday, January 23, 2025 4:43 PM Shlok Kyal > wrote: > > > > On Thu, 23 Jan 2025 at 12:35, Shlok Kyal wrote: > > > > > > On Wed, 22 Jan 2025 at 09:00, Zhijie Hou (Fujitsu) > > > wrote: > > > > > > > > Thanks for the patch. > >

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread Tom Lane
Amit Kapila writes: > On Fri, Jan 24, 2025 at 8:39 AM Tom Lane wrote: >> I think the problem is not so much the underscore as the >> inconsistency. You've got "pub", "gen", and "cols" run together, >> but then you feel a need to separate "type"? > It was easy to read and to avoid getting a sing

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread Amit Kapila
On Fri, Jan 24, 2025 at 8:39 AM Tom Lane wrote: > > Amit Kapila writes: > > On Fri, Jan 24, 2025 at 4:41 AM Peter Smith wrote: > >> However, in hindsight, I am not sure that the column should have been > >> renamed 'pubgencols_type' in the first place because I cannot find any > >> other catalog

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread Tom Lane
Amit Kapila writes: > On Fri, Jan 24, 2025 at 4:41 AM Peter Smith wrote: >> However, in hindsight, I am not sure that the column should have been >> renamed 'pubgencols_type' in the first place because I cannot find any >> other catalogs with an underscore in their column names. > See pg_rewrite

Re: SQL:2011 application time

2025-01-23 Thread Tom Lane
Paul Jungwirth writes: > On 1/23/25 15:28, Tom Lane wrote: >> I've only noticed the two, but I did not mount an aggressive search. >> It's possible that there were failures before 1772d554b0, since I >> now see that the diff is in a test case that is older than that. > Okay, I'll keep in mind tha

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

2025-01-23 Thread Peter Smith
On Thu, Jan 23, 2025 at 10:33 PM Ashutosh Bapat wrote: > > On Wed, Jan 22, 2025 at 7:29 PM Shubham Khanna > wrote: > > > > 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 p

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread Amit Kapila
On Fri, Jan 24, 2025 at 4:41 AM Peter Smith wrote: > > However, in hindsight, I am not sure that the column should have been > renamed 'pubgencols_type' in the first place because I cannot find any > other catalogs with an underscore in their column names. > See pg_rewrite.ev_type for a similar c

Re: Allow NOT VALID foreign key constraints on partitioned tables.

2025-01-23 Thread Tom Lane
=?utf-8?Q?=C3=81lvaro?= Herrera writes: > OK thanks, looks good, I have pushed it now with some trivial > amendments. Looks like some of the queries need ORDER BY for stability. https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=morepork&dt=2025-01-23%2023%3A35%3A57

Re: [PATCH] Optionally record Plan IDs to track plan changes for a query

2025-01-23 Thread Sami Imseih
Thanks for starting this thread. This is an important feature. I am still reviewing, but wanted to share some initial comments. == pg_stat_plans extension (0004) 1. pg_stat_plans_1_0 should not call pgstat_fetch_entry.l This is not needed since we already have the entry with a shared lock and it

Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size

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

Re: Extended Statistics set/restore/clear functions.

2025-01-23 Thread Corey Huinker
> > I see there's a couple MCV-specific functions in the extended_stats.c. >> Shouldn't those go into mvc.c instead? >> > > I wanted to put it there, but there was a reason I didn't and I've now > forgotten what it was. I'll make an effort to relocate it to mcv.c. > Looking at it now, I see that c

Re: SQL:2011 application time

2025-01-23 Thread Paul Jungwirth
On 1/23/25 15:28, Tom Lane wrote: Paul Jungwirth writes: I can't find a regression.diffs in the second link. Is there one? I can't tell if it's the same failure as in the first link as not. It is the same, but the diff is buried in some other file, probably regress_log_027_stream_regress.

Re: SQL:2011 application time

2025-01-23 Thread Tom Lane
Paul Jungwirth writes: > I can't find a regression.diffs in the second link. Is there one? I can't > tell if it's the same > failure as in the first link as not. It is the same, but the diff is buried in some other file, probably regress_log_027_stream_regress. > I ran installcheck-parallel on

Re: Self contradictory examining on rel's baserestrictinfo

2025-01-23 Thread Tom Lane
I wrote: > This is not a fundamental shortcoming in the system, it's just > that optimizer/util/predtest.c has not been built out very far > with respect to BooleanTest nodes. Oh ... I'd momentarily forgotten that there's already a patch in the queue to attack that: https://commitfest.postgresql.

Re: SQL:2011 application time

2025-01-23 Thread Paul Jungwirth
On 1/23/25 07:31, Peter Eisentraut wrote: On 22.01.25 05:00, Tom Lane wrote: Peter Eisentraut writes: I have committed the fix for foreign key NO ACTION (patch 0002, this did not require patch 0001). That commit seems to be causing occasional buildfarm failures: https://buildfarm.postgresql

Re: Increase of maintenance_work_mem limit in 64-bit Windows

2025-01-23 Thread Tom Lane
v.popoli...@postgrespro.ru writes: > [ v2-0001-work_mem_vars-limit-increased-in-64bit-Windows.patch ] I took a brief look at this. I think it's generally going in the right direction, but you seem to be all over the place on how you are doing the casts: + if (metadata->nPendingPages * GIN_

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread Peter Smith
On Fri, Jan 24, 2025 at 12:03 AM Shinoda, Noriyoshi (SXD Japan FSI) wrote: > > Hi, hackers. > > Thanks for developing this great feature. > The documentation for the pg_publication catalog shows a 'pubgencols' column, > but the actual column name is the 'pubgencols_type' column. > Also, the order

Fix assert failure when decoding XLOG_PARAMETER_CHANGE on primary

2025-01-23 Thread Masahiko Sawada
Hi all, When a standby replays a XLOG_PARAMETER_CHANGE record that lowers wal_level from logical, we invalidate all logical slots only when the standby is in hot standby mode: if (InRecovery && InHotStandby && xlrec.wal_level < WAL_LEVEL_LOGICAL && wal_level >= WAL_LEVEL_LOGICAL) Inva

Re: Self contradictory examining on rel's baserestrictinfo

2025-01-23 Thread Tom Lane
Robert Haas writes: > On Wed, Nov 27, 2024 at 10:28 AM ro b wrote: >> I mean why can't draw the conclusions >> like the case a>1 and a>2 which can be simplified >> to a>2 if the operator > is btree opclass. > This question has already been discussed in some detail on this email > thread. First,

Re: Inconsistent string comparison using modified ICU collations

2025-01-23 Thread Daniel Verite
Oleg Tselebrovskiy wrote: > 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-dig

Re: Inconsistent string comparison using modified ICU collations

2025-01-23 Thread Jeff Davis
On Wed, 2025-01-22 at 12:03 +0300, Oleg Tselebrovskiy wrote: > In the second example of sorting values, function > varstr_abbrev_convert Thank you for the report! I had previously proposed[1] a GUC to control abbreviated keys, and it was rejected. Now that we've seen both a performance problem a

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

2025-01-23 Thread Robert Haas
On Wed, Jan 22, 2025 at 5:48 PM Melanie Plageman wrote: > Circling back to benchmarking, I've been running the most adversarial > benchmarks I could devise and can share a bit of what I've found. > > I created a "hot tail" benchmark where 16 clients insert some data and > then update some data ol

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

2025-01-23 Thread Joe Conway
On 1/22/25 17:49, Daniel Gustafsson wrote: 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

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

2025-01-23 Thread Robert Haas
On Thu, Jan 23, 2025 at 3:51 PM Andres Freund wrote: > I wonder if it's a mistake that a role membership that has WITH ADMIN on > another role is silently removed if the member role is removed. We e.g. do > *not* do that for pg_auth_members.grantor: > > ERROR: 2BP01: role "r1" cannot be dropped b

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

2025-01-23 Thread Robert Haas
On Thu, Jan 23, 2025 at 4:02 PM Robert Haas wrote: > On Wed, Jan 22, 2025 at 6:08 AM Ashutosh Sharma wrote: > > Thanks for sharing your thoughts and inputs. I'm also not quite clear > > about the fix. Some of the solutions/changes you've mentioned above > > seem quite complex and may not be reaso

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

2025-01-23 Thread Robert Haas
On Wed, Jan 22, 2025 at 6:08 AM Ashutosh Sharma wrote: > Thanks for sharing your thoughts and inputs. I'm also not quite clear > about the fix. Some of the solutions/changes you've mentioned above > seem quite complex and may not be reasonable, as you pointed out. How > about introducing a new pre

Re: Extended Statistics set/restore/clear functions.

2025-01-23 Thread Corey Huinker
> > > > > * no negative attnums in key list > Disregard this suggestion - negative attnums mean the Nth expression in the extended stats object, though it boggles the mind how we could have 222 expressions... > > * no duplicate attnums in key list > This one is still live, am considering. At

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

2025-01-23 Thread Andres Freund
Hi, On 2025-01-23 20:55:25 +0100, Tomas Vondra wrote: > If this stopped working in PG16, then how/why did it work in PG15? Is > that intentional change? Yes, it was intentional: Restrict the privileges of CREATEROLE and its ability to modify other roles (Robert Haas) Previously ro

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

2025-01-23 Thread Dagfinn Ilmari Mannsåker
Michael Paquier writes: > Note that there are a few more under "Locale provider tests" in the > initdb tests. I've left that as a follow-up thing, that was already a > lot.. Here's a patch for that. - ilmari >From d787bf86ded9f66e12325a7460761d6d10fccbe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8

Re: Extended Statistics set/restore/clear functions.

2025-01-23 Thread Tomas Vondra
On 1/23/25 15:51, Corey Huinker wrote: > On Wed, Jan 22, 2025 at 5:50 PM Tomas Vondra > wrote: > > 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 focus

Re: why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?

2025-01-23 Thread Andrew Dunstan
On 2025-01-23 Th 3:18 AM, Srinath Reddy wrote: Hi, in pg_restore archive format option is parsed using only the first character of the value but in pg_dump the archive format option's value is compared with whole string using pg_strcasecmp is there any specific reason? `git blame` tel

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

2025-01-23 Thread Tom Lane
Tomas Vondra writes: > So it seems to me having a predefined role that allows managing all > roles (including orphaned ones) might be the good alternative. I > initially wrote "cleaner", but it feels a bit wrong to allow orphaned > roles and then have to "fix" this by having this predefined role.

Re: "postmaster became multithreaded" is reachable

2025-01-23 Thread Noah Misch
On Thu, Jan 23, 2025 at 01:51:32PM -0500, Tom Lane wrote: > Noah Misch writes: > > On Thu, Jan 23, 2025 at 01:22:13PM -0500, Tom Lane wrote: > >> An alternative idea (that maybe should also be done in PostmasterMain) > >> is to report the HINT only #ifdef __darwin__ and on other platforms > >> use

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

2025-01-23 Thread Tomas Vondra
On 1/22/25 12:07, Ashutosh Sharma wrote: > 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

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

2025-01-23 Thread Robin Dupret
Le mer. 22 janv. 2025 à 16:34, Tom Lane a écrit : > > "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 wri

Re: Add CASEFOLD() function.

2025-01-23 Thread Jeff Davis
On Fri, 2025-01-17 at 16:34 -0800, Jeff Davis wrote: > v5 attached. v6 attached. I plan to commit this soon. A couple things to note: * The ICU API for lower/title/uppercasing is slightly different from folding. The former accept a locale, while the latter just has an option which is relevant on

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

2025-01-23 Thread Robert Haas
On Thu, Jan 23, 2025 at 1:31 PM Robert Haas wrote: > > On Wed, Jan 22, 2025 at 5:48 PM Melanie Plageman > wrote: > > Thanks! Attached v9 incorporates all your suggested changes. > > I'm not exactly sure what to do about it, but I feel like the > documentation of vacuum_eager_scan_max_fails is goi

Re: Skip collecting decoded changes of already-aborted transactions

2025-01-23 Thread Masahiko Sawada
On Wed, Jan 22, 2025 at 7:35 PM Peter Smith wrote: > > On Thu, Jan 23, 2025 at 2:17 PM Amit Kapila wrote: > > > > On Wed, Jan 22, 2025 at 9:21 AM Peter Smith wrote: > > > > > > > > > == > > > Commit message > > > > > > typo /RBTXN_IS_PREAPRE/RBTXN_IS_PREPARE/ > > > Will fix. > > > > > > Al

Re: "postmaster became multithreaded" is reachable

2025-01-23 Thread Tom Lane
Noah Misch writes: > On Thu, Jan 23, 2025 at 01:22:13PM -0500, Tom Lane wrote: >> An alternative idea (that maybe should also be done in PostmasterMain) >> is to report the HINT only #ifdef __darwin__ and on other platforms >> use the "Please report a bug" text. > I gather pthread_is_threaded_np(

Re: "postmaster became multithreaded" is reachable

2025-01-23 Thread Noah Misch
On Thu, Jan 23, 2025 at 01:22:13PM -0500, Tom Lane wrote: > ExitPostmaster() says: > > /* > * There is no known cause for a postmaster to become multithreaded after > * startup. Recheck to account for the possibility of unknown causes. > * This message uses LOG level, because a

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

2025-01-23 Thread Robert Haas
On Wed, Jan 22, 2025 at 5:48 PM Melanie Plageman wrote: > Thanks! Attached v9 incorporates all your suggested changes. I'm not exactly sure what to do about it, but I feel like the documentation of vacuum_eager_scan_max_fails is going to be incomprehensible to someone who doesn't already have a d

"postmaster became multithreaded" is reachable

2025-01-23 Thread Tom Lane
ExitPostmaster() says: /* * There is no known cause for a postmaster to become multithreaded after * startup. Recheck to account for the possibility of unknown causes. * This message uses LOG level, because an unclean shutdown at this point * would usually not look much di

Re: Wrong security context for deferred triggers?

2025-01-23 Thread Laurenz Albe
On Thu, 2025-01-23 at 12:30 -0500, Tom Lane wrote: > Pushed with some cosmetic adjustments Thank you! Yours, Laurenz Albe

Re: Pre-allocating WAL files

2025-01-23 Thread Nathan Bossart
On Wed, Jan 22, 2025 at 01:00:08PM -0500, Andres Freund wrote: > On 2025-01-22 11:43:20 -0600, Nathan Bossart wrote: >> What is the purpose of syncing the file before the rename? > > It's from the general durable_rename() code. The reason it's there that it's > required for "atomically replace a f

Re: Wrong security context for deferred triggers?

2025-01-23 Thread Tom Lane
Laurenz Albe writes: > Version 5 of the patch is attached. Pushed with some cosmetic adjustments, such as tweaking comments. One perhaps less than cosmetic adjustment is that I removed the test case involving dropping the role. I didn't think it was buying much now that we removed the code that

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

2025-01-23 Thread Dean Rasheed
On Thu, 23 Jan 2025 at 14:30, Aleksander Alekseev wrote: > > Hi Peter, > > > These casts appear to use a particular endianness, but they don't > > document which one, and there is no explanation anywhere why that one is > > the right one. > > Right, I choose network order / big-endian. I agree tha

Re: SQL:2011 application time

2025-01-23 Thread Peter Eisentraut
On 21.01.25 19:52, Peter Eisentraut wrote: On 12.01.25 00:19, Paul Jungwirth wrote: On 1/4/25 13:39, Paul Jungwirth wrote: These updates fix a problem in the unaccent contrib module. When I added a new parameter to get_func_namespace, I changed a call there. Then I when took out that parameter

Re: SQL:2011 application time

2025-01-23 Thread Peter Eisentraut
On 22.01.25 05:00, Tom Lane wrote: Peter Eisentraut writes: I have committed the fix for foreign key NO ACTION (patch 0002, this did not require patch 0001). That commit seems to be causing occasional buildfarm failures: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=indri&dt=2025-0

Re: XMLDocument (SQL/XML X030)

2025-01-23 Thread Pavel Stehule
Hi čt 23. 1. 2025 v 16:06 odesílatel Jim Jones napsal: > Hi > > On 23.01.25 07:50, Pavel Stehule wrote: > > I think so in this form (just forward input to output) I have no > > objection. > > > > There is a benefit with a) possible zero work with migration from db2, > > b) nobody needs to repeat

Re: Compression of bigger WAL records

2025-01-23 Thread Japin Li
On Tue, 21 Jan 2025 at 23:24, "Andrey M. Borodin" wrote: >> On 12 Jan 2025, at 17:43, Andrey M. Borodin wrote: >> >> I attach a prototype patch. > > Here's v2, now it passes all the tests with wal_debug. > > Some stats. On this test > > create table a as select random() from generate_series(1,1e

Re: XMLDocument (SQL/XML X030)

2025-01-23 Thread Jim Jones
Hi On 23.01.25 07:50, Pavel Stehule wrote: > I think so in this form (just forward input to output) I have no > objection.  > > There is a benefit with a) possible zero work with migration from db2, > b) nobody needs to repeat a work which is a correct implementation of > XMLDOCUMENT function. > >

Re: Allow NOT VALID foreign key constraints on partitioned tables.

2025-01-23 Thread Álvaro Herrera
On 2025-Jan-22, Amul Sul wrote: > You’re correct; it’s fixed in the attached version, along with an > assert(!convalidated) in QueueFKConstraintValidation(), and I’ve > included tests to cover the change. Thanks for reviewing this patch. OK thanks, looks good, I have pushed it now with some trivi

Improve verification of recovery_target_timeline GUC.

2025-01-23 Thread David Steele
Hackers, Currently check_recovery_target_timeline() converts any value that is not current, latest, or a valid integer to 0. So for example: recovery_target_timeline = 'currrent' results in the following error: FATAL: 22023: recovery target timeline 0 does not exist Since there is no range

Re: Extended Statistics set/restore/clear functions.

2025-01-23 Thread Corey Huinker
On Wed, Jan 22, 2025 at 5:50 PM Tomas Vondra wrote: > 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

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

2025-01-23 Thread Aleksander Alekseev
Hi Peter, > These casts appear to use a particular endianness, but they don't > document which one, and there is no explanation anywhere why that one is > the right one. Right, I choose network order / big-endian. I agree that it would make sense to emphasise this fact in the documentation below

Re: doc: explain pgstatindex fragmentation

2025-01-23 Thread Laurenz Albe
On Tue, 2024-11-05 at 18:36 +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? I am all for explaining this better. Here is my take. I tried to avoid "bloat"

Re: Increase NUM_XLOGINSERT_LOCKS

2025-01-23 Thread Japin Li
On Thu, 23 Jan 2025 at 15:50, Yura Sokolov wrote: > 23.01.2025 08:41, wenhui qiu wrote: >> HI Japin >>      Thank you for you test ,It seems NUM_XLOGINSERT_LOCKS 64 >> is great , I think it doesn't need to grow much,What do you think? > > I agree: while 128 shows small benefit, it is not as big a

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

2025-01-23 Thread Japin Li
On Thu, 23 Jan 2025 at 15:03, Yura Sokolov wrote: > 23.01.2025 11:46, Japin Li пишет: >> On Wed, 22 Jan 2025 at 22:44, Japin Li wrote: >>> 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

Re: Modern SHA2- based password hashes for pgcrypto

2025-01-23 Thread Japin Li
On Mon, 20 Jan 2025 at 18:41, Bernd Helmle wrote: > Hi, > > Please find attached a reworked patch according Alvaro's comments. > > Am Montag, dem 13.01.2025 um 17:06 +0100 schrieb Alvaro Herrera: >> Hello >> >> I was passing by and I noticed that this needs badly pgindent, and >> some >> comment

Re: Log a warning in pg_createsubscriber for max_slot_wal_keep_size

2025-01-23 Thread Shubham Khanna
On Thu, Jan 23, 2025 at 12:30 PM Peter Smith wrote: > > Hi Shubham. > > The v12-0001 works OK, but your added TAP tests of this patch do not > conform to the new style of the fat-comma parameter passing since the > recent commit [1], so you'll need to fix them so they do... > > == > src/bin/pg

Re: New process of getting changes into the commitfest app

2025-01-23 Thread Jelte Fennema-Nio
On Thu, 23 Jan 2025 at 01:25, Jacob Brazeal wrote: >> >> Magnus wants reviews before deployment to be required, in an effort to >> get as close-to-perfect commits as possible. I, on the other hand, >> think that the benefit of close-to-perfect commits is not worth the >> delays in deploying that

RE: Pgoutput not capturing the generated columns

2025-01-23 Thread Shinoda, Noriyoshi (SXD Japan FSI)
Hi, hackers. Thanks for developing this great feature. The documentation for the pg_publication catalog shows a 'pubgencols' column, but the actual column name is the 'pubgencols_type' column. Also, the order of the columns in the documentation differs from the order of the columns in the actual

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

2025-01-23 Thread Sergey Tatarintsev
23.01.2025 15:24, Zhijie Hou (Fujitsu) пишет: On Thursday, January 23, 2025 4:43 PM Shlok Kyal wrote: On Thu, 23 Jan 2025 at 12:35, Shlok Kyal wrote: On Wed, 22 Jan 2025 at 09:00, Zhijie Hou (Fujitsu) wrote: Thanks for the patch. I agree that covering the partitioned table case when che

New process of getting changes into the commitfest app

2025-01-23 Thread Jelte Fennema-Nio
(Resent because sending to both -hackers and -www gets emails put in the moderation queue, and I don't want to introduce that delay to all replies. If you received the previous version because you're in the CC please only reply to this one) # Background As some of you might have noticed I've been

Re: Increase NUM_XLOGINSERT_LOCKS

2025-01-23 Thread Yura Sokolov
23.01.2025 08:41, wenhui qiu wrote: HI Japin      Thank you for you test ,It seems NUM_XLOGINSERT_LOCKS 64 is great , I think it doesn't need to grow much,What do you think? I agree: while 128 shows small benefit, it is not as big at the moment. Given there's other waiting issues (may) arise

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread Daniel Gustafsson
> On 23 Jan 2025, at 13:19, vignesh C wrote: > When dumping from Postgres <=PG17 servers, the query generated for > pubgencols_type incorrectly included the macro name instead of the > macro value. This resulted in dump failures. This commit fixes the > issue by correctly specifying the macro val

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

2025-01-23 Thread Zhijie Hou (Fujitsu)
On Thursday, January 23, 2025 4:43 PM Shlok Kyal wrote: > > On Thu, 23 Jan 2025 at 12:35, Shlok Kyal wrote: > > > > On Wed, 22 Jan 2025 at 09:00, Zhijie Hou (Fujitsu) > > wrote: > > > > > > Thanks for the patch. > > > > > > I agree that covering the partitioned table case when checking the > >

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread vignesh C
On Thu, 23 Jan 2025 at 17:03, Amit Kapila wrote: > > On Thu, Jan 23, 2025 at 11:18 AM Peter Smith wrote: > > > > Patch v56-0001 LGTM. > > > > I have pushed this patch with minor modifications (especially I didn't > took Peter Smith's last suggestion to convert some functions to return > enum inst

Re: pgsql: Doc: Update the interaction of tablesync with wal_retrieve_retry

2025-01-23 Thread Amit Kapila
On Thu, Jan 23, 2025 at 4:56 PM Erik Rijkers wrote: > > On 1/22/25 06:34, Amit Kapila wrote: > > Doc: Update the interaction of tablesync with wal_retrieve_retry_interval. > > Branch > > -- > > master > > > > Details > > --- > > https://git.postgresql.org/pg/commitdiff/4a0e7314f11ee03adfe9

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

2025-01-23 Thread Yura Sokolov
23.01.2025 11:46, Japin Li пишет: On Wed, 22 Jan 2025 at 22:44, Japin Li wrote: 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 t

Re: Virtual generated columns

2025-01-23 Thread Shlok Kyal
On Tue, 14 Jan 2025 at 19:08, Peter Eisentraut wrote: > > On 13.01.25 19:15, Dean Rasheed wrote: > > On Wed, 8 Jan 2025 at 16:14, Peter Eisentraut wrote: > >> > >> Here is a new patch version > > > > In expand_generated_columns_in_expr(): > > > > + RangeTblEntry *rte; > > + > > + rte

Re: Convert macros to static inline functions

2025-01-23 Thread Peter Eisentraut
On 27.12.24 11:16, Peter Eisentraut wrote: On 16.05.22 10:27, Peter Eisentraut wrote: Inspired by [0], I looked to convert more macros to inline functions. This is an older thread where I left something unfinished: Note 2: Many macros in htup_details.h operate both on HeapTupleHeader and on

Re: Pgoutput not capturing the generated columns

2025-01-23 Thread Amit Kapila
On Thu, Jan 23, 2025 at 11:18 AM Peter Smith wrote: > > Patch v56-0001 LGTM. > I have pushed this patch with minor modifications (especially I didn't took Peter Smith's last suggestion to convert some functions to return enum instead of char as the proposed one was consistent with subscription si

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

2025-01-23 Thread Ashutosh Bapat
On Wed, Jan 22, 2025 at 7:29 PM Shubham Khanna wrote: > > 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

Re: pgsql: Doc: Update the interaction of tablesync with wal_retrieve_retry

2025-01-23 Thread Erik Rijkers
On 1/22/25 06:34, Amit Kapila wrote: Doc: Update the interaction of tablesync with wal_retrieve_retry_interval. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/4a0e7314f11ee03adfe9df945598c068b4179314 Hi, In this sentence : "The initial data in existing subscrib

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

2025-01-23 Thread Ashutosh Bapat
On Thu, Jan 23, 2025 at 6:16 AM Masahiko Sawada wrote: > > 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, > > > > > > >

Re: Non-text mode for pg_dumpall

2025-01-23 Thread Mahendra Singh Thalor
On Thu, 23 Jan 2025 at 14:59, jian he wrote: > > hi. > The four patches attached are to solve the > TODO1: We need to think for --exclude-database=PATTERN for pg_restore. > it is based on your > v11_pg_dumpall-with-directory-tar-custom-format-21-jan.patch > > > 0001. pg_dumpall --exclude-database

Re: Wrong security context for deferred triggers?

2025-01-23 Thread Laurenz Albe
On Wed, 2025-01-22 at 13:25 -0500, Tom Lane wrote: > 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 ea

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2025-01-23 Thread Yugo NAGATA
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 makes the test a bit > > simpler.

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

2025-01-23 Thread Benoit Lobréau
On 1/23/25 4:18 AM, David G. Johnston wrote: Aside from the name choice this is what I propose, so can you elaborate on what doesn't feel right?  You cannot have both "Standalone Physical Backup" and "File System Level Backup" co-exist so maybe that was it - not realizing that your "new" sectio

Re: per backend WAL statistics

2025-01-23 Thread Bertrand Drouvot
Hi, On Thu, Jan 23, 2025 at 05:05:30PM +0900, Michael Paquier wrote: > On Tue, Jan 21, 2025 at 07:19:55AM +, Bertrand Drouvot wrote: > > PFA v6 that now relies on the new PendingBackendStats variable introduced in > > 4feba03d8b9. > > > > Remark: I moved PendingBackendStats back to pgstat.h b

Re: Non-text mode for pg_dumpall

2025-01-23 Thread jian he
hi. The four patches attached are to solve the TODO1: We need to think for --exclude-database=PATTERN for pg_restore. it is based on your v11_pg_dumpall-with-directory-tar-custom-format-21-jan.patch 0001. pg_dumpall --exclude-database=PATTERN already works, main function resolve pattern matching

Re: Make COPY format extendable: Extract COPY TO format implementations

2025-01-23 Thread Sutou Kouhei
Hi, I noticed that the last patch set (v27) can't be applied to the current master. I've rebased on the current master and created v28 patch set. No code change. Thanks, -- kou >From 016ccfc63d2faa441a6996e3dcfd3cdbff7c185f Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 28 Sep 2024 23:

Re: Make COPY format extendable: Extract COPY TO format implementations

2025-01-23 Thread Sutou Kouhei
Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Fri, 29 Nov 2024 10:15:04 +0800, Junwang Zhao wrote: > This thread and [1] thread are kind of interleaved, I chose this thread > to share the numbers because I think this feature should be committed > first

Re: doc: explain pgstatindex fragmentation

2025-01-23 Thread Frédéric Yhuel
On 1/22/25 12:34, Bertrand Drouvot wrote: 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 h

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

2025-01-23 Thread Japin Li
On Wed, 22 Jan 2025 at 22:44, Japin Li wrote: > 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_

Re: Sample rate added to pg_stat_statements

2025-01-23 Thread Ilia Evdokimov
On 23.01.2025 08:21, Andrey Borodin wrote: There’s a typo in the commit message (ratio instead of rate). Besides this the patch looks ready for committer. Best regards, Andrey Borodin. Fixed. Thank you for review! I noticed that the code has not enough comments, so I added additional o

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

2025-01-23 Thread Shlok Kyal
On Thu, 23 Jan 2025 at 12:35, Shlok Kyal wrote: > > 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:3

why -Fdance archive format option works with ./pg_restore but not with ./pg_dump?

2025-01-23 Thread Srinath Reddy
Hi, in pg_restore archive format option is parsed using only the first character of the value but in pg_dump the archive format option's value is compared with whole string using pg_strcasecmp is there any specific reason? Regards, Srinath Reddy Sadipiralla EnterpriseDB: http://www.enterprisedb.c

Re: per backend WAL statistics

2025-01-23 Thread Michael Paquier
On Tue, Jan 21, 2025 at 07:19:55AM +, Bertrand Drouvot wrote: > PFA v6 that now relies on the new PendingBackendStats variable introduced in > 4feba03d8b9. > > Remark: I moved PendingBackendStats back to pgstat.h because I think that the > "simple" pending stats increment that we are adding in

  1   2   >