Re: Replace IN VALUES with ANY in WHERE clauses during optimization

2025-04-04 Thread Peter Geoghegan
On Fri, Apr 4, 2025 at 11:19 AM Alena Rybakina wrote: > I fixed it - changed the tables and didn't use system tables. Is somebody going to commit this soon? Alexander? -- Peter Geoghegan

Re: Use XLOG_CONTROL_FILE macro everywhere?

2025-04-04 Thread Fujii Masao
On 2025/03/28 13:09, Anton A. Melnikov wrote: Hi! * Patch needs rebase by CFbot Rebased the patches onto the current master and marked them as v4. I'm not sure there's clear consensus yet on the changes in the 0001 and 0002 patches, and it might not be worth rushing them in right before t

Re: BTScanOpaqueData size slows down tests

2025-04-04 Thread Peter Geoghegan
On Wed, Apr 2, 2025 at 11:57 AM Andres Freund wrote: > I'd assume it's extremely rare for there to be this many items on a page. I'd > guess that something like storing having BTScanPosData->items point to an > in-line 4-16 BTScanPosItem items_inline[N] and dynamically allocate a > full-length BTS

Re: autoprewarm_dump_now

2025-04-04 Thread Heikki Linnakangas
On 04/04/2025 16:40, Дарья Шанина wrote: Hello everyone! I have a question. What would be better for the function autoprewarm_dump_now in case when we need to allocate memory that exceeds 1 GB: Hmm, so if I counted right, sizeof(BlockInfoRecord) == 20 bytes, which means that you can fit abou

Re: pgsql: Add support for OAUTHBEARER SASL mechanism

2025-04-04 Thread Daniel Gustafsson
> 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 doesn't work.) After the split, configure/meson should fail if the

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

2025-04-04 Thread Tom Lane
David Rowley writes: > I've attached the updated set of patches. This patchset has a distinct whiff of unseemly haste. 1. The commit message for 0002 still claims that child EC members are kept in RelOptInfos, precisely the point I objected to upthread. I see that in fact that's untrue, but it'd

Re: Exponential notation bug

2025-04-04 Thread Maciek Sakrejda
I took a look at simplifying this test case, and I think it comes down to data types: maciek=# select 9/10; ?column? -- 0 (1 row) maciek=# select pg_typeof(10); pg_typeof --- integer (1 row) But: maciek=# select 9/1e1; ?column? 0.9000

Re: Exponential notation bug

2025-04-04 Thread Robert Haas
On Fri, Apr 4, 2025 at 11:55 AM Marcos Pegoraro wrote: > I was deleting thousands of records each time with \gexec, then ... > > This one works > select format('delete from table where ID = any(%L::integer[]);', > array_agg(ID)), (ord-1)/1 from ( > select * from generate_series(15e2,65e5) wit

Re: Exponential notation bug

2025-04-04 Thread Tom Lane
Robert Haas writes: > This seems like a question for -general or some other user-focused > mailing list, not hackers. At any rate, I don't see how 1e4 could just > be "ignored", but as Maciek points out, 1e4 and 1 are of different > data types, which seems likely to be relevant somehow. I am

Re: autoprewarm_dump_now

2025-04-04 Thread Melanie Plageman
On Fri, Apr 4, 2025 at 10:04 AM Heikki Linnakangas wrote: > > In apw_load_buffers(), we also load the file into (DSM) memory. There's > no similar 1 GB limit in dsm_create(), but I think it's a bit > unfortunate that the array needs to be allocated upfront upon loading. Unrelated to this problem,

Re: New criteria for autovacuum

2025-04-04 Thread Robert Haas
On Fri, Apr 4, 2025 at 12:11 PM Melanie Plageman wrote: > That being said, long-running transactions are a problem for > autovacuum in general. Even if you track this stat you are proposing > about heap fetches by index only scans, you won't know if the long > running transaction is over and thus

Re: autoprewarm_dump_now

2025-04-04 Thread Robert Haas
On Fri, Apr 4, 2025 at 12:17 PM Melanie Plageman wrote: > Unrelated to this problem, but I wondered why autoprewarm doesn''t > launch background workers for each database simultaneously instead of > waiting for each one to finish a db before moving onto the next one. > Is it simply to limit the nu

Re: Restrict copying of invalidated replication slots

2025-04-04 Thread Masahiko Sawada
On Wed, Apr 2, 2025 at 2:58 PM Masahiko Sawada wrote: > > On Tue, Mar 18, 2025 at 2:28 AM Shlok Kyal wrote: > > > > On Mon, 17 Mar 2025 at 22:57, Masahiko Sawada wrote: > > > > > > On Sun, Mar 9, 2025 at 11:16 PM Shlok Kyal > > > wrote: > > > > > > > > On Fri, 28 Feb 2025 at 08:56, Amit Kapila

Re: why there is not VACUUM FULL CONCURRENTLY?

2025-04-04 Thread Antonin Houska
Euler Taveira wrote: > I started reviewing this patch. It was in my radar to review it but I didn't > have spare time until now. Thanks! > + > + REPACK > + cluster a table according to an index > + > > This description is not accurate because the index is optional. It means if > the > ind

Re: Update LDAP Protocol in fe-connect.c to v3

2025-04-04 Thread Andrew Jackson
Here is the same patch as v2 but with "const" removed in case you want to move forward with that change. Tested locally against the tests I wrote in the other patch to sanity check the change. On Thu, Apr 3, 2025 at 8:42 AM Tom Lane wrote: > Peter Eisentraut writes: > > Here is a slightly polis

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

2025-04-04 Thread Dimitrios Apostolou
I just managed to run pgindent, here is v2 with the comment style fixed.From 74258e15a3ecca5abe981aa64dfff434c4b27969 Mon Sep 17 00:00:00 2001 From: Dimitrios Apostolou Date: Sat, 29 Mar 2025 01:16:07 +0100 Subject: [PATCH v2 1/2] parallel pg_restore: avoid disk seeks when jumping short distance

Re: Large expressions in indexes can't be stored (non-TOASTable)

2025-04-04 Thread Nathan Bossart
On Fri, Apr 04, 2025 at 05:16:43PM +0530, Amit Kapila wrote: > Can we dodge adding this push call if we restrict the length of the > origin name to some reasonable limit like 256 or 512 and avoid the > need of toast altogether? We did consider just removing pg_replication_origin's TOAST table earl

Re: Draft for basic NUMA observability

2025-04-04 Thread Jakub Wartak
On Fri, Apr 4, 2025 at 4:36 PM Tomas Vondra wrote: Hi Tomas, > Do you have any suggestions regarding the column names in the new view? > I'm not sure I like node_id and page_num. They actually look good to me. We've discussed earlier dropping s/numa_//g for column names (after all views contain

[PATCH] parallel pg_restore: move offset-building phase to before forking

2025-04-04 Thread Dimitrios Apostolou
Hello list, based on the delays I experienced in pg_restore, as described at: https://www.postgresql.org/message-id/flat/6bd16bdb-aa5e-0512-739d-b84100596...@gmx.net I noticed that the seeking-reading behaviour was manifested by every one of the pg_restore worker processes, in parallel, making

Re: rename pg_log_standby_snapshot

2025-04-04 Thread Sami Imseih
> > > Should the pg_log_ prefix strictly refer to functions that write to > > > logs? > > > > > > > I don't know how strict we should be about this, > > I don't know as well and specially given that: > > - the snapshot is logged to the log file (if log level <= DEBUG2) But unlike pg_log_backend_me

Re: Exponential notation bug

2025-04-04 Thread Marcos Pegoraro
Em sex., 4 de abr. de 2025 às 13:13, Maciek Sakrejda escreveu: > maciek=# select pg_typeof(1e1) Correct, this explains that regards Marcos

Prevent internal error at concurrent CREATE OR REPLACE FUNCTION

2025-04-04 Thread Yugo Nagata
Hi, I found that multiple sessions concurrently execute CREATE OR REPLACE FUNCTION for a same function, the error "tuple concurrently updated" is raised. This is an internal error output by elog, also the message is not user-friendly. I've attached a patch to prevent this internal error by lockin

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

2025-04-04 Thread David Rowley
On Sat, 29 Mar 2025 at 05:46, Ashutosh Bapat wrote: > PFA patches. 0001 and 0002 are the same as the previous set. 0003 > changes the initial hash table size to the length of ec_derives. I'm just not following the logic in making it the length of the ec_derives List. If you have 32 buckets and tr

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

2025-04-04 Thread Alena Rybakina
On 03.04.2025 02:32, Peter Geoghegan wrote: On Tue, Apr 1, 2025 at 3:08 PM Alena Rybakina wrote: I think it would be useful to show information that we used an index scan but at the same time we skipped the "region" column and I assume we should output how many distinct values the "region" co

Re: pg_recvlogical cannot create slots with failover=true

2025-04-04 Thread Masahiko Sawada
On Thu, Apr 3, 2025 at 8:28 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Sawada-san, > > > Thank you for updating the patch. Here are some minor comments: > > > > The --two-phase can be specified with > > --create-slot to enable decoding of prepared > > transactions. > > +A

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

2025-04-04 Thread Ashutosh Bapat
Hi David, On Fri, Apr 4, 2025 at 11:34 AM David Rowley wrote: > > I also did some benchmarking using the attached script. I've attached > the results of running that on my AMD Zen2 machine. See the end of the > script for the CREATE TABLE statement for loading that into postgres. > > The results

Re: why there is not VACUUM FULL CONCURRENTLY?

2025-04-04 Thread Matheus Alcantara
Hi, On Tue, Apr 1, 2025 at 10:31 AM Antonin Houska wrote: > One more version, hopefully to make cfbot happy (I missed the bug because I > did not set the RELCACHE_FORCE_RELEASE macro in my environment.) Thanks for the new version! I'm starting to study this patch series and I just want to share

Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup

2025-04-04 Thread Heikki Linnakangas
On 18/03/2025 01:08, Jelte Fennema-Nio wrote: On Mon Feb 24, 2025 at 12:01 PM CET, Jelte Fennema-Nio wrote: Right after pressing send I realized I could remove two more useless lines... Rebased patchset attached (trivial conflict against pg_noreturn changes). v7-0001-Adds-a-helper-for-places

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2025-04-04 Thread Fujii Masao
On 2025/04/04 23:47, Nathan Bossart wrote: On Fri, Apr 04, 2025 at 07:18:11PM +0900, Fujii Masao wrote: I've pushed the patch. Thanks! Just a heads up, I fixed a pgindent issue in this commit (see commits e1a8b1ad58 and 742317a80f). I'd ordinarily just report it, but since we're nearing fe

Re: Parallel heap vacuum

2025-04-04 Thread Melanie Plageman
On Tue, Apr 1, 2025 at 5:30 PM Masahiko Sawada wrote: > > > I've attached the new version patch. There are no major changes; I > fixed some typos, improved the comment, and removed duplicated codes. > Also, I've updated the commit messages. I haven't looked closely at this version but I did notic

Re: why there is not VACUUM FULL CONCURRENTLY?

2025-04-04 Thread Euler Taveira
On Fri, Apr 4, 2025, at 1:38 PM, Antonin Houska wrote: > Euler Taveira wrote: > > > + > > + > > + > > + The FULL parameter is deprecated in favor of > > + . > > + > > + > > + > > > > The warnings, notes, and tips are usually placed *after* the description. > >

Re: vacuum_truncate configuration parameter and isset_offset

2025-04-04 Thread Nathan Bossart
On Mon, Mar 24, 2025 at 10:12:05PM +0300, Nikolay Shaplov wrote: > And second general idea: changing engine is bad, at least when you can manage > without changing it. You have asserted this a couple of times without providing any reasons why. I know of no general project policy about changing th

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

2025-04-04 Thread Alvaro Herrera
On 2025-Apr-03, Andres Freund wrote: > I've increased the timeout even further, but I can't say that I am happy about > the slowest test getting even slower. Adding test time in the serially slowest > test is way worse than adding the same time in a concurrent test. Yeah. We discussed strategies

Re: Allow default \watch interval in psql to be configured

2025-04-04 Thread Pavel Stehule
st 26. 3. 2025 v 13:24 odesílatel Daniel Gustafsson napsal: > > On 26 Mar 2025, at 10:12, Pavel Stehule wrote: > > > yes, it is ok after this change > > Thanks for confirming, committed. > Thank you Pavel > > -- > Daniel Gustafsson > >

Re: 002_pg_upgrade is broken for custom install

2025-04-04 Thread Álvaro Herrera
On 2025-Apr-04, Ashutosh Bapat wrote: > # test failed > stderr: > # Tests were run but no plan was declared and done_testing() was not seen. > # Looks like your test exited with 29 just after 4. > > Doesn't look like it's expected. Nope. Please have a look at the tmp_check/log/regress_002* log

Re: Sample rate added to pg_stat_statements

2025-04-04 Thread Ilia Evdokimov
Hi, I attached rebased patch v20. -- Best regards, Ilia Evdokimov, Tantor Labs LLC. From accee46b077e1debdc3db61555923b2c11e18d5e Mon Sep 17 00:00:00 2001 From: Ilia Evdokimov Date: Fri, 21 Mar 2025 17:37:08 +0300 Subject: [PATCH v20] Allow setting sample rate for pg_stat_statements New config

Re: Optimize truncation logic to reduce AccessExclusive lock impact

2025-04-04 Thread Yura Sokolov
19.03.2025 05:09, David Rowley wrote: > On Tue, 18 Mar 2025 at 19:04, Stepan Neretin wrote: >> We propose modifying the truncation condition in should_attempt_truncation >> to avoid unnecessary full buffer scans. The new formula ensures we only >> attempt truncation when we can free at least 3%

Re: making EXPLAIN extensible

2025-04-04 Thread Sami Imseih
> On Tue, Mar 18, 2025 at 11:21 PM Sami Imseih wrote: > > > > Do you want to propose a patch? > > > > > > yes, will attach a patch shortly. > > > > Attached is a patch to add a hook to allow extensions > > to add additional option validations. The hook takes > > in the ExplainState as an argument

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

2025-04-04 Thread Andrew Dunstan
On 2025-03-29 Sa 10:40 AM, David G. Johnston wrote: On Saturday, March 29, 2025, Kirill Reshke wrote: On Sat, 29 Mar 2025 at 09:47, jian he wrote: > > will use {table_beginscan, table_scan_getnextslot, table_endscan} > to output the data. > but views don't have storage

Re: Proposal: Progressive explain

2025-04-04 Thread Robert Haas
On Fri, Mar 28, 2025 at 12:09 PM Rafael Thofehrn Castro wrote: > I am definitely not the authority here to talk about the best way forward. > If there is an agreement in turning this into an extension, it can be a new > feature in auto_explain. I'm not against adding some more hooks to explain.c,

Re: index prefetching

2025-04-04 Thread Tomas Vondra
On 4/2/25 18:05, Andres Freund wrote: > Hi, > > Since the patch has needed a rebase since mid February and is in Waiting on > Author since mid March, I think it'd be appropriate to mark this as Returned > with Feedback for now? Or at least moved to the next CF? > Yes, I agree. regards -- To

Re: [PATCH] Automatic client certificate selection support for libpq v1

2025-04-04 Thread Jacob Champion
On Mon, Mar 31, 2025 at 9:01 AM Seth Robertson wrote: > Third, the only real use case where this feature would be critical is > a client which needs to have connections to two different PostgreSQL > servers at the same time. Those applications are likely fairly rare > and doing custom programming

Re: Statistics Import and Export

2025-04-04 Thread Nathan Bossart
On Tue, Apr 01, 2025 at 10:44:19PM -0700, Jeff Davis wrote: > On Tue, 2025-04-01 at 22:21 -0500, Nathan Bossart wrote: >> We might be able to improve this by inventing a new callback that fails for >> all formats except for custom with feesko() available.  That would at least >> ensure hard failure

Re: Disabling vacuum truncate for autovacuum

2025-04-04 Thread Nathan Bossart
On Thu, Mar 20, 2025 at 02:18:33PM -0700, David G. Johnston wrote: > So my concern about dump/restore seems to be alleviated but then, why can > we not just do whatever pg_dump is doing to decide whether the current > value for vacuum_truncate is its default (and thus would not be dumped) or > not

Re: Using read stream in autoprewarm

2025-04-04 Thread Melanie Plageman
On Mon, Mar 31, 2025 at 3:27 PM Melanie Plageman wrote: > > I think there might be another problem with the code. We only set > cur_database in the loop in autoprewarm_databas_main() when it is 0 > > if (cur_database != blk->database) > { > if (cur_database == 0) >

Re: SQLFunctionCache and generic plans

2025-04-04 Thread Alexander Lakhin
Hello Tom, 03.04.2025 22:13, Tom Lane wrpte: Drat. I thought I'd tested the empty-function-body case, but evidently that was a few changes too far back. Will fix, thanks for catching it. I've stumbled upon another defect introduced with 0dca5d68d: CREATE FUNCTION f(VARIADIC ANYARRAY) RETURNS

Re: A small correction to doc and comment of FSM for indexes

2025-04-04 Thread Michael Paquier
On Tue, Feb 25, 2025 at 07:24:14PM +0200, Alex Friedman wrote: > However, as what is tracked is entirely-unused pages, the values > mean whether a page is "in-use or empty", rather than "full or > empty". Ah, right, you are obviously right here. Applied and backpatched doen to 13 as the docs of p

Re: System views for versions reporting

2025-04-04 Thread Tom Lane
Dmitry Dolgov <9erthali...@gmail.com> writes: > Thanks for checking this out. Here is the updated version with applied > changes. The tests were failing due to injection_points library > apparently linking something twice, triggering a duplication error I > didn't expect. Since apparently it can ha

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

2025-04-04 Thread Peter Geoghegan
On Tue, Apr 1, 2025 at 4:16 PM Matthias van de Meent wrote: > While I agree that there is such a cost, I don't think that this is > too far fetched. They are not just added when we have SAOP scankeys, > and I think the non-SAOP case is one of the most important areas where > this patch improves pe

Re: Draft for basic NUMA observability

2025-04-04 Thread Jakub Wartak
On Wed, Apr 2, 2025 at 6:40 PM Tomas Vondra wrote: Hi Tomas, > OK, so you agree the commit messages are complete / correct? Yes. > OK. FWIW if you disagree with some of my proposed changes, feel free to > push back. I'm sure some may be more a matter of personal preference. No, it's all fine.

Re: Fix 035_standby_logical_decoding.pl race conditions

2025-04-04 Thread Bertrand Drouvot
Hi, On Wed, Apr 02, 2025 at 03:04:07PM +0530, Amit Kapila wrote: > I have changed it based on your suggestions and made a few other > changes in the comments. Please see attached. Thanks! > * > +  if (IS_INJECTION_POINT_ATTACHED("log-running-xacts")) > > It is better to name the injection point

Re: Update Unicode data to Unicode 16.0.0

2025-04-04 Thread Robert Haas
On Tue, Mar 18, 2025 at 10:33 PM Jeff Davis wrote: > If we compare the following two problems: > > A. With glibc or ICU, every text index, including primary keys, are > highly vulnerable to inconsistencies after an OS upgrade, even if > there's no Postgres upgrade; vs. > > B. With the builtin

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

2025-04-04 Thread Ilia Evdokimov
On 02.04.2025 00:06, David Rowley wrote: I tried to move things along to address Tom's concern about not wanting to show this in EXPLAIN's standard output. I suggested in [1] that we could use EXPLAIN ANALYZE, but nobody commented on that. EXPLAIN ANALYZE is much more verbose than EXPLAIN alread

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

2025-04-04 Thread David G. Johnston
On Friday, March 28, 2025, Masahiko Sawada wrote: > > > One problem in the following chunk I can see is: > > + qualified_format = stringToQualifiedNameList(format, NULL); > + DeconstructQualifiedName(qualified_format, &schema, &fmt); > + if (!schema || strcmp(schema,

Re: support virtual generated column not null constraint

2025-04-04 Thread Xuneng Zhou
Hi, response from ChatGPT, seems correct: "Consing up" is an informal term derived from Lisp terminology. In this context, it means dynamically creating (allocating and constructing) a new NullTest node. Instead of reusing an existing node, the code allocates a fresh node—using PostgreSQL’s memor

Re: AIO v2.5

2025-04-04 Thread Andres Freund
Hi, Sorry for the slow work on this. The cycle times are humonguous due to valgrind being so slow... On 2025-04-03 12:40:23 -0700, Noah Misch wrote: > On Thu, Apr 03, 2025 at 02:19:43PM -0400, Andres Freund wrote: > > The best fix for that one would, I think, be to have method_io_uring() > > it

Re: Question -- why is there no errhint_internal function?

2025-04-04 Thread Andres Freund
Hi, On 2025-04-03 09:58:30 +1100, Peter Smith wrote: > I saw that a new errhint_internal() function was recently committed > [1]. I had also posted above asking about this same missing function a > month ago [2]. > > But, your patch only added the new function -- it does not make any > use of it

RE: AIX support

2025-04-04 Thread Srirama Kucherlapati
Hi Heikki and team, Thank you for considering our request. As discussed, we have revised the patch to incorporate all the review comments provided. Please find the attached patch, which focuses solely on the gmake changes. As discussed the meson specific changes would be provided as different pat

Re: Update LDAP Protocol in fe-connect.c to v3

2025-04-04 Thread Andrew Jackson
Hi, Added some tests for the LDAP connection parameters lookup functionality with the attached patch. It is based off of the tests that were added recently that cover the connection service file libpq functionality as well as the existing ldap test framework. Thanks, Andrew Jackson On Wed, Mar 2

RE: Some codes refer slot()->{'slot_name'} but it is not defined

2025-04-04 Thread Hayato Kuroda (Fujitsu)
Dear Fujii-san, > -is($node_primary->slot('dropme_slot')->{'slot_name'}, > - undef, 'logical slot was actually dropped on standby'); > +is($node_primary->slot('dropme_slot')->{'plugin'}, > + '', 'logical slot was actually dropped on standby'); > > This seems like a separate issue from wha

Re: INSERT ... ON CONFLICT DO SELECT [FOR ...] take 2

2025-04-04 Thread Dean Rasheed
> > On 3/4/25 10:24 AM, Andreas Karlsson wrote: > > Rebased the patch to add support for OLD.* and NEW.*. > I took a closer look at this, and I have a number of comments: * The changes for RLS look correct. However, in get_row_security_policies(), it's not necessary to add WCO_RLS_UPDATE_CHECK ch

Re: SQL:2011 application time

2025-04-04 Thread Paul Jungwirth
On 3/3/25 02:05, Peter Eisentraut wrote: > In the theory of the SQL standard, executing referential actions and checking the foreign-key > constraint are two separate steps. So it kind of goes like this: > > 1. run command > 2. run any referential actions > 3. check that foreign key is still sat

Re: Memoize ANTI and SEMI JOIN inner

2025-04-04 Thread Andrei Lepikhov
On 3/31/25 11:03, Richard Guo wrote: On Thu, Mar 20, 2025 at 3:02 PM David Rowley wrote: For making this work, I think the attached should be about the guts of the code changes. I didn't look at the comments. Right now I can't think of any reason why this can't be done, but some experimentation

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

2025-04-04 Thread vignesh C
On Wed, 2 Apr 2025 at 13:49, Ashutosh Bapat wrote: > > On Tue, Apr 1, 2025 at 10:31 PM Alvaro Herrera > wrote: > > > > 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

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

2025-04-04 Thread Robert Haas
On Tue, Apr 1, 2025 at 10:14 PM Richard Guo wrote: > The attnotnull catalog information being discussed here is intended > for use during constant folding (and possibly sublink pull-up), which > occurs long before partition pruning. Am I missing something? Hmm, OK, so you think that we need to g

Re: Vacuuming the free space map considered harmful?

2025-04-04 Thread Christophe Pettus
> On Mar 19, 2025, at 15:06, Christophe Pettus wrote: > > From an (admittedly somewhat naïve) look at the code, it appears that having > it honor the cost delay wouldn't introduce excessive blocking, as long as the > delay wasn't implemented at a really dumb place. Specifically, it looks li

Re: md.c vs elog.c vs smgrreleaseall() in barrier

2025-04-04 Thread Thomas Munro
On Thu, Mar 20, 2025 at 12:06 PM Andres Freund wrote: > Ah - it effectively is already in a critical section, just a weirdly spelled > one: > > 2025-03-19 19:00:06.398 EDT [2156613][client backend][0/3:0][psql] LOG: > statement: DROP TABLE foo; > 2025-03-19 19:00:06.404 EDT [2156613][client bac

Re: pg_recvlogical cannot create slots with failover=true

2025-04-04 Thread Michael Banck
Hi, On Tue, Apr 01, 2025 at 08:01:32AM +, Hayato Kuroda (Fujitsu) wrote: > Attached patch implements it. Since -f/-F option has already been used, -O was > chosen for the short-version. Better idea is very welcomed. Maybe we don't need a short option at all for this, at least initially? Mic

Re: Index AM API cleanup

2025-04-04 Thread Peter Eisentraut
On 12.03.25 17:08, Mark Dilger wrote: On Wed, Mar 12, 2025 at 7:25 AM Tom Lane > wrote: Peter Eisentraut mailto:pe...@eisentraut.org>> writes: > 0002: Add get_opfamily_member_for_cmptype().  This was called > get_opmethod_member() in your patch set, bu

Re: Statistics Import and Export

2025-04-04 Thread Nathan Bossart
On Thu, Apr 03, 2025 at 09:19:51PM -0500, Nathan Bossart wrote: > Great. I'm planning to commit the attached patch set tomorrow morning. Committed. -- nathan

Re: Memoize ANTI and SEMI JOIN inner

2025-04-04 Thread Alena Rybakina
I realized that I uploaded my diff file with a small mistake - sorry about that. I've corrected it with this message so your tests can pass in the CI. On 31.03.2025 05:33, Alena Rybakina wrote: Hi! On 21.03.2025 18:56, Andrei Lepikhov wrote: On 20/3/2025 07:02, David Rowley wrote: On Thu, 2

Re: New criteria for autovacuum

2025-04-04 Thread Melanie Plageman
On Fri, Apr 4, 2025 at 3:27 PM Konstantin Knizhnik wrote: > > From logical point of view I agree with you: taken in account number of > inserted tuples makes sense if it allows to mark page as all-visible. > So `ins_since_vacuum` should be better renamed to > `ins_all_visible_since_vacuum` and c

Re: Using read stream in autoprewarm

2025-04-04 Thread Melanie Plageman
On Fri, Apr 4, 2025 at 4:17 AM Nazir Bilal Yavuz wrote: > > Same on my end, v14 LGTM. Cool. Pushed and marked as such in the CF app. - Melanie

Re: New criteria for autovacuum

2025-04-04 Thread Sami Imseih
> From logical point of view I agree with you: taken in account number of > inserted tuples makes sense if it allows to mark page as all-visible. > So `ins_since_vacuum` should be better renamed to > `ins_all_visible_since_vacuum` and count only all-visible tuples. > If newly inserted tuple is no

Re: Non-text mode for pg_dumpall

2025-04-04 Thread Andrew Dunstan
On 2025-04-04 Fr 5:12 AM, Mahendra Singh Thalor wrote: On Fri, 4 Apr 2025 at 13:52, Mahendra Singh Thalor wrote: On Fri, 4 Apr 2025 at 01:17, Andrew Dunstan wrote: On 2025-04-01 Tu 1:59 AM, Mahendra Singh Thalor wrote: On Mon, 31 Mar 2025 at 23:43, Álvaro Herrera wrote: Hi FWIW I don't thi

Re: Statistics Import and Export

2025-04-04 Thread Nathan Bossart
On Fri, Apr 04, 2025 at 02:56:54PM -0500, Nathan Bossart wrote: > Committed. I see the buildfarm failure and am working on a fix. -- nathan

Re: Disabling vacuum truncate for autovacuum

2025-04-04 Thread David G. Johnston
On Thu, Mar 20, 2025 at 8:18 AM Nathan Bossart wrote: > Committed. > > We added isset_offset to the public struct to introduce this new general behavior of tracking whether any table reloption has been set (not just vacuum_truncate) without any comments. I get the need for this kind of logic, si

Re: Conflict detection for multiple_unique_conflicts in logical replication

2025-04-04 Thread Nisha Moond
On Fri, Mar 21, 2025 at 3:38 PM Amit Kapila wrote: > > On Fri, Mar 21, 2025 at 1:48 PM Zhijie Hou (Fujitsu) > wrote: > > > > On Fri, Mar 21, 2025 at 12:50 PM Nisha Moond wrote: > > > > > Thanks, Hou-san, for the review and fix patches. I’ve incorporated > > > your suggestions. > > > Attached are

Re: pgsql: Add support for OAUTHBEARER SASL mechanism

2025-04-04 Thread Christoph Berg
> Add support for OAUTHBEARER SASL mechanism Debian still has this experimental port with a GNU userland and a FreeBSD kernel called kfreebsd. I don't expect anyone to particularly care about it, but it found an actual bug: /build/reproducible-path/postgresql-18-18~~devel.20250331/build/../src/in

Re: Statistics Import and Export

2025-04-04 Thread Nathan Bossart
On Fri, Apr 04, 2025 at 03:06:45PM -0500, Nathan Bossart wrote: > I see the buildfarm failure and am working on a fix. I pushed commit 8ec0aae to fix this. -- nathan

Re: Periodic FSM vacuum doesn't happen in one-pass strategy vacuum.

2025-04-04 Thread Masahiko Sawada
On Mon, Mar 31, 2025 at 3:29 PM Masahiko Sawada wrote: > > On Mon, Mar 31, 2025 at 3:12 PM Melanie Plageman > wrote: > > > > On Mon, Mar 31, 2025 at 6:03 PM Masahiko Sawada > > wrote: > > > > > > With commit c120550edb86, If we got the cleanup lock on the page, > > > lazy_scan_prune() marks dea

Re: vacuum_truncate configuration parameter and isset_offset

2025-04-04 Thread Nathan Bossart
On Mon, Mar 24, 2025 at 11:27:15PM +0300, Nikolay Shaplov wrote: > В письме от понедельник, 24 марта 2025 г. 23:04:39 MSK пользователь Nathan > Bossart написал: >> But again, I don't see any strong reason why we must change all such >> reloptions. > > Because code of the engine should be consiste

Re: Improve CRC32C performance on SSE4.2

2025-04-04 Thread Nathan Bossart
On Wed, Apr 02, 2025 at 02:10:40PM +0700, John Naylor wrote: > Thanks for looking, I plan to commit this over the weekend unless > there are objections. I noticed that autoconf is defining USE_AVX512_CRC_WITH_RUNTIME_CHECK, but everywhere else expects USE_AVX512_CRC32C_WITH_RUNTIME_CHECK (with the

Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote

2025-04-04 Thread Mahendra Singh Thalor
On Thu, 27 Mar 2025 at 16:16, Andrew Dunstan wrote: > > > On 2025-03-26 We 8:52 AM, Srinath Reddy wrote: > > sorry for the noise ,previous response had my editor's formatting,just > resending without that formatting. > > ./psql postgres > > Hi, > > On Wed, Mar 26, 2025 at 5:55 PM Andrew Dunstan

Re: dblink: Add SCRAM pass-through authentication

2025-04-04 Thread Matheus Alcantara
On Wed, Mar 19, 2025 at 4:21 PM Jacob Champion wrote: > > On Tue, Mar 18, 2025 at 12:32 PM Peter Eisentraut > wrote: > > Yeah, I think option (2) is enough for now. If someone wants to enable > > the kinds of things you describe, they can always come back and > > implement option (1) later. > >

Re: Proposal: Limitations of palloc inside checkpointer

2025-04-04 Thread Heikki Linnakangas
On 12/03/2025 13:00, Maxim Orlov wrote: On Wed, 12 Mar 2025 at 10:27, Xuneng Zhou > wrote: The patch itself looks ok to me. I'm curious about the trade-offs between this incremental approach and the alternative of using palloc_extended() with the MCXT_ALLOC_HUGE fla

Re: In-placre persistance change of a relation

2025-04-04 Thread Thom Brown
On Fri, 27 Dec 2024 at 08:26, Kyotaro Horiguchi wrote: > > Hello. This is the updated version. > > (Sorry for the delay; I've been a little swamped.) > > - Undo logs are primarily stored in a fixed number of fixed-length > slots and are spilled into files under some conditions. > > The number

Re: [PATCH] Add CANONICAL option to xmlserialize

2025-04-04 Thread Jim Jones
While reviewing another patch, I noticed that the keep_comments argument was missing a default value. To allow calling the function with only the XML argument, I've added DEFAULT true to keep_comments. SELECT xmlcanonicalize(xmldoc); Updated patch (v16) attached. Best, JimFrom 28f7c62de548468c8f

Re: SQLFunctionCache and generic plans

2025-04-04 Thread Alexander Lakhin
05.04.2025 00:47, Tom Lane wrote: Alexander Lakhin writes: I've stumbled upon another defect introduced with 0dca5d68d: CREATE FUNCTION f(VARIADIC ANYARRAY) RETURNS ANYELEMENT AS $$ SELECT x FROM generate_series(1,1) g(i) $$ LANGUAGE SQL IMMUTABLE; SELECT f(1); SELECT f(1); Hmm, I see regress

Proposal for enabling auto-vectorization for checksum calculations

2025-04-04 Thread Matthew Sterrett
Hello, This patch enables more compiler autovectorization for the checksum calculations. This code is particularly well suited for autovectorization, so just adding pg_attribute_target and some simple dynamic dispatch logic we can get improved vectorization. This gives about a 2x speedup in a synth

Re: Allow default \watch interval in psql to be configured

2025-04-04 Thread Daniel Gustafsson
> On 17 Mar 2025, at 13:37, Ashutosh Bapat wrote: > 0 is an accepted value for interval, even though it might look insensible. > > The behaviour should be same in both cases \watch i= and > \set WATCH_INTERVAL \watch. In this case it's not. Having a watch interval of zero is IMHO somewhat nons

Re: AIX support

2025-04-04 Thread Heikki Linnakangas
On 04/04/2025 22:31, Srirama Kucherlapati wrote: > - src/backend/port/aix/mkldexport.sh>   - When building shared libraries from various archives on AIX, we encounter a situation where symbols are not exported. To resolve this, we require an export file. For instance, the command is

Re: md.c vs elog.c vs smgrreleaseall() in barrier

2025-04-04 Thread Noah Misch
On Thu, Mar 20, 2025 at 03:53:11PM -0400, Andres Freund wrote: > I updated the patch with the following changes: > > - Remove the assertion from smgrtruncate() - it would need to assert that it's > called in a critical section. > > Not sure why it's not already asserting that? > > The func

Re: Parallel heap vacuum

2025-04-04 Thread Masahiko Sawada
On Fri, Apr 4, 2025 at 11:05 AM Melanie Plageman wrote: > > On Tue, Apr 1, 2025 at 5:30 PM Masahiko Sawada wrote: > > > > > > I've attached the new version patch. There are no major changes; I > > fixed some typos, improved the comment, and removed duplicated codes. > > Also, I've updated the com

Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row

2025-04-04 Thread Masahiko Sawada
On Fri, Apr 4, 2025 at 4:55 AM jian he wrote: > > On Tue, Mar 25, 2025 at 2:31 PM vignesh C wrote: > > > > 2) Here in error we say column c1 violates not-null constraint and in > > the context we show column c2, should the context also display c2 > > column: > > postgres=# create table t3(c1 int

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

2025-04-04 Thread Masahiko Sawada
On Sat, Mar 29, 2025 at 9:49 AM David G. Johnston wrote: > > On Wed, Mar 26, 2025 at 8:28 PM Sutou Kouhei wrote: >> >> >> The attached v39 patch set uses the followings: >> >> 0001: Create copyto_internal.h and change COPY_XXX to >> COPY_SOURCE_XXX and COPY_DEST_XXX accordingly. >> (S

Re: Why doesn't GiST VACUUM require a super-exclusive lock, like nbtree VACUUM?

2025-04-04 Thread Matthias van de Meent
On Sun, 16 Mar 2025 at 13:58, vignesh C wrote: > > On Sat, 8 Mar 2025 at 08:06, Matthias van de Meent > wrote: > > > > Here's a patchset that uses that approach. Naming of functions, types, > > fields and arguments TBD. The patch works and passes the new > > VACUUM-conflict tests, though I suspec

Re: SQLFunctionCache and generic plans

2025-04-04 Thread Tom Lane
Alexander Lakhin writes: > I've stumbled upon another defect introduced with 0dca5d68d: > CREATE FUNCTION f(VARIADIC ANYARRAY) RETURNS ANYELEMENT AS $$ SELECT x FROM > generate_series(1,1) g(i) $$ LANGUAGE SQL > IMMUTABLE; > SELECT f(1); > SELECT f(1); Hmm, I see regression=# CREATE FUNCTION f

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-04 Thread Thomas Munro
On Thu, Mar 20, 2025 at 2:38 AM Daniel Gustafsson wrote: > > On 19 Mar 2025, at 05:57, Tom Lane wrote: > > > > BTW, I was pretty seriously disheartened just now to realize that > > this feature was implemented by making libpq depend on libcurl. > > I'd misread the relevant commit messages to say

Fundamental scheduling bug in parallel restore of partitioned tables

2025-04-04 Thread Tom Lane
Looking into the complaint at [1], I find that pg_restore really gets it quite wrong when trying to do a parallel restore of partitioned tables with foreign key constraints. The historical way that we got parallel restore to work correctly with FK constraints is: 1. The dump file shows dependenci

<    1   2   3   >