Re: Fix for pageinspect bug in PG 17

2024-11-11 Thread Michael Paquier
On Mon, Nov 11, 2024 at 07:32:10PM +0100, Tomas Vondra wrote: > This adds an out argument to brin_page_items, but I failed to consider > the user may still run with an older version of the extension - either > after pg_upgrade (as in the report), or when the CREATE EXTENSION > command specifies VER

RE: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY

2024-11-11 Thread Zhijie Hou (Fujitsu)
On Friday, November 8, 2024 7:06 PM Shlok Kyal wrote: > > Hi Amit, > > On Thu, 7 Nov 2024 at 11:37, Amit Kapila wrote: > > > > On Tue, Nov 5, 2024 at 12:53 PM Shlok Kyal > wrote: > > > > > > To avoid the issue, we can disallow UPDATE/DELETE on table with > > > unpublished generated column as R

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-11 Thread Ashutosh Bapat
On Tue, Nov 12, 2024 at 12:02 PM Masahiko Sawada wrote: > > On Mon, Nov 11, 2024 at 2:08 PM Tomas Vondra wrote: > > > > > > But neither of those fixes prevents backwards move for confirmed_flush > > LSN, as enforced by asserts in the 0005 patch. I don't know if this > > assert is incorrect or now

Re: define pg_structiszero(addr, s, r)

2024-11-11 Thread Michael Paquier
On Tue, Nov 12, 2024 at 06:09:04AM +, Bertrand Drouvot wrote: > I think that the 64b len check done in v11 is mandatory for safety reasons. > > The loop above reads 64 bytes at once, so would read beyond the memory area > bounds > if len < 64: That could cause crash or read invalid data. Sor

Missing word in comment

2024-11-11 Thread Amit Langote
Hi, Will push the attached shortly, which does: * An SMgrRelation may be "pinned", to prevent it from being destroyed while - * it's in use. We use this to prevent pointers relcache to smgr from being + * it's in use. We use this to prevent pointers in relcache to smgr from being * invalida

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-11 Thread Masahiko Sawada
On Mon, Nov 11, 2024 at 2:08 PM Tomas Vondra wrote: > > > But neither of those fixes prevents backwards move for confirmed_flush > LSN, as enforced by asserts in the 0005 patch. I don't know if this > assert is incorrect or now. It seems natural that once we get a > confirmation for some LSN, we c

Re: Add reject_limit option to file_fdw

2024-11-11 Thread Kirill Reshke
On Tue, 12 Nov 2024 at 06:17, torikoshia wrote: > > On 2024-11-12 01:49, Fujii Masao wrote: > > On 2024/11/11 21:45, torikoshia wrote: > >>> Thanks for adding the comment. It clearly states that REJECT_LIMIT > >>> can be > >>> a single-quoted string. However, it might also be helpful to mention >

Re: define pg_structiszero(addr, s, r)

2024-11-11 Thread Bertrand Drouvot
Hi, On Tue, Nov 12, 2024 at 12:28:53PM +0900, Michael Paquier wrote: > On Mon, Nov 11, 2024 at 05:07:51PM +, Bertrand Drouvot wrote: > > To handle the "what about the len check if the function is not inlined?", I > > can't think about a good approach. > > FWIW, my choice would be to not over-

Re: Add reject_limit option to file_fdw

2024-11-11 Thread Yugo Nagata
On Tue, 12 Nov 2024 10:16:50 +0900 torikoshia wrote: > On 2024-11-12 01:49, Fujii Masao wrote: > > On 2024/11/11 21:45, torikoshia wrote: > >>> Thanks for adding the comment. It clearly states that REJECT_LIMIT > >>> can be > >>> a single-quoted string. However, it might also be helpful to menti

Re: Disallow UPDATE/DELETE on table with unpublished generated column as REPLICA IDENTITY

2024-11-11 Thread Amit Kapila
On Sat, Nov 9, 2024 at 8:46 AM Amit Kapila wrote: > > On Fri, Nov 8, 2024 at 5:17 PM Alvaro Herrera wrote: > > > > On 2024-Nov-07, Amit Kapila wrote: > > > > > BTW, I was thinking as to how to fix it on back branches and it seems > > > we should restrict to define REPLICA IDENTITY on stored gener

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

2024-11-11 Thread Yugo Nagata
On Tue, 12 Nov 2024 01:27:53 +0500 Kirill Reshke wrote: > On Mon, 11 Nov 2024 at 16:11, torikoshia wrote: > > > > On 2024-11-09 21:55, Kirill Reshke wrote: > > > > Thanks for working on this! > > Thanks for reviewing the v7 patch series! > > > > On Thu, 7 Nov 2024 at 23:00, Fujii Masao > > >

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

2024-11-11 Thread Yugo Nagata
On Tue, 12 Nov 2024 14:03:50 +0900 Yugo Nagata wrote: > On Tue, 12 Nov 2024 01:27:53 +0500 > Kirill Reshke wrote: > > > On Mon, 11 Nov 2024 at 16:11, torikoshia wrote: > > > > > > On 2024-11-09 21:55, Kirill Reshke wrote: > > > > > > Thanks for working on this! > > > > Thanks for reviewing th

Re: 2024-11-14 release announcement draft

2024-11-11 Thread Thomas Munro
On Tue, Nov 12, 2024 at 5:28 PM Jonathan S. Katz wrote: > Please review the draft of the release announcement for the 2024-11-14 > release. Please provide any feedback by 2024-11-14 12:00 UTC. I think "* Fixes random crashes in JIT compilation on aarch64 systems" might be worth highlighting. We'

2024-11-14 release announcement draft

2024-11-11 Thread Jonathan S. Katz
Hi, Please review the draft of the release announcement for the 2024-11-14 release. Please provide any feedback by 2024-11-14 12:00 UTC. Thanks! Jonathan The PostgreSQL Global Development Group has released an update to all supported versions of PostgreSQL, including 17.1, 16.5, 15.9, 14.14,

Re: Commit Timestamp and LSN Inversion issue

2024-11-11 Thread Amit Kapila
On Mon, Nov 11, 2024 at 9:05 PM Tomas Vondra wrote: > > Alternatively, we could simply stop relying on the timestamps recorded > in the commit, and instead derive "monotonic" commit timestamps after > the fact. For example, we could track timestamps for some subset of > commits, and then approxima

Re: Commit Timestamp and LSN Inversion issue

2024-11-11 Thread Amit Kapila
On Tue, Nov 12, 2024 at 8:35 AM Amit Kapila wrote: > > On Mon, Nov 11, 2024 at 9:05 PM Tomas Vondra wrote: > > > > On 11/11/24 09:19, Amit Kapila wrote: > > > > > > I can't think of a solution other than the current proposal where we > > > do both the operations (reserve WAL space for commit and

Re: Add parallel columns for seq scan and index scan on pg_stat_all_tables and _indexes

2024-11-11 Thread Michael Paquier
On Mon, Nov 11, 2024 at 11:06:43AM -0500, Robert Haas wrote: > But it is unclear to me what sort of tuning we would do based on > knowing how many of the scans on a certain table or a certain index > were parallel vs non-parallel. I have not fully reviewed the threads > linked in the original post;

Re: Remove a unnecessary backslash in CopyFrom

2024-11-11 Thread Fujii Masao
On 2024/11/12 11:58, Tender Wang wrote: Yugo Nagata mailto:nag...@sraoss.co.jp>> 于2024年11月12日周二 10:46写道: Hi, I found a unnecessary backslash in CopyFrom().             if (cstate->opts.reject_limit > 0 && \                 cstate->num_errors > cstate->opts.reject_limit)

Re: define pg_structiszero(addr, s, r)

2024-11-11 Thread Michael Paquier
On Mon, Nov 11, 2024 at 05:07:51PM +, Bertrand Drouvot wrote: > To handle the "what about the len check if the function is not inlined?", I > can't think about a good approach. FWIW, my choice would be to not over-engineer things more than what's in v10 posted at [1], hence do something withou

Re: Commit Timestamp and LSN Inversion issue

2024-11-11 Thread Amit Kapila
On Mon, Nov 11, 2024 at 9:05 PM Tomas Vondra wrote: > > On 11/11/24 09:19, Amit Kapila wrote: > > > > I can't think of a solution other than the current proposal where we > > do both the operations (reserve WAL space for commit and adjust > > commit_timestamp, if required) together to resolve LSN<

Re: Remove a unnecessary backslash in CopyFrom

2024-11-11 Thread Tender Wang
Yugo Nagata 于2024年11月12日周二 10:46写道: > Hi, > > I found a unnecessary backslash in CopyFrom(). > > if (cstate->opts.reject_limit > 0 && \ > cstate->num_errors > cstate->opts.reject_limit) > > It can be removed because this is not in a macro. > I've attached a patch. > Y

Remove a unnecessary backslash in CopyFrom

2024-11-11 Thread Yugo Nagata
Hi, I found a unnecessary backslash in CopyFrom(). if (cstate->opts.reject_limit > 0 && \ cstate->num_errors > cstate->opts.reject_limit) It can be removed because this is not in a macro. I've attached a patch. Regards, Yugo Nagata -- Yugo Nagata diff --git a/src/

Re: Skip collecting decoded changes of already-aborted transactions

2024-11-11 Thread Peter Smith
On Tue, Nov 12, 2024 at 5:00 AM Masahiko Sawada wrote: > > I've attached the updated patch. > Hi, here are some review comments for the latest v6-0001. == contrib/test_decoding/sql/stats.sql 1. +INSERT INTO stats_test SELECT 'serialize-topbig--1:'||g.i FROM generate_series(1, 5000) g(i); I

Re: intarray sort returns wrong result

2024-11-11 Thread Junwang Zhao
On Tue, Nov 12, 2024 at 9:13 AM Tom Lane wrote: > > Junwang Zhao writes: > > While working on general array sort[1], I played with intarray > > extension, found a bug (or at least inconsistency) when sorting > > multidimensional int array: > > > create extension intarray; > > select sort('{{1,2,3

Optimizing FastPathTransferRelationLocks()

2024-11-11 Thread Fujii Masao
Hi, I've identified some opportunities to optimize FastPathTransferRelationLocks(), which transfers locks with a specific lock tag from per-backend fast-path arrays to the shared hash table. The attached patch includes these enhancements. Currently, FastPathTransferRelationLocks() recalculates t

Re: Add reject_limit option to file_fdw

2024-11-11 Thread torikoshia
On 2024-11-12 01:49, Fujii Masao wrote: On 2024/11/11 21:45, torikoshia wrote: Thanks for adding the comment. It clearly states that REJECT_LIMIT can be a single-quoted string. However, it might also be helpful to mention that it can be provided as an int64 in the COPY command option. How abou

Re: intarray sort returns wrong result

2024-11-11 Thread Tom Lane
Junwang Zhao writes: > While working on general array sort[1], I played with intarray > extension, found a bug (or at least inconsistency) when sorting > multidimensional int array: > create extension intarray; > select sort('{{1,2,3}, {2,3,4}}'); > this returns {{1,2,2},{3,3,4}} instead of {{1,

intarray sort returns wrong result

2024-11-11 Thread Junwang Zhao
Hi Hackers, While working on general array sort[1], I played with intarray extension, found a bug (or at least inconsistency) when sorting multidimensional int array: create extension intarray; select sort('{{1,2,3}, {2,3,4}}'); this returns {{1,2,2},{3,3,4}} instead of {{1,2,3},{2,3,4}} I thin

Re: explain plans for foreign servers

2024-11-11 Thread Andy Fan
dinesh salve writes: Hi, > > I am working on a feature in postgres_fdw extension to show plans used > by remote postgresql servers in the output of the EXPLAIN command. > > I think this will help end users understand query execution plans used > by remote servers. Sample output for table people

Re: Eager aggregation, take 3

2024-11-11 Thread Richard Guo
On Tue, Nov 12, 2024 at 1:30 AM Robert Haas wrote: > On Sun, Nov 10, 2024 at 7:52 PM Richard Guo wrote: > > Hmm, currently we only consider grouped aggregation for eager > > aggregation. For grouped aggregation, the window function's > > arguments, as well as the PARTITION BY expressions, must a

Re: POC: make mxidoff 64 bits

2024-11-11 Thread Heikki Linnakangas
On 08/11/2024 20:10, Maxim Orlov wrote: Sorry for a late reply. There was a problem in upgrade with offset wraparound. Here is a fixed version. Test also added. I decide to use my old patch to set a non-standard multixacts for the old cluster, fill it with data and do pg_upgrade. The wraparou

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-11 Thread Tomas Vondra
On 11/11/24 23:41, Masahiko Sawada wrote: > On Mon, Nov 11, 2024 at 6:17 AM Tomas Vondra wrote: >> >> If this analysis is correct, I think it's rather suspicious we don't >> reset the candidate fields on restart. Can those "old" values ever be >> valid? But I haven't tried resetting them. > >

Re: [PATCH] pg_stat_activity: make slow/hanging authentication more visible

2024-11-11 Thread Jacob Champion
On Fri, Nov 8, 2024 at 4:23 PM Jacob Champion wrote: > While I work on breaking pgstat_bestart() apart, here is a v6 which > pushes down the "coarse" wait events. No changes to 0001 yet. v7 rewrites 0001 by splitting pgstat_bestart() into three phases. (0002-3 are unchanged.) 1. pgstat_bestart_i

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-11 Thread Masahiko Sawada
On Mon, Nov 11, 2024 at 6:17 AM Tomas Vondra wrote: > > If this analysis is correct, I think it's rather suspicious we don't > reset the candidate fields on restart. Can those "old" values ever be > valid? But I haven't tried resetting them. I had the same question. IIRC resetting them also fixe

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-11 Thread Tomas Vondra
On 11/11/24 21:56, Masahiko Sawada wrote: > ... >> >>> My hypothesis is that we wanted to prevent such >>> case by the first if block: >>> >>> /* don't overwrite if have a newer restart lsn */ >>> if (restart_lsn <= slot->data.restart_lsn) >>> { >>> } >>> >> >> Yeah, that condition

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-11 Thread Tomas Vondra
On 11/11/24 15:17, Tomas Vondra wrote: > On 11/11/24 14:51, Ashutosh Bapat wrote: >> ... >> >> I think the problem is about processing older running transactions >> record and setting data.restart_lsn based on the candidates those >> records produce. But what is not clear to me is how come a newe

Re: Using Expanded Objects other than Arrays from plpgsql

2024-11-11 Thread Michel Pelletier
> > The second expansion in matrix_out happens outside the function, so inside > there is only the one expansion for both matrix_nvals and the assignment. > Thank you! All my tests continue to pass and the change seems to work well. Hmm, well I spoke to soon looking at the wrong function without

Re: Using Expanded Objects other than Arrays from plpgsql

2024-11-11 Thread Michel Pelletier
On Fri, Nov 1, 2024 at 5:53 PM Michel Pelletier wrote: > On Fri, Nov 1, 2024 at 3:27 PM Tom Lane wrote: > >> Michel Pelletier writes: >> >> Here is a v1 patch series that does the first part of what we've been >> talking about, which is to implement the new optimization rule for >> the case of

Re: Separate memory contexts for relcache and catcache

2024-11-11 Thread Jeff Davis
On Mon, 2024-11-11 at 17:05 +0530, Ashutosh Bapat wrote: > It will be good > to move ahead with the ones we all agree for now. Looking at all the > emails, those will be CatCacheContext, > RelCacheContext, PlanCacheContext, TypCacheContext. I'm not sure we have consensus on all of those yet. Andre

Re: Proposals for EXPLAIN: rename ANALYZE to EXECUTE and extend VERBOSE

2024-11-11 Thread Guillaume Lelarge
Hi, Le mer. 6 nov. 2024 à 17:57, Michael Christofides a écrit : > [...] > I agree. In the past 6 versions, 5 new parameters have been added. > SETTINGS in v12, WAL in v13, GENERIC_PLAN in v16, SERIALIZE in > v17, and MEMORY in v17. It feels like we should have some easier way > to get everything

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-11 Thread Masahiko Sawada
On Sat, Nov 9, 2024 at 3:45 AM Tomas Vondra wrote: > > > > On 11/8/24 19:25, Masahiko Sawada wrote: > > Hi, > > > > Thank you for investigating this issue. > > > > On Thu, Nov 7, 2024 at 10:40 AM Tomas Vondra wrote: > >> > >> Hi, > >> > >> I kept investigating this, but I haven't made much progre

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

2024-11-11 Thread Kirill Reshke
On Mon, 11 Nov 2024 at 16:11, torikoshia wrote: > > On 2024-11-09 21:55, Kirill Reshke wrote: > > Thanks for working on this! Thanks for reviewing the v7 patch series! > > On Thu, 7 Nov 2024 at 23:00, Fujii Masao > > wrote: > >> > >> > >> > >> On 2024/10/26 6:03, Kirill Reshke wrote: > >> > whe

Re: UUID v7

2024-11-11 Thread Masahiko Sawada
On Sat, Nov 9, 2024 at 9:07 AM Sergey Prokhorenko wrote: > > On Saturday 9 November 2024 at 01:00:15 am GMT+3, Masahiko Sawada > wrote: > > > the microsecond part is working also as a counter in a sense. IT seems fine > > to me but I'm slightly concerned that there is no guidance of such > > i

Re: index prefetching

2024-11-11 Thread Peter Geoghegan
On Mon, Nov 11, 2024 at 2:00 PM Peter Geoghegan wrote: > The real sign that what I said is generally true of index AMs is that > you'll see so few calls to > LockBufferForCleanup/ConditionalLockBufferForCleanup. Only hash calls > ConditionalLockBufferForCleanup at all (which I find a bit weird). >

Re: Update Unicode data to Unicode 16.0.0

2024-11-11 Thread Joe Conway
On 11/11/24 01:27, Peter Eisentraut wrote: Here is the patch to update the Unicode data to version 16.0.0. Normally, this would have been routine, but a few months ago there was some debate about how this should be handled. [0] AFAICT, the consensus was to go ahead with it, but I just wanted to

Re: [PoC] XMLCast (SQL/XML X025)

2024-11-11 Thread Jim Jones
Hi Robert Thanks for taking a look at it. On 11.11.24 19:15, Robert Haas wrote: > Hmm, this patch has gotten no responses for 4 months. That's kind of > unfortunate. Sadly, there's not a whole lot that I can do to better > the situation, because I know very little either about XML-related > standa

Re: Offsets of `struct Port` are no longer constant

2024-11-11 Thread Daniel Gustafsson
> On 11 Nov 2024, at 20:17, Jacob Champion > wrote: > > On Mon, Nov 11, 2024 at 11:13 AM Heikki Linnakangas wrote: >> On REL_17_STABLE, we should probably adjust the comment to warn that >> 'raw_buf' and friends can move depending on USE_OPENSSL. > > Yeah, makes sense. +1

Re: Offsets of `struct Port` are no longer constant

2024-11-11 Thread Jacob Champion
On Mon, Nov 11, 2024 at 11:13 AM Heikki Linnakangas wrote: > On REL_17_STABLE, we should probably adjust the comment to warn that > 'raw_buf' and friends can move depending on USE_OPENSSL. Yeah, makes sense. --Jacob

Re: Offsets of `struct Port` are no longer constant

2024-11-11 Thread Heikki Linnakangas
On 11/11/2024 18:34, Jacob Champion wrote: Hi all, A comment at the end of the Port struct says /* * OpenSSL structures. (Keep these last so that the locations of other * fields are the same whether or not you build with SSL enabled.) */ but as part of th

Re: index prefetching

2024-11-11 Thread Peter Geoghegan
On Mon, Nov 11, 2024 at 1:33 PM Robert Haas wrote: > That makes sense from the point of view of working with the btree code > itself, but from a system-wide perspective, it's weird to pretend like > the pins don't exist or don't matter just because a buffer lock is > also held. I can see how that

Re: index prefetching

2024-11-11 Thread Robert Haas
On Mon, Nov 11, 2024 at 1:03 PM Peter Geoghegan wrote: > I almost think of "pin held" and "buffer lock held" as synonymous when > working on the nbtree code, even though you have this one obscure page > deletion case where that isn't quite true (plus the TID recycle safety > business imposed by he

Fix for pageinspect bug in PG 17

2024-11-11 Thread Tomas Vondra
Hi, Here's a fix for pageinspect bug in PG17, reported in [1]. The bug turns out to be introduced by my commit commit dae761a87edae444d11a411f711f1d679bed5941 Author: Tomas Vondra Date: Fri Dec 8 17:07:30 2023 +0100 Add empty BRIN ranges during CREATE INDEX ... This adds an out argu

Re: RFC: Additional Directory for Extensions

2024-11-11 Thread David E. Wheeler
On Nov 11, 2024, at 02:16, Peter Eisentraut wrote: > I implemented a patch along the lines Craig had suggested. Oh, nice, thank you. > It's a new GUC variable that is a path for extension control files. It's > called extension_control_path, and it works exactly the same way as > dynamic_libr

Re: [PoC] XMLCast (SQL/XML X025)

2024-11-11 Thread Robert Haas
On Sun, Nov 10, 2024 at 1:14 PM Jim Jones wrote: > rebase. Hmm, this patch has gotten no responses for 4 months. That's kind of unfortunate. Sadly, there's not a whole lot that I can do to better the situation, because I know very little either about XML-related standards or about how people make

Re: Parallel heap vacuum

2024-11-11 Thread Masahiko Sawada
On Mon, Nov 11, 2024 at 5:08 AM Hayato Kuroda (Fujitsu) wrote: > > Dear Sawda-san, > > > > > I've attached new version patches that fixes failures reported by > > cfbot. I hope these changes make cfbot happy. > > Thanks for updating the patch and sorry for delaying the reply. I confirmed > cfbot

Re: [PATCH] Add sortsupport for range types and btree_gist

2024-11-11 Thread Andrey M. Borodin
> On 11 Nov 2024, at 21:41, Bernd Helmle wrote: > > Updated and rebased patches attached. Hi Bernd! Some nitpicking: 0. postgres % git apply ~/Downloads/v7.3-Add-GIST-sortsupport-* /Users/x4mmm/Downloads/v7.3-Add-GIST-sortsupport-btree-gist.patch:19: space before tab in indent. oid oid_

Re: index prefetching

2024-11-11 Thread Peter Geoghegan
On Mon, Nov 11, 2024 at 12:23 PM Robert Haas wrote: > > I think that holding onto pins and whatnot has almost nothing to do > > with the index AM as such -- it's about protecting against unsafe > > concurrent TID recycling, which is a table AM/heap issue. You can make > > a rather weak argument th

Re: Skip collecting decoded changes of already-aborted transactions

2024-11-11 Thread Masahiko Sawada
On Sun, Nov 10, 2024 at 11:24 PM Peter Smith wrote: > > Hi Sawada-San, here are some review comments for the patch v5-0001. > Thank you for reviewing the patch! > == > Commit message. > > 1. > This commit introduces an additional check to determine if a > transaction is already aborted by a

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

2024-11-11 Thread Ivan Kush
I agree, your realization is better: reliability is better and debugging is simplier. I've looked at the code, looks good to me. Only style notes like VTA/VtA, SELECT/select, etc. may be corrected On 10/4/24 12:15, Alena Rybakina wrote: It was sent here [0]. [0] https://www.postgresql.org/m

Re: Linkify mentions of the primary/subscriber's max_replication_slots

2024-11-11 Thread Tristan Partin
On Mon Nov 11, 2024 at 5:53 AM CST, Amit Kapila wrote: On Thu, Nov 7, 2024 at 4:40 PM Amit Kapila wrote: On Thu, Nov 7, 2024 at 9:36 AM Tristan Partin wrote: > > > Here is a patch which does so. > Note that this parameter also applies on the subscriber side, but with - a d

Re: index prefetching

2024-11-11 Thread Robert Haas
On Sun, Nov 10, 2024 at 5:41 PM Peter Geoghegan wrote: > > It seems to me knowing which pages may be pinned is very AM-specific > > knowledge, and my intention was to let the AM to manage that. > > This is useful information, because it helps me to understand how > you're viewing this. > > I total

Re: Add html-serve target to autotools and meson

2024-11-11 Thread Jacob Champion
On Mon, Nov 11, 2024 at 7:50 AM Andres Freund wrote: > If you just want that we could print out a file:// url or even open it? Rather > than an http server? +1. The coverage-html recipe is a nice example of this; just control-click the file: link and away you go. --Jacob

Re: define pg_structiszero(addr, s, r)

2024-11-11 Thread Bertrand Drouvot
Hi, On Mon, Nov 11, 2024 at 06:19:50AM +, Bertrand Drouvot wrote: > Hi, > > On Sat, Nov 09, 2024 at 04:15:04AM +, Bertrand Drouvot wrote: > > Hi, > > > > On Fri, Nov 08, 2024 at 11:18:09PM +1300, David Rowley wrote: > > > I tried with [1] and the > > > latest gcc does not seem to be smar

Re: Add reject_limit option to file_fdw

2024-11-11 Thread Fujii Masao
On 2024/11/11 21:45, torikoshia wrote: Thanks for adding the comment. It clearly states that REJECT_LIMIT can be a single-quoted string. However, it might also be helpful to mention that it can be provided as an int64 in the COPY command option. How about updating it like this? --

Offsets of `struct Port` are no longer constant

2024-11-11 Thread Jacob Champion
Hi all, A comment at the end of the Port struct says /* * OpenSSL structures. (Keep these last so that the locations of other * fields are the same whether or not you build with SSL enabled.) */ but as part of the direct-SSL changes in d39a49c1e45 (cc'd Heikki)

Re: Eager aggregation, take 3

2024-11-11 Thread Robert Haas
On Sun, Nov 10, 2024 at 7:52 PM Richard Guo wrote: > > I have similar but weaker feelings about ordered aggregates. Consider: > > > > explain select t1.id, array_agg(t2.v order by t3.o) from t1, t2, t3 > > where t1.id = t2.id and t2.id = t3.id group by 1; > > > > It seems to me that a partially ag

Re: Add parallel columns for seq scan and index scan on pg_stat_all_tables and _indexes

2024-11-11 Thread Robert Haas
On Sun, Nov 10, 2024 at 9:05 PM Michael Paquier wrote: > As hinted on other related threads like around [1], I am so-so about > the proposal of these numbers at table and index level now that we > have e7a9496de906 and 5d4298e75f25. I think the question to which we don't have a clear answer is: f

Re: PG17 failing tests (DST related?)

2024-11-11 Thread Dave Page
On Mon, 11 Nov 2024 at 15:35, Tom Lane wrote: > Dave Page writes: > > For about a week, the Windows builds I've been running in Github have > been > > failing for PG17: > > Should be fixed as of a35801915 ? > Ah, yes - it does appear to be fine with head. I guess I'll have to put up with the er

Re: Add html-serve target to autotools and meson

2024-11-11 Thread Andres Freund
Hi, On 2024-11-11 19:28:24 +0530, Ashutosh Bapat wrote: > On Mon, Nov 11, 2024 at 9:55 AM Michael Paquier wrote: > > > > On Sat, Nov 09, 2024 at 09:26:20AM +0100, Peter Eisentraut wrote: > > > What is the advantage of using an http server over just opening the file > > > directly in a web browser

explain plans for foreign servers

2024-11-11 Thread dinesh salve
Hi Hackers, I am working on a feature in postgres_fdw extension to show plans used by remote postgresql servers in the output of the EXPLAIN command. I think this will help end users understand query execution plans used by remote servers. Sample output for table people where people_1 is local par

Re: Commit Timestamp and LSN Inversion issue

2024-11-11 Thread Tomas Vondra
On 11/11/24 09:19, Amit Kapila wrote: > On Fri, Nov 8, 2024 at 8:23 PM Andres Freund wrote: >> >> On 2024-11-08 09:08:55 +, Zhijie Hou (Fujitsu) wrote: I think it's *completely* unacceptable to call a hook inside ReserveXLogInsertLocation, with the spinlock held, no less. That's

Re: PG17 failing tests (DST related?)

2024-11-11 Thread Tom Lane
Dave Page writes: > For about a week, the Windows builds I've been running in Github have been > failing for PG17: Should be fixed as of a35801915 ? regards, tom lane

PG17 failing tests (DST related?)

2024-11-11 Thread Dave Page
For about a week, the Windows builds I've been running in Github have been failing for PG17: https://github.com/dpage/winpgbuild/actions/workflows/postgresql.yml. The consistently failing tests are: postgresql:recovery / recovery/027_stream_regress postgresql:pg_upgrade / pg_upgrade/002_pg_upgrade

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-11 Thread Tomas Vondra
On 11/11/24 14:51, Ashutosh Bapat wrote: > ... > > I think the problem is about processing older running transactions > record and setting data.restart_lsn based on the candidates those > records produce. But what is not clear to me is how come a newer > candidate_restart_lsn is available immediate

Re: Incremental Sort Cost Estimation Instability

2024-11-11 Thread Andrei Lepikhov
Hi, Revising the patch I found out that it may make sense to teach estimate_num_groups to process a PathKey node inside the presortedExprs list. In this case it can pass through the EquivalenceClass members and choose correct number of distinct values. Here is a sketch of the solution (see in

Re: Add html-serve target to autotools and meson

2024-11-11 Thread Ashutosh Bapat
On Mon, Nov 11, 2024 at 9:55 AM Michael Paquier wrote: > > On Sat, Nov 09, 2024 at 09:26:20AM +0100, Peter Eisentraut wrote: > > What is the advantage of using an http server over just opening the file > > directly in a web browser (file:// scheme)? > > Not sure to see any on sight. I just use fi

Re: logical replication: restart_lsn can go backwards (and more), seems broken since 9.4

2024-11-11 Thread Ashutosh Bapat
On Sat, Nov 9, 2024 at 5:05 PM Tomas Vondra wrote: > > On 11/8/24 15:57, Ashutosh Bapat wrote: > > ... > > > > After examining the code before reading [2], I came to the same > > conclusion as Masahiko-san in [2]. We install candidate_restart_lsn > > based on the running transaction record whose L

Re: Support LIKE with nondeterministic collations

2024-11-11 Thread Heikki Linnakangas
On 04/11/2024 10:26, Peter Eisentraut wrote: On 29.10.24 18:15, Jacob Champion wrote: libfuzzer is unhappy about the following code in MatchText: +    while (p1len > 0) +    { +    if (*p1 == '\\') +    { +    found_escape = true; +  

RE: Parallel heap vacuum

2024-11-11 Thread Hayato Kuroda (Fujitsu)
Dear Sawda-san, > > I've attached new version patches that fixes failures reported by > cfbot. I hope these changes make cfbot happy. Thanks for updating the patch and sorry for delaying the reply. I confirmed cfbot for Linux/Windows said ok. I'm still learning the feature so I can post only on

Re: Doc: typo in config.sgml

2024-11-11 Thread Yugo Nagata
On Tue, 5 Nov 2024 10:08:17 +0100 Peter Eisentraut wrote: > >> So you convert LATIN1 characters to HTML entities so that it's easier > >> to detect non-LATIN1 characters is in the SGML docs? If my > >> understanding is correct, it can be also achieved by using some tools > >> like: > >> > >> ico

Re: magical eref alias names

2024-11-11 Thread Andrei Lepikhov
On 11/8/24 20:33, Robert Haas wrote: On Thu, Nov 7, 2024 at 4:38 PM Tom Lane wrote: The trick there is to keep them predictable, because as I mentioned in my previous response, there may be people depending on knowing what name will be assigned. We're working with a ton of history here, and I'

Re: Add reject_limit option to file_fdw

2024-11-11 Thread torikoshia
On 2024-11-08 01:44, Fujii Masao wrote: Thanks for your review! On 2024/11/05 22:30, torikoshia wrote: Thanks for the patch! Could you add it to the next CommitFest? Added an entry for this patch: https://commitfest.postgresql.org/50/5331/ Thanks! +ALTER FOREIGN TABLE agg_bad OPTIONS (re

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-11-11 Thread Nisha Moond
On Wed, Sep 18, 2024 at 3:31 PM shveta malik wrote: > > On Wed, Sep 18, 2024 at 2:49 PM shveta malik wrote: > > > > > > Please find the attached v46 patch having changes for the above review > > > > comments and your test review comments and Shveta's review comments. > > > > > > When the synced s

Re: Parallel workers stats in pg_stat_database

2024-11-11 Thread Benoit Lobréau
On 11/11/24 02:51, Michael Paquier wrote: Okidoki, applied. If tweaks are necessary depending on the feedback, like column names, let's tackle things as required. We still have a good chunk of time for this release cycle. -- Michael Thanks ! -- Benoit Lobréau Consultant http://dalibo.com

Re: Linkify mentions of the primary/subscriber's max_replication_slots

2024-11-11 Thread Amit Kapila
On Thu, Nov 7, 2024 at 4:40 PM Amit Kapila wrote: > > On Thu, Nov 7, 2024 at 9:36 AM Tristan Partin wrote: > > > > > > Here is a patch which does so. > > > > > Note that this parameter also applies on the subscriber side, but > with > - a different meaning. > + a diffe

Re: Add missing tab completion for ALTER TABLE ADD COLUMN IF NOT EXISTS

2024-11-11 Thread Karina Litskevich
On Sun, Nov 10, 2024 at 3:43 PM Kirill Reshke wrote: > > By the way, I suggest adding a completion of "ALTER TYPE ... ALTER > > ATTRIBUTE ... TYPE" with the list of types while we are here. It should > > probably go together with v4-0001. > > Surprisingly this is already supported in an interestin

Re: Virtual generated columns

2024-11-11 Thread jian he
On Wed, Nov 6, 2024 at 12:17 AM Peter Eisentraut wrote: > > New patch version. I've gone through the whole thread again and looked > at all the feedback and various bug reports and test cases and made sure > they are all addressed in the latest patch version. (I'll send some > separate messages

Re: Separate memory contexts for relcache and catcache

2024-11-11 Thread Ashutosh Bapat
On Sat, Nov 2, 2024 at 4:18 AM Andres Freund wrote: > > > > > I've previously proposed creating a type of memory context that's > > > intended for > > > places where we never expect to allocate much which allocates from > > > either a > > > superior memory context or just from the system allocator

Re: doc: pgevent.dll location

2024-11-11 Thread Amit Kapila
On Thu, Nov 7, 2024 at 1:46 PM Dave Page wrote: > > Hi > > On Wed, 6 Nov 2024 at 16:11, Peter Eisentraut wrote: >> >> On 06.11.24 13:57, Ryohei Takahashi (Fujitsu) wrote: >> > The dll install paths are changed as follows on Windows. >> > >> > (1) pgevent.dll >> > PG16: lib/ >> > PG17: bin/ >> > >

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

2024-11-11 Thread torikoshia
On 2024-11-09 21:55, Kirill Reshke wrote: Thanks for working on this! On Thu, 7 Nov 2024 at 23:00, Fujii Masao wrote: On 2024/10/26 6:03, Kirill Reshke wrote: > when the REJECT LIMIT is set to some non-zero number and the number of > row NULL replacements exceeds the limit, is it OK to fai

Re: [BUG] psql: Make \copy from 'text' and 'csv' formats fail on NUL bytes

2024-11-11 Thread Joel Jacobson
On Sun, Nov 10, 2024, at 23:14, Tom Lane wrote: > "Joel Jacobson" writes: >> On Sun, Nov 10, 2024, at 22:37, Tom Lane wrote: >>> That seems like a hack, as it also changes the behavior w.r.t. >>> prompts and EOF-mark detection, neither for the better. > >> Hmm, in what way does it change the behav

Re: Separate memory contexts for relcache and catcache

2024-11-11 Thread Ashutosh Bapat
On Sat, Nov 2, 2024 at 3:17 AM Jeff Davis wrote: > > On Fri, 2024-11-01 at 15:19 -0400, Andres Freund wrote: > > I'm a bit worried about the increase in "wasted" memory we might end > > up when > > creating one aset for *everything*. Just splitting out Relcache and > > CatCache > > isn't a big dea

Re: warn if GUC set to an invalid shared library

2024-11-11 Thread Heikki Linnakangas
I had a quick glance at this, and I agree with Robert's comment earlier that this requires a lot of context to understand. Does this change the behavior of what is accepted or not? What are those cases? Can you give some examples, please? When do you get the new warnings? Examples please. Do

RE: Commit Timestamp and LSN Inversion issue

2024-11-11 Thread Hayato Kuroda (Fujitsu)
Dear hackers, > I understand your concern and appreciate the feedback. I've made some > adjustments to the patch by directly placing the code to adjust the commit > timestamp within the spinlock, aiming to keep it as efficient as possible. The > changes have resulted in just a few extra lines. Wou

clean up create|alter domain stmt incompatiable constraint error case and add regression test

2024-11-11 Thread jian he
hi. https://coverage.postgresql.org/src/backend/commands/typecmds.c.gcov.html show DefineDomain has poor coverage tests. so I added a more extensive regression test. also create domain d_fail as int4 constraint cc GENERATED ALWAYS AS (2) STORED; ERROR: unrecognized constraint subtype: 4 This ki

Re: Add parallel columns for seq scan and index scan on pg_stat_all_tables and _indexes

2024-11-11 Thread Guillaume Lelarge
Le lun. 11 nov. 2024 à 03:05, Michael Paquier a écrit : > On Tue, Oct 08, 2024 at 06:24:54PM +0300, Alena Rybakina wrote: > > yes, I agree with you. Even when I experimented with vacuum settings for > > database and used my vacuum statistics patch [0] for analyzes , I first > > looked at this cha

Re: Proposal to add page headers to SLRU pages

2024-11-11 Thread Li, Yong
> On Nov 10, 2024, at 01:32, Rishu Bagga wrote: > > External Email > >> Thanks for pointing this out. Here is what I have tried: >> 1. Manually build and install PostgreSQL from the latest source code. >> 2. Following the instructions from src/bin/pg_upgrade to manually dump the >> regression >

Re: Commit Timestamp and LSN Inversion issue

2024-11-11 Thread Amit Kapila
On Fri, Nov 8, 2024 at 8:23 PM Andres Freund wrote: > > On 2024-11-08 09:08:55 +, Zhijie Hou (Fujitsu) wrote: > > > > > > I think it's *completely* unacceptable to call a hook inside > > > ReserveXLogInsertLocation, with the spinlock held, no less. That's the > > > most > > > contended sectio

Re: meson and check-tests

2024-11-11 Thread Nazir Bilal Yavuz
Hi, Thanks for the feedback! On Mon, 11 Nov 2024 at 06:34, jian he wrote: > > hi. > Actually, there is a difference compared to make. > make works fine with many whitespaces. but meson you can only have one > whitespace. > > meson test -C $BUILD7 --num-processes 20 --suite setup --verbose > expo

Re: pgcrypto: better memory management?...

2024-11-11 Thread Peter Eisentraut
On 08.11.24 03:15, Bear Giles wrote: The first is that openssl has supported custom memory management for a very long time - I remember using it in the late 90s. The function is in crypto.h  typedef void *(*CRYPTO_malloc_fn)(size_t num, const char *file, int line);  typedef void *(*CRYPTO_re

  1   2   >