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

2025-03-27 Thread Ashutosh Bapat
On Thu, Mar 20, 2025 at 3:25 PM Rushabh Lathia wrote: > > Hi Alvaro, > > Thank you for the offline discussion. > > As we all agree, changing the attnotnull datatype would not be a good idea > since it is > a commonly used catalog column, and many applications and extensions depend > on it. > > A

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

2025-03-27 Thread Peter Geoghegan
On Tue, Mar 18, 2025 at 1:01 PM Matthias van de Meent wrote: > My comments on 0004: > > > _bt_skiparray_strat_decrement > > _bt_skiparray_strat_increment > > In both functions the generated value isn't used when the in/decrement > overflows (and thus invalidates the qual), or when the opclass some

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-03-27 Thread Mahendra Singh Thalor
On Thu, 27 Mar 2025 at 18:33, Álvaro Herrera wrote: > > On 2025-Mar-27, Andrew Dunstan wrote: > > > I don't think we can backpatch this. It's a behaviour change. > > I agree, we can't. > > Also, if we're going to enforce this rule, then pg_upgrade --check needs > to alert users that they have a da

Re: psql \dh: List High-Level (Root) Tables and Indexes

2025-03-27 Thread Sadeq Dousti
> I think it's fine the way it is, with regards to v10 check. Can you post a > rebased patch? > Hi Greg, I just checked here: https://commitfest.postgresql.org/patch/5594/ Seems the patch is OK with the latest master, and no rebase is needed. Do you mean that instead of a diff, I post a patch? B

Re: Add pg_buffercache_evict_all() and pg_buffercache_mark_dirty[_all]() functions

2025-03-27 Thread Aidar Imamov
Hi! I've been looking at the patches v3 and there are a few things I want to talk about. EvictUnpinnedBuffer(): I think we should change the paragraph with "flushed" of the comment to something more like this: "If the buffer was dirty at the time of the call it will be flushed by calling Flus

Re: Improve monitoring of shared memory allocations

2025-03-27 Thread Tomas Vondra
On 3/27/25 13:56, Tomas Vondra wrote: > ... > > OK, I don't have any other comments for 0001 and 0002. I'll do some > more review and polishing on those, and will get them committed soon. > Actually ... while polishing 0001 and 0002, I noticed a couple more details that I'd like to ask about.

Re: Add “FOR UPDATE NOWAIT” lock details to the log.

2025-03-27 Thread Fujii Masao
On 2025/03/21 15:21, Yuki Seino wrote: Pushed the patch. Thanks! Thank you. I'm very happy !! Using the newly introduced mechanism, we can now easily extend the log_lock_failure GUC to support additional NOWAIT lock failures, such as LOCK TABLE ... NOWAIT, ALTER TABLE ... NOWAIT, ALTER MA

Re: [PATCH] PGSERVICEFILE as part of a normal connection string

2025-03-27 Thread Michael Paquier
On Thu, Mar 27, 2025 at 06:31:14PM +0900, Michael Paquier wrote: > I am not sure that I'll have the time to look at 0002 for this release > cycle, could it be possible to get a rebase for it? Here is a simple rebase that I have been able to assemble this morning. I won't have the space to review

Re: Remove restrictions in recursive query

2025-03-27 Thread Renan Alves Fonseca
On Thu, Mar 27, 2025 at 10:50 PM Tom Lane wrote: > > Renan Alves Fonseca writes: > > The solution using GROUP BY in the recursive query is the following: > > > with recursive t1(node,nb_path) as > > (select 1,1::numeric > >union all > > (select dag.target, sum(nb_path) > >

Re: Non-text mode for pg_dumpall

2025-03-27 Thread Andrew Dunstan
On 2025-03-19 We 2:41 AM, Mahendra Singh Thalor wrote: On Wed, 12 Mar 2025 at 21:18, Andrew Dunstan wrote: On 2025-03-12 We 3:03 AM, jian he wrote: On Wed, Mar 12, 2025 at 1:06 AM Álvaro Herrera wrote: Hello, On 2025-Mar-11, Mahendra Singh Thalor wrote: In map.dat file, I tried to fix t

Re: Remove restrictions in recursive query

2025-03-27 Thread Tom Lane
Renan Alves Fonseca writes: > I'll assume that the silence about allowing GROUP BY means it is not a > great idea... Well, you can do grouping, ordering, or whatever else you want to the result of the recursive WITH in the outer query level. I don't see any advantage in allowing an additional le

Re: Remove restrictions in recursive query

2025-03-27 Thread Renan Alves Fonseca
On Thu, Mar 27, 2025 at 7:32 PM Robert Haas wrote: > > > I'll assume that the silence about allowing GROUP BY means it is not a > > great idea... > > I don't think there's really anything to keep you from doing this -- > just put the grouping operation where you refer to the recursive CTE, > inste

Re: AIO v2.5

2025-03-27 Thread Andres Freund
Hi, On 2025-03-26 21:07:40 -0400, Andres Freund wrote: > TODO > ... > - Add an explicit test for the checksum verification in the completion > callback > > There is an existing test for testing an invalid page due to page header > verification in test_aio, but not for checksum failures. > >

Re: psql \dh: List High-Level (Root) Tables and Indexes

2025-03-27 Thread Sadeq Dousti
> I think this is the wrong way round. > It should be \dtN instead of \dNt. Hi Christoph, The order does not matter, the user can use \dNt or \dtN, as they do exactly the same thing. Letters coming after \d can be freely permuted. If you mean a change to the documentation or tests, I can apply wha

Re: POC, WIP: OR-clause support for indexes

2025-03-27 Thread Alexander Korotkov
Hi! On Mon, Mar 24, 2025 at 2:46 PM Alena Rybakina wrote: > I agree with Andrey's changes and think we should fix this, because otherwise > it might be inconvenient. > For example, without this changes we will have to have different test output > files for the same query for different versions

Re: psql \dh: List High-Level (Root) Tables and Indexes

2025-03-27 Thread Sadeq Dousti
Sorry Greg, Just understood what you mean. Please find attached the v6 of the patch. Best regards, Sadeq v6-0001-psql-acommand-for-non-partitioned-tables-indexes.patch Description: Binary data

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

2025-03-27 Thread Christoph Berg
Re: Robert Haas > I think that would be better than what we have now, but I still wonder > if we should give some kind of a hint that an external process may be > doing something to that file. Jakub and I may be biased by having just > seen a case of exactly that in the field, but I wonder now how

libpq maligning postgres stability

2025-03-27 Thread Andres Freund
Hi, We have several places in libpq where libpq says that a connection closing is probably due to a server crash with a message like: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing I think this is rather

Re: pg_stat_database.checksum_failures vs shared relations

2025-03-27 Thread Robert Haas
On Thu, Mar 27, 2025 at 11:58 AM Andres Freund wrote: > So, today we have the weird situation that *some* checksum errors on shared > relations get attributed to the current database (if they happen in a backend > normally accessing a shared relation), whereas others get reported to the > "shared

Re: Add Postgres module info

2025-03-27 Thread Tom Lane
Yurii Rashkovskii writes: > Would something like this work? Works for me; pushed. regards, tom lane

Re: psql \dh: List High-Level (Root) Tables and Indexes

2025-03-27 Thread Greg Sabino Mullane
I think it's fine the way it is, with regards to v10 check. Can you post a rebased patch? Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support

Re: psql \dh: List High-Level (Root) Tables and Indexes

2025-03-27 Thread Christoph Berg
Re: Sadeq Dousti > Thanks Greg and others for the feedback! > > Please find attached the patch for implementing \dN (including \dNt, \dNi, > \dNit). I don't care particularly about the choice of letter, but I think this is the wrong way round. It should be \dtN instead of \dNt. Is the form \dN a

pg_stat_database.checksum_failures vs shared relations

2025-03-27 Thread Andres Freund
Hi, First - I find it rather shocking that we have absolutely *zero* tests of checksum failures in the backend. Zero. As evidenced by [1]. I really can't quite believe it. Nor do we have tests of ignore_checksum_failure or zero_damaged_pages. I was trying to write some tests for checksums vs A

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

2025-03-27 Thread Alvaro Herrera
On 2025-Mar-24, jian he wrote: > hi. > you may like the attached. it's based on your idea: attnotnullvalid. This is quite close to what I was thinking, yeah. I noticed a couple of bugs however, and ended up cleaning up the whole thing. Here's what I have so far. I'm not sure the pg_dump bits a

Re: read stream on amcheck

2025-03-27 Thread Melanie Plageman
On Thu, Mar 27, 2025 at 2:46 PM Matheus Alcantara wrote: > > Just my 0.2 cents. I also like the first approach even though I prefer > the v4 version, but anyway, thanks very much for reviewing and > committing! Thanks for the patch! FWIW, I strongly disliked about v4 that two separate parts of t

Re: [PATCH] PGSERVICEFILE as part of a normal connection string

2025-03-27 Thread Michael Paquier
On Thu, Mar 27, 2025 at 06:31:14PM +0900, Michael Paquier wrote: > With all that in mind and more documentation added to the test, I've > applied 0001, so let's see what the buildfarm has to say. The CI was > stable, so it's a start. The buildfarm (particularly the Windows members that worried me

Re: Proposal: Progressive explain

2025-03-27 Thread Rafael Thofehrn Castro
Thanks Robert. Very thorough analysis there. Things I don't comment on will be fixed without further discussion. > There is a comment in ExplainOnePlan() that says "Handle progressive > explain cleanup manually if enabled as it is not called as part of > ExecutorFinish," but standard_ExecutorFini

Re: Add support for EXTRA_REGRESS_OPTS for meson

2025-03-27 Thread Rustam ALLAKOV
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: tested, failed Spec compliant: tested, failed Documentation:tested, failed Hello everyone, for v2 patch I suggest to refactor from > -sp =

RE: Selectively invalidate caches in pgoutput module

2025-03-27 Thread Hayato Kuroda (Fujitsu)
Dear Andres, > I think the new tests just failed in CI: > https://cirrus-ci.com/task/5602950271205376?logs=test_world#L268 Thanks for reporting, I'll look into it. Best regards, Hayato Kuroda FUJITSU LIMITED

Re: Disabling vacuum truncate for autovacuum

2025-03-27 Thread Nathan Bossart
On Thu, Mar 20, 2025 at 09:59:45AM -0700, David G. Johnston wrote: > I get the need for this kind of logic, since we used a boolean for the > table option, but as a self-proclaimed hack it seems worth more comments > than provided here. Especially pertaining to whether this is indeed > generic or

Re: Update Unicode data to Unicode 16.0.0

2025-03-27 Thread Robert Haas
On Wed, Mar 19, 2025 at 5:47 PM Jeff Davis wrote: > Do you have a sketch of what the ideal Unicode version management > experience might look like? Very high level, like "this is what happens > by default during an upgrade" and "this is how a user discovers that > that they might want to update Un

Re: speedup COPY TO for partitioned table.

2025-03-27 Thread jian he
hi. I made a mistake. The regress test sql file should have a new line at the end of the file. From a4c643ac3a9f40bbdf07dcacc38527ef6e86f1bc Mon Sep 17 00:00:00 2001 From: jian he Date: Fri, 28 Mar 2025 11:05:53 +0800 Subject: [PATCH v5 1/1] support COPY partitioned_table TO CREATE TABLE pp (id

Re: AIO v2.5

2025-03-27 Thread Noah Misch
On Thu, Mar 27, 2025 at 04:58:11PM -0400, Andres Freund wrote: > I now wrote some tests. And I both regret doing so (because it found problems, > which would have been apparent long ago, if the feature had come with *any* > tests, if I had gone the same way I could have just pushed stuff) and am gl

Re: pg_stat_database.checksum_failures vs shared relations

2025-03-27 Thread Julien Rouhaud
On Thu, Mar 27, 2025 at 09:02:02PM -0400, Andres Freund wrote: > Hi, > > On 2025-03-28 09:44:58 +0900, Michael Paquier wrote: > > On Thu, Mar 27, 2025 at 12:06:45PM -0400, Robert Haas wrote: > > > On Thu, Mar 27, 2025 at 11:58 AM Andres Freund wrote: > > > > So, today we have the weird situation t

Re: making EXPLAIN extensible

2025-03-27 Thread Robert Haas
On Thu, Mar 20, 2025 at 8:37 PM Sami Imseih wrote: > 1/ provides a good example for future extensions on how to > use the new hooks. it definitely would be nice to add an example > for the hook added to check options against each other as mentioned > by Andrei here [0] but I could not find a good

Re: pg_stat_database.checksum_failures vs shared relations

2025-03-27 Thread Michael Paquier
On Thu, Mar 27, 2025 at 12:06:45PM -0400, Robert Haas wrote: > On Thu, Mar 27, 2025 at 11:58 AM Andres Freund wrote: > > So, today we have the weird situation that *some* checksum errors on shared > > relations get attributed to the current database (if they happen in a > > backend > > normally a

Re: Cross-type index comparison support in contrib/btree_gin

2025-03-27 Thread Tom Lane
v3 needed to rebase over 55527368b. (I guess "git am" cannot tolerate any fuzz at all?) No changes of any significance whatsoever. regards, tom lane From 7a7da88f29972209ef75063140cbf4706ca527e3 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 27 Mar 2025 21:01:40 -04

Re: Snapshot related assert failure on skink

2025-03-27 Thread Heikki Linnakangas
On 21/03/2025 12:28, Tomas Vondra wrote: But it seems it changed in 952365cded6, which is: commit 952365cded635e54c4177399c0280cb7a5e34c11 Author: Heikki Linnakangas Date: Mon Dec 23 12:42:39 2024 +0200 Remove unnecessary GetTransactionSnapshot() calls In get_databa

Re: Remove restrictions in recursive query

2025-03-27 Thread Tom Lane
Renan Alves Fonseca writes: > I suspected that this restriction came straight from the specs. I > understand that while the proposed solution can help in some specific > use cases, it is not enough to justify an exception to the spec. Well, we extend the spec in lots of places. I'd be okay with

Re: speedup COPY TO for partitioned table.

2025-03-27 Thread jian he
On Fri, Mar 21, 2025 at 6:13 PM vignesh C wrote: > > I find an issue with the patch: > > -- Setup > CREATE SERVER myserver FOREIGN DATA WRAPPER postgres_fdw OPTIONS > (dbname 'testdb', port '5432'); > CREATE TABLE t1(id int) PARTITION BY RANGE(id); > CREATE TABLE part1 PARTITION OF t1 FOR VALUES F

Re: Selectively invalidate caches in pgoutput module

2025-03-27 Thread Amit Kapila
On Fri, Mar 28, 2025 at 6:03 AM Hayato Kuroda (Fujitsu) wrote: > > Dear Andres, > > > I think the new tests just failed in CI: > > https://cirrus-ci.com/task/5602950271205376?logs=test_world#L268 > > Thanks for reporting, I'll look into it. > The problem here is that after ALTER SUBSCRIPTION tap_

Re: Parallel heap vacuum

2025-03-27 Thread Masahiko Sawada
On Wed, Mar 26, 2025 at 1:00 PM Melanie Plageman wrote: > > On Mon, Mar 24, 2025 at 7:58 PM Masahiko Sawada wrote: > > > > You're right. I've studied the read stream code and figured out how to > > use it. In the attached patch, we end the read stream at the end of > > phase 1 and start a new rea

Re: making EXPLAIN extensible

2025-03-27 Thread Robert Haas
On Wed, Mar 19, 2025 at 11:38 AM Sami Imseih wrote: > ... as I made the hook signature match that of > ParseExplainOptionList, so both pstate and the options list > are now available to the hook. This version LGTM, except it's not pgindent-clean. -- Robert Haas EDB: http://www.enterprisedb.com

Re: Doc: Fixup misplaced filelist.sgml entities and add some commentary

2025-03-27 Thread Steven Niu
Hi, David, In the file docguide.sgml, there is a typo. "Within the book are parts, mostly defined within the same file, expect for the", the "expect" here should be "except". Thanks, Steven 在 2025/3/20 5:13, David G. Johnston 写道: Hi. Having been in filelist.sgml a bit recently I've noticed

Re: making EXPLAIN extensible

2025-03-27 Thread Man Zeng
I tried it out and felt good about this feature. But I found that the following information is not very complete. postgres=# select * from pg_get_loaded_modules(); module_name | version | file_name --+-+--- | | pg_overexplain.so

Re: Use XLOG_CONTROL_FILE macro everywhere?

2025-03-27 Thread Anton A. Melnikov
Hi! * Patch needs rebase by CFbot Rebased the patches onto the current master and marked them as v4. Best wishes, -- Anton A. Melnikov Postgres Professional: http://www.postgrespro.com The Russian Postgres CompanyFrom 689539285dd813a682507ce310b45c978d67b065 Mon Sep 17 00:00:00 2001 From: K

Re: [PATCH] SVE popcount support

2025-03-27 Thread John Naylor
On Thu, Mar 27, 2025 at 10:38 AM Nathan Bossart wrote: > I also noticed a silly mistake in 0003 that would cause us to potentially > skip part of the tail. That should be fixed now. I'm not sure whether that meant it could return the wrong answer, or just make more work for paths further down. I

Re: read stream on amcheck

2025-03-27 Thread Nazir Bilal Yavuz
Hi, On Thu, 27 Mar 2025 at 03:48, Melanie Plageman wrote: > > On Mon, Mar 17, 2025 at 9:47 AM Matheus Alcantara > wrote: > > > > Sorry for the delay, attached v4 with the remaining fixes. > > Thanks for the patch. > > I started reviewing this with the intent to commit it. But, I decided > while

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

2025-03-27 Thread Jakub Wartak
On Wed, Mar 26, 2025 at 4:01 PM Robert Haas wrote: [..] > > so how about: > > -HINT: This has been seen to occur with buggy kernels; consider > > updating your system. > > +HINT: This has been observed with files being overwritten, buggy > > kernels and potentially other external file system inf

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

2025-03-27 Thread Shubham Khanna
On Thu, Mar 27, 2025 at 12:16 PM Amit Kapila wrote: > > On Wed, Mar 26, 2025 at 4:02 PM Shubham Khanna > wrote: > > > > Let's combine 0001 and 0002. > Combined 0001 and 0002. > A few minor comments: > * > + If database name is not specified in publisher-server, it will try to > + co

Re: [fixed] Trigger test

2025-03-27 Thread Dmitrii Bondar
Hi, Paul, Thanks for the suggestions. > This looks good. I have a couple small grammar suggestions. This: I have replaced the incorrect articles with the correct ones. > We can put all the new lines inside the #ifdef, can't we? You're right. I have done that. Best regards, Dmitrii From f56

Re: simplifying grammar for ALTER CONSTRAINT .. SET [NO] INHERIT

2025-03-27 Thread Álvaro Herrera
On 2025-Mar-26, Suraj Kharage wrote: > Yes, I agree. As Peter said, it is now inline with other commands. > > I have reviewed the patch and it looks good to me. Thanks for reviewing! > Since we are removing the SET keyword, how about removing that from the > below comment as well. > > /* > *

Re: why there is not VACUUM FULL CONCURRENTLY?

2025-03-27 Thread Antonin Houska
Alvaro Herrera wrote: > On 2025-Mar-22, Antonin Houska wrote: > > > Alvaro Herrera wrote: > > > > > I rebased this patch series; here's v09. No substantive changes from v08. > > > I made sure the tree still compiles after each commit. > > I rebased again, fixing a compiler warning reported b

Re: Add Postgres module info

2025-03-27 Thread Tom Lane
Yurii Rashkovskii writes: > This recent patch is great but causes a small problem. It mixes designated > and non-designated initializers, specifically in `PG_MODULE_MAGIC_DATA(0)`. Ugh. I felt a bit itchy about that, but my compiler wasn't complaining... Can you propose a specific change to cle

Re: Historic snapshot doesn't track txns committed in BUILDING_SNAPSHOT state

2025-03-27 Thread cca5507
Hi, This change doesn't solve a bug. But I think it makes the code and comments more consistent. I currently have no idea about how to test it. -- Regards, ChangAo Chen

Re: Fix 035_standby_logical_decoding.pl race conditions

2025-03-27 Thread Amit Kapila
On Wed, Mar 26, 2025 at 1:17 PM Hayato Kuroda (Fujitsu) wrote: > > > Seeing all these failures, I wonder whether we can reliably test > > active slots apart from wal_level change test (aka Scenario 6: > > incorrect wal_level on primary.). Sure, we can try by having some > > injection point kind of

Re: Thread-safe nl_langinfo() and localeconv()

2025-03-27 Thread Peter Eisentraut
On 14.02.25 15:13, Peter Eisentraut wrote: On 09.02.25 15:52, Peter Eisentraut wrote: This patch set is still desirable.  Here is a rebased version of the v5 patches.  I haven't applied any corrections or review comments. Here is the same patch set with some review comments. Patch 0001 looks

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

2025-03-27 Thread Ilia Evdokimov
On 26.03.2025 22:37, Robert Haas wrote: I also don't think that we should be too concerned about bloating the EXPLAIN output in the context of a patch that only affects Memoize. Memoize nodes are not incredibly common in the query plans that I see, so even if we added another line or three to th

Re: FileFallocate misbehaving on XFS

2025-03-27 Thread Andrea Gelmini
Il giorno lun 9 dic 2024 alle ore 10:47 Andrea Gelmini < andrea.gelm...@gmail.com> ha scritto: > > Funny, i guess it's the same reason I see randomly complain of WhatsApp > web interface, on Chrome, since I switched to XFS. It says something like > "no more space on disk" and logout, with more tha

Re: Amcheck verification of GiST and GIN

2025-03-27 Thread Mark Dilger
On Fri, Feb 21, 2025 at 6:29 AM Tomas Vondra wrote: > Hi, > > I see this patch didn't move since December :-( I still think these > improvements would be useful, it certainly was very helpful when I was > working on the GIN/GiST parallel builds (the GiST builds stalled, but I > hope to push the G

Re: Support "make check" for PGXS extensions

2025-03-27 Thread Peter Eisentraut
On 20.03.25 18:20, David E. Wheeler wrote: On Mar 20, 2025, at 09:06, Peter Eisentraut wrote: This is a quick follow-up to the extension_control_path patch. With this little additional patch, you can now run "make check" in PGXS-using extensions (instead of having to do make install; make i

Remove restrictions in recursive query

2025-03-27 Thread Renan Alves Fonseca
Hi, I'm confused about what we should allow in a recursive query. For example, in the following query: WITH RECURSIVE t1 AS ( SELECT 1 UNION SELECT generate_series(2,3) FROM t1 ORDER BY 1 DESC) SELECT * FROM t1 ; The parser attaches the "order by" clause to the "union" operator, and then we er

Docs and tests for RLS policies applied by command type

2025-03-27 Thread Dean Rasheed
While looking at the INSERT ... ON CONFLICT DO SELECT patch, I noticed that the "Policies Applied by Command Type" table on the CREATE POLICY page doesn't fully or accurately describe all the policies that are actually checked in all cases: * INSERT ON CONFLICT checks the new row from the INSERT a

Re: libpq maligning postgres stability

2025-03-27 Thread Christoph Berg
Re: Robert Haas > I wonder if, in addition to removing the hint, we could also consider > rewording the message. For example, a slight rewording to "server > connection closed unexpectedly" would avoid implying that it was the There is a lot of software doing string-parsing of this part of the mes

Re: Remove restrictions in recursive query

2025-03-27 Thread Renan Alves Fonseca
On Thu, Mar 27, 2025 at 7:10 PM David G. Johnston wrote: > > There is distinct behavior between group by and order by here. You seem to > be mixing them up. > > From Select: > > select_statement is any SELECT statement without an ORDER BY, LIMIT, FOR NO > KEY UPDATE, FOR UPDATE, FOR SHARE, or F

Re: Remove restrictions in recursive query

2025-03-27 Thread Renan Alves Fonseca
On Thu, Mar 27, 2025 at 5:38 PM Robert Haas wrote: > It's not a problem if UNION ALL is used within the initial_query and > it's not a problem if UNION ALL is used within the iterated_query. But > you can't apply ORDER BY to the result of the UNION, because the UNION > is kind of fake -- we're not

Re: Remove restrictions in recursive query

2025-03-27 Thread David G. Johnston
On Thu, Mar 27, 2025 at 11:03 AM Renan Alves Fonseca wrote: > On Thu, Mar 27, 2025 at 5:38 PM Robert Haas wrote: > > It's not a problem if UNION ALL is used within the initial_query and > > it's not a problem if UNION ALL is used within the iterated_query. But > > you can't apply ORDER BY to the

Re: AIO v2.5

2025-03-27 Thread Noah Misch
On Wed, Mar 12, 2025 at 01:06:03PM -0400, Andres Freund wrote: > On 2025-03-11 20:57:43 -0700, Noah Misch wrote: > > - Like you say, "redefine max_files_per_process to be about the number of > > files each *backend* will additionally open". It will become normal that > > each backend's actual

Re: Remove restrictions in recursive query

2025-03-27 Thread Robert Haas
On Thu, Mar 27, 2025 at 2:21 PM Renan Alves Fonseca wrote: > You're right. I'm really mixing these 2 here. Thanks for the clarification. It looks like GROUP BY binds to the particular UNION branch but ORDER BY binds to the UNION as a whole: robert.haas=# select 2 union all select 1; ?column? --

Re: Proposal: Progressive explain

2025-03-27 Thread Robert Haas
On Wed, Mar 26, 2025 at 5:58 PM Rafael Thofehrn Castro wrote: > So implementation was done based on transaction nested level. Cleanup is only > performed when AbortSubTransaction() is called in the same transaction nested > level as the one where the query is running. This covers both PL/pgSQL >

Re: read stream on amcheck

2025-03-27 Thread Melanie Plageman
On Thu, Mar 27, 2025 at 4:45 AM Nazir Bilal Yavuz wrote: > > I liked the first approach more. We can solve the first approach's > problems by introducing a void pointer to pass to > read_stream_begin_relation(). We can set it to &rsdata.range for the > SKIP_PAGES_NONE case and &rsdata for the rest

Re: read stream on amcheck

2025-03-27 Thread Matheus Alcantara
On Thu, Mar 27, 2025 at 3:35 PM Melanie Plageman wrote: > > On Thu, Mar 27, 2025 at 4:45 AM Nazir Bilal Yavuz wrote: > > > > I liked the first approach more. We can solve the first approach's > > problems by introducing a void pointer to pass to > > read_stream_begin_relation(). We can set it to

Re: Change log level for notifying hot standby is waiting non-overflowed snapshot

2025-03-27 Thread torikoshia
On 2025-03-27 11:06, torikoshia wrote: Hi, I had another off-list discussion with Fujii-san, and according to the following manual[1], it seems that a transaction with an overflowed subtransaction is already considered inconsistent: Reaching a consistent state can also be delayed in the prese

Re: Amcheck verification of GiST and GIN

2025-03-27 Thread Tomas Vondra
On 3/27/25 16:30, Mark Dilger wrote: > > > On Fri, Feb 21, 2025 at 6:29 AM Tomas Vondra > wrote: > > Hi, > > I see this patch didn't move since December :-( I still think these > improvements would be useful, it certainly was very helpful when I was >

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

2025-03-27 Thread Alvaro Herrera
On 2025-Mar-27, Ashutosh Bapat wrote: > On Thu, Mar 27, 2025 at 6:01 PM vignesh C wrote: > > Couple of minor thoughts: > > 1) I felt this error message is not conveying the error message correctly: > > + if ($src_node->pg_version != $dst_node->pg_version > > + or defined $src

Re: Support "make check" for PGXS extensions

2025-03-27 Thread David E. Wheeler
On Mar 27, 2025, at 12:21, Peter Eisentraut wrote: > Interesting. I think to support that, we would need to do a temp install > kind of thing of the extension, and then point the path settings into that > temp install directory. Which is probably more sensible anyway. If it runs against a te

Re: Use CLOCK_MONOTONIC_COARSE for instr_time when available

2025-03-27 Thread Jianghua Yang
*I agree, so this patch only affects explain analyze.* *1. This change to CLOCK_MONOTONIC_COARSE only affects EXPLAIN ANALYZE and does not impact other modules.* The patch introduces optional support for CLOCK_MONOTONIC_COARSE specifically within the INSTR_TIMEinstrumentation framework. The modif

Re: acronym, glossary and other related matters in the docs

2025-03-27 Thread David G. Johnston
On Fri, Mar 21, 2025 at 1:55 PM Andres Freund wrote: > Hi, > > I was trying to write some docs for an AIO related view. As part of that I > noticed that we referenced I/O a lot, but never defined it as an acronym or > had it in the glossary. While adding those I got somewhat confused by > things

Re: Remove vardata parameters from eqjoinsel_inner

2025-03-27 Thread Richard Guo
On Fri, Feb 21, 2025 at 7:04 PM Ilia Evdokimov wrote: > When calculating selectivity for an inner equijoin, we call > eqjoinsel_inner, which uses unused parameters vardata1 and vardata2. > These parameters might have been left behind accidentally when we moved > getting sslots out of the function.

Re: Remove restrictions in recursive query

2025-03-27 Thread Robert Haas
On Thu, Mar 27, 2025 at 12:02 PM Renan Alves Fonseca wrote: > WITH RECURSIVE t1 AS ( SELECT 1 UNION SELECT generate_series(2,3) FROM t1 > ORDER BY 1 DESC) SELECT * FROM t1 ; > > The parser attaches the "order by" clause to the "union" operator, and then > we error out with the following messag

Re: Remove restrictions in recursive query

2025-03-27 Thread Robert Haas
On Thu, Mar 27, 2025 at 12:37 PM Robert Haas wrote: > It's not a problem if UNION ALL is used within the initial_query and > it's not a problem if UNION ALL is used within the iterated_query. But > you can't apply ORDER BY to the result of the UNION, because the UNION > is kind of fake -- we're no

Re: Remove restrictions in recursive query

2025-03-27 Thread David G. Johnston
On Thu, Mar 27, 2025 at 9:02 AM Renan Alves Fonseca wrote: > So, do we support the ORDER BY in a recursive query or not? > Apparently we do. The "in" recurses. If the answer is yes, I suggest one of the following modifications: > 1. Change the error message to something like "ORDER BY at the t

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

2025-03-27 Thread Ashutosh Bapat
On Thu, Mar 27, 2025 at 10:45 PM Alvaro Herrera wrote: > > On 2025-Mar-27, Ashutosh Bapat wrote: > > > On Thu, Mar 27, 2025 at 6:01 PM vignesh C wrote: > > > > Couple of minor thoughts: > > > 1) I felt this error message is not conveying the error message correctly: > > > + if ($src_node->p

RE: Selectively invalidate caches in pgoutput module

2025-03-27 Thread Hayato Kuroda (Fujitsu)
Dear Amit, > The problem here is that after ALTER SUBSCRIPTION tap_sub SET > PUBLICATION ..., we didn't wait for the new walsender on publisher to > start. We must use wait_for_subscription_sync both after the "CREATE > SUBSCRIPTION ..." and the "ALTER SUBSCRIPTION ..." commands and keep > copy_da

Re: dblink: Add SCRAM pass-through authentication

2025-03-27 Thread Matheus Alcantara
On Fri, Mar 21, 2025 at 1:28 PM Jacob Champion wrote: > > Great, thank you! Looking over v10, I think I've run out of feedback > at this point. Marked Ready for Committer. Thanks for all the effort reviewing this patch! -- Matheus Alcantara

Re: Statistics import and export: difference in statistics of materialized view dumped

2025-03-27 Thread Jeff Davis
On Thu, 2025-03-27 at 17:07 +0530, Ashutosh Bapat wrote: > Pulled the latest sources but the test is still failing with the same > differences. The attached set of patches (your 0001 and 0002, combined with my patch v2j-0003) applied on master (058b5152f0) are passing the pg_upgrade test suite for

Re: UUID v7

2025-03-27 Thread Masahiko Sawada
On Wed, Mar 26, 2025 at 12:32 PM Andrei Borodin wrote: > > > > 26.03.2025, 21:06, "Masahiko Sawada" : > > Agreed. I've done this in the attached patch. > > Great! The patch looks good to me. Thank you for reviewing it. I'm going to push the fix tomorrow, barring further comments. Regards, -- M

duplicated comments on get_relation_constraints

2025-03-27 Thread jian he
hi. in plancat.c, function: get_relation_constraints ``` for (i = 0; i < num_check; i++) { Node *cexpr; /* * If this constraint hasn't been fully validated yet, we must * ignore it here. Also ignore if NO INHERIT and we weren't told * that that's safe. */

Re: pg_stat_database.checksum_failures vs shared relations

2025-03-27 Thread Andres Freund
Hi, On 2025-03-28 09:44:58 +0900, Michael Paquier wrote: > On Thu, Mar 27, 2025 at 12:06:45PM -0400, Robert Haas wrote: > > On Thu, Mar 27, 2025 at 11:58 AM Andres Freund wrote: > > > So, today we have the weird situation that *some* checksum errors on > > > shared > > > relations get attributed

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

2025-03-27 Thread Robert Haas
On Wed, Mar 12, 2025 at 2:20 PM Alvaro Herrera wrote: > Taking a step back after discussing this with some colleagues, I need to > contradict what I said at the start of this thread. There's a worry > that changing pg_attribute.attnotnull in the way I initially suggested > might not be such a gre

Re: making EXPLAIN extensible

2025-03-27 Thread Andrei Lepikhov
On 3/26/25 19:09, Robert Haas wrote: On Sat, Mar 22, 2025 at 12:10 PM Robert Haas wrote: I'm not going to insist on shipping this if I'm the ONLY one who would ever get any use out of it, but I doubt that's the case. Hearing no other votes against this, I have committed it, but now I wonder i

Re: libpq maligning postgres stability

2025-03-27 Thread Robert Haas
On Thu, Mar 27, 2025 at 11:19 AM Andres Freund wrote: > We have several places in libpq where libpq says that a connection closing is > probably due to a server crash with a message like: > > server closed the connection unexpectedly > This probably means the server terminated abnormally >

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

2025-03-27 Thread Robert Haas
On Thu, Mar 27, 2025 at 6:12 AM Ilia Evdokimov wrote: > I understand the concerns raised about the risk of opening the door to more > diagnostic detail across various plan nodes. However, in Hash Join, Merge > Join, and Nested Loop, EXPLAIN typically reveals at least some of the > planner’s exp

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

2025-03-27 Thread Ashutosh Bapat
On Thu, Mar 27, 2025 at 6:01 PM vignesh C wrote: > > On Tue, 25 Mar 2025 at 16:09, Ashutosh Bapat > wrote: > > > > On Mon, Mar 24, 2025 at 5:44 PM Alvaro Herrera > > wrote: > > > > > > On 2025-Mar-24, Ashutosh Bapat wrote: > > > > > > > One concern I have with directory format is the dumped dat

Re: Remove restrictions in recursive query

2025-03-27 Thread Tom Lane
Renan Alves Fonseca writes: > The solution using GROUP BY in the recursive query is the following: > with recursive t1(node,nb_path) as > (select 1,1::numeric >union all > (select dag.target, sum(nb_path) > from t1 join dag on t1.node=dag.source > group by 1) >

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

2025-03-27 Thread Alena Rybakina
Hi! On 26.03.2025 02:45, Peter Geoghegan wrote: On Sat, Mar 22, 2025 at 1:47 PM Peter Geoghegan wrote: Attached is v30, which fully replaces the pstate.prechecked optimization with the new _bt_skip_ikeyprefix optimization (which now appears in v30-0002-Lower-nbtree-skip-array-maintenance-overh

Re: read stream on amcheck

2025-03-27 Thread Matheus Alcantara
On Thu, Mar 27, 2025 at 4:42 PM Melanie Plageman wrote: > > On Thu, Mar 27, 2025 at 2:46 PM Matheus Alcantara > wrote: > > > > Just my 0.2 cents. I also like the first approach even though I prefer > > the v4 version, but anyway, thanks very much for reviewing and > > committing! > > Thanks for t

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

2025-03-27 Thread Peter Geoghegan
On Mon, Mar 17, 2025 at 6:51 PM Matthias van de Meent wrote: > This hasn't changed meaningfully in this patch, but I noticed that > pstate.finaltup is never set for the final page of the scan direction > (i.e. P_RIGHTMOST or P_LEFTMOST for forward or backward, > respectively). If it isn't used mor

Bringing non-atomic operation to a PL that hasn't had it

2025-03-27 Thread Chapman Flack
Hi, If a maintainer of a 20-year-old PL that never supported non-atomic operation wants to catch up, it is easy enough to find the documentation on SPI_connect_ext and SPI_OPT_NONATOMIC, and learn how to determine the atomic/non-atomic state on entry from the atomic field of InlineCodeBlock for a

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

2025-03-27 Thread Richard Guo
On Wed, Mar 26, 2025 at 6:45 PM David Rowley wrote: > On Wed, 26 Mar 2025 at 19:31, Richard Guo wrote: > > On Wed, Mar 26, 2025 at 3:06 PM Tender Wang wrote: > > > The comment about notnullattnums in struct RangeTblEntry says that: > > > * notnullattnums is zero-based set containing attnums of

  1   2   >