Re: Add assertion for failed alloc to palloc0() and palloc_extended()

2025-03-02 Thread Michael Paquier
On Sat, Mar 01, 2025 at 01:05:43AM +0100, Andreas Karlsson wrote: > I noticed that we have Assert(ret != NULL) in palloc() but not in palloc0() > so for consistency I decided to add it. I also added an assertion that the > MCXT_ALLOC_NO_OOM flag is set if alloc() returns > NULL to palloc_extended()

Accidental assignment instead of compare in GetOperatorFromCompareType?

2025-03-02 Thread Jacob Brazeal
Hi all, It looks like commit 630f9a43cece93cb4a5c243b30e34abce6a89514 omitted an equals sign in an ereport() in GetOperatorFromCompareType, giving the line: cmptype = COMPARE_EQ ? errmsg("could not identify an equality operator for type %s", format_type_be(opcintype)) : I think the impact is jus

Re: [PATCH] Add regression tests of ecpg command notice (error / warning)

2025-03-02 Thread Ryo Kanbayashi
>On Mon, Mar 3, 2025 at 12:23 PM Fujii Masao >wrote: > On 2025/03/01 19:45, Ryo Kanbayashi wrote: > >> +program_help_ok('ecpg'); > >> +program_version_ok('ecpg'); > >> +program_options_handling_ok('ecpg'); > >> +command_fails(['ecpg'], 'ecpg without arguments fails'); > >> > >> These checks seem

Re: Accidental assignment instead of compare in GetOperatorFromCompareType?

2025-03-02 Thread Jacob Brazeal
Sorry, I attached the wrong patch. > v1_cmp_assign.patch Description: Binary data

Re: Accidental assignment instead of compare in GetOperatorFromCompareType?

2025-03-02 Thread Michael Paquier
On Sun, Mar 02, 2025 at 09:06:18PM -0800, Jacob Brazeal wrote: > Sorry, I attached the wrong patch. errcode(ERRCODE_UNDEFINED_OBJECT), -cmptype = COMPARE_EQ ? errmsg("could not identify an equality operator for type %s", format_type_be(opcintype)) : +

Re: doc: Mention clock synchronization recommendation for hot_standby_feedback

2025-03-02 Thread Amit Kapila
On Wed, Jan 8, 2025 at 6:20 PM Jakub Wartak wrote: > > On Wed, Dec 18, 2024 at 10:33 AM Amit Kapila wrote: > > Hi Amit! > > > On Thu, Dec 5, 2024 at 3:14 PM Jakub Wartak > > wrote: > > > > > > One of our customers ran into a very odd case, where hot standby feedback > > > backend_xmin propagati

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

2025-03-02 Thread Michael Paquier
On Fri, Feb 28, 2025 at 12:40:13PM -0800, Jacob Champion wrote: > v9 removes the first call, and moves the second (now only) call up and > out of the if/else chain, just past client authentication. The SSL > pre-auth tests have been removed. I have put my eyes on 0001, and this version looks sensi

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

2025-03-02 Thread Tom Lane
Junwang Zhao writes: > While review another thread (Emitting JSON to file using COPY TO), > I found the recently committed patches on this thread pass the > CopyFormatOptions struct directly rather a pointer of the struct > as a function parameter of CopyToGetRoutine and CopyFromGetRoutine. Cover

Re: 64 bit numbers vs format strings

2025-03-02 Thread Peter Eisentraut
On 05.12.24 23:18, Thomas Munro wrote: Having learned some things about gettext based on clues[1] from Peter E, I decided to see what it would take to expunge all (long long) and similar casts now that we're using the standard types with system support. The short version is tha given uint64 x:

Re: Logging which local address was connected to in log_line_prefix

2025-03-02 Thread Jim Jones
On 27.02.25 14:54, Greg Sabino Mullane wrote: > Great question. I think "supposed to" is a bit of a stretch, but I > presume it's the difference between a client connecting and using its > connection information versus an already existing backend process, > which is always going to be "local". >

Re: Add Postgres module info

2025-03-02 Thread Andrei Lepikhov
On 17/2/2025 02:41, Alexander Korotkov wrote: On Mon, Dec 16, 2024 at 7:02 AM Andrei Lepikhov wrote: On 12/13/24 10:17, Tom Lane wrote: There's nothing stopping a field of the magic block from being a "const char *" pointer to a string literal. Ok, See v.2 in attachment. Generally, the patc

Re: 64 bit numbers vs format strings

2025-03-02 Thread Tom Lane
Thomas Munro writes: > I also added one more patch that I expect to be more contentious as it > is a UX change. Why do we display LSNs with a slash? While there's surely little reason to do that anymore, I think the blast radius of such a change will be vastly greater than is warranted by aesthe

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

2025-03-02 Thread Sutou Kouhei
Hi, In <3191030.1740932...@sss.pgh.pa.us> "Re: Make COPY format extendable: Extract COPY TO format implementations" on Sun, 02 Mar 2025 11:27:20 -0500, Tom Lane wrote: >> While review another thread (Emitting JSON to file using COPY TO), >> I found the recently committed patches on this thr

Fixing various typos in comments and docs

2025-03-02 Thread Jacob Brazeal
This patch fixes various typos I've found, most of them from recent commits. I think none should be controversial except perhaps --- a/doc/src/sgml/ref/pgupgrade.sgml +++ b/doc/src/sgml/ref/pgupgrade.sgml @@ -801,7 +801,7 @@ psql --username=postgres --file=script.sql postgres - Be

Re: Extend postgres_fdw_get_connections to return remote backend pid

2025-03-02 Thread Fujii Masao
On 2025/02/28 21:23, Sagar Shedge wrote: Hi Fujii, Thanks for updates. Looks good to me. We can proceed with latest potch. Thanks for the review! I've pushed the patch. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION

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

2025-03-02 Thread Fujii Masao
On 2025/02/03 22:35, torikoshia wrote: Hi, When a hot standby is restarted in a state where subtransactions have overflowed, it may become inaccessible:   $ psql: error: connection to server at "localhost" (::1), port 5433 failed: FATAL:  the database system is not yet accepting connectio

Re: Allow table AMs to define their own reloptions

2025-03-02 Thread Yura Sokolov
02.03.2025 16:23, Julien Tachoires пишет: > On Sun, Mar 02, 2025 at 09:56:41AM +0100, Julien Tachoires wrote: >> With the help of the new TAM routine 'relation_options', table access >> methods can with this patch define their own reloptions >> parser/validator. >> >> These reloptions can be set

Re: Add Postgres module info

2025-03-02 Thread Andrei Lepikhov
On 17/2/2025 04:00, Michael Paquier wrote: On Mon, Feb 17, 2025 at 03:41:56AM +0200, Alexander Korotkov wrote: 1) Is it intended to switch all in-core libraries to use PG_MODULE_MAGIC_EXT()? 2) Once we have module version information, it looks natural to specify the required version for dependan

Re: per backend WAL statistics

2025-03-02 Thread Michael Paquier
On Fri, Feb 28, 2025 at 09:26:08AM +, Bertrand Drouvot wrote: > Also attaching the patch I mentioned up-thread to address some of Rahila's > comments ([1]): It adds a AuxiliaryPidGetProc() call in > pgstat_fetch_stat_backend_by_pid() > and pg_stat_reset_backend_stats(). I think that fully make

Re: [BUG]: the walsender does not update its IO statistics until it exits

2025-03-02 Thread Michael Paquier
On Fri, Feb 28, 2025 at 10:39:31AM +, Bertrand Drouvot wrote: > That sounds a good idea to measure the impact of those extra calls and see > if we'd need to mitigate the impacts. I'll collect some data. Thanks. -- Michael signature.asc Description: PGP signature

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

2025-03-02 Thread Junwang Zhao
On Mon, Mar 3, 2025 at 8:19 AM Sutou Kouhei wrote: > > Hi, > > In <3191030.1740932...@sss.pgh.pa.us> > "Re: Make COPY format extendable: Extract COPY TO format implementations" > on Sun, 02 Mar 2025 11:27:20 -0500, > Tom Lane wrote: > > >> While review another thread (Emitting JSON to file u

Re: making EXPLAIN extensible

2025-03-02 Thread Srinath Reddy
Hi Robert, thanks for working on this and +1 for the idea. i have reviewed 1,2 patches using 3rd patch(pg_overexplain module) and they LGTM,will review more the 3rd patch. Regards, Srinath Reddy Sadipiralla EDB:http://www.enterprisedb.com

Re: Coccinelle for PostgreSQL development [1/N]: coccicheck.py

2025-03-02 Thread Mats Kindahl
On Sat, Jan 18, 2025 at 8:44 PM Mats Kindahl wrote: > On Tue, Jan 14, 2025 at 4:19 PM Aleksander Alekseev < > aleksan...@timescale.com> wrote: > >> IMO the best solution would be re-submitting all the patches to this >> thread. Also please make sure the patchset is registered on the >> nearest op

Re: gamma() and lgamma() functions

2025-03-02 Thread Dean Rasheed
On Thu, 14 Nov 2024 at 22:35, Dean Rasheed wrote: > > On Thu, 14 Nov 2024 at 16:28, Dmitry Koval wrote: > > > > >SELECT gamma(float8 '1e-320'); > > ERROR: value out of range: overflow > > > > >SELECT gamma(float8 '0'); > >gamma > > -- > > Infinity > > (1 row) > > > > Perhaps it w

Re: Doc: clarify possibility of ephemeral discrepancies between state and wait_event in pg_stat_activity

2025-03-02 Thread Alex Friedman
discrepancy will look like. What about we do something much more simplified, such as the below: """ To keep the reporting overhead low, the system does not attempt to synchronize activity data for a backend. As a result, ephemeral discrepancies may exist between the view’s columns. """ Yes, I b

Re: Improving tracking/processing of buildfarm test failures

2025-03-02 Thread Alexander Lakhin
Hello hackers, Please take a look at the February report on buildfarm failures: # SELECT br, count(*) FROM failures WHERE dt >= '2025-02-01' AND  dt < '2025-03-01' GROUP BY br; REL_13_STABLE: 17 REL_14_STABLE: 11 REL_15_STABLE: 7 REL_16_STABLE: 15 REL_17_STABLE: 13 master: 186 -- Total: 249 (Coun

Re: bug when apply fast default mechanism for adding new column over domain with default value

2025-03-02 Thread jian he
On Sun, Mar 2, 2025 at 7:54 AM Tom Lane wrote: > > jian he writes: > > So I duplicated StoreAttrDefault and removed pg_attribute.atthasdef, > > pg_attrdef related code. > > and it works fine. > > I think the fundamental problem here is that StoreAttrDefault > shouldn't be involved in this in the

Options to control remote transactions’ access/deferrable modes in postgres_fdw

2025-03-02 Thread Etsuro Fujita
Hi, postgres_fdw opens remote transactions in read/write mode in a local transaction even if the local transaction is read-only. I noticed that this leads to surprising behavior like this: CREATE TABLE test (a int); CREATE FUNCTION testfunc() RETURNS int LANGUAGE SQL AS 'INSERT INTO public.test

Re: Considering fractional paths in Append node

2025-03-02 Thread Alexander Korotkov
Hi, Andrei! On Fri, Dec 6, 2024 at 10:13 AM Andrei Lepikhov wrote: > > On 12/6/24 13:48, Andrei Lepikhov wrote: > > On 11/2/24 01:18, Nikita Malakhov wrote: > >> I've corrected failing test and created a patch at Commitfest: > >> https://commitfest.postgresql.org/51/5361/ >> commitfest.postgresq

Re: Considering fractional paths in Append node

2025-03-02 Thread Alexander Korotkov
Hi, Andy! On Fri, Oct 18, 2024 at 3:55 AM Andy Fan wrote: > > Nikita Malakhov writes: > > > > The effect is easily seen in one of standard PG tests: > > Vanilla (current master): > > explain analyze > > select t1.unique1 from tenk1 t1 > > inner join tenk2 t2 on t1.tenthous = t2.tenthous and t2.t

Allow table AMs to define their own reloptions

2025-03-02 Thread Julien Tachoires
Hi, With the help of the new TAM routine 'relation_options', table access methods can with this patch define their own reloptions parser/validator. These reloptions can be set via the following commands: 1. CREATE TABLE ... USING table_am WITH (option1='value1', option2='value2'); 2. ALT

Re: [PATCH] Add regression tests of ecpg command notice (error / warning)

2025-03-02 Thread Fujii Masao
On 2025/03/01 19:45, Ryo Kanbayashi wrote: +program_help_ok('ecpg'); +program_version_ok('ecpg'); +program_options_handling_ok('ecpg'); +command_fails(['ecpg'], 'ecpg without arguments fails'); These checks seem unnecessary in 002 since they're already covered in 001. I reflected above. Th

Re: [Patch] add new parameter to pg_replication_origin_session_setup

2025-03-02 Thread Amit Kapila
On Thu, Jan 9, 2025 at 3:26 AM Euler Taveira wrote: > > On Thu, Aug 15, 2024, at 5:53 PM, Doruk Yilmaz wrote: > > Hello again, > > On Tue, Aug 13, 2024 at 12:48 AM Euler Taveira wrote: > > I'm curious about your use case. Is it just because the internal function > > has a > > different signature

Re: Get rid of WALBufMappingLock

2025-03-02 Thread Alexander Korotkov
On Fri, Feb 28, 2025 at 3:44 PM Michael Paquier wrote: > > On Fri, Feb 28, 2025 at 02:13:23PM +0100, Álvaro Herrera wrote: > > On 2025-Feb-28, Michael Paquier wrote: > >> Saying that, I have also done similar tests with your v12 for a couple > >> of hours and this looks stable under installcheck-w

Re: Get rid of WALBufMappingLock

2025-03-02 Thread Alexander Korotkov
On Fri, Feb 28, 2025 at 3:13 PM Álvaro Herrera wrote: > On 2025-Feb-28, Michael Paquier wrote: > > > Saying that, I have also done similar tests with your v12 for a couple > > of hours and this looks stable under installcheck-world. I can see > > that you've reworked quite a bit the surroundings

Re: Options to control remote transactions’ access/deferrable modes in postgres_fdw

2025-03-02 Thread Etsuro Fujita
On Sun, Mar 2, 2025 at 12:44 PM Etsuro Fujita wrote: > Attached is a small patch for these options. I will add this to the > March commitfest as it is still open. The CF was changed to in-progress just before, so I added it to the next CF. Best regards, Etsuro Fujita

Re: bug when apply fast default mechanism for adding new column over domain with default value

2025-03-02 Thread Tom Lane
jian he writes: > On Sun, Mar 2, 2025 at 7:54 AM Tom Lane wrote: >> I think the fundamental problem here is that StoreAttrDefault >> shouldn't be involved in this in the first place. > i've split missingval related code into StoreAttrMissingVal. Hm, this does nothing to improve the modularity o

Re: Cannot find a working 64-bit integer type on Illumos

2025-03-02 Thread Thomas Munro
On Tue, Dec 10, 2024 at 3:02 PM Thomas Munro wrote: > On Thu, Dec 5, 2024 at 12:16 PM Tom Lane wrote: > > Now you already snuck the camel's nose under the > > tent by including stdint.h there, and maybe these additional headers > > wouldn't do any further damage. > > Even though we fixed the imme

Re: doc: Mention clock synchronization recommendation for hot_standby_feedback

2025-03-02 Thread Jakub Wartak
Hi Amit, On Mon, Mar 3, 2025 at 6:26 AM Amit Kapila wrote: [..] OK, sure. > How about something like: "Note that if the clock on standby is moved > ahead or backward, the feedback message may not be sent at the > required interval. This can lead to prolonged risk of not removing > dead rows on

RE: long-standing data loss bug in initial sync of logical replication

2025-03-02 Thread Zhijie Hou (Fujitsu)
On Friday, February 28, 2025 4:28 PM Benoit Lobréau wrote: > > It took me a while but I ran the test on my laptop with 20 runs per test. I > asked > for a dedicated server and will re-run the tests if/when I have it. > > count of partitions | Head (sec) |Fix (sec) |Degradation (%) >

Re: Anti join confusion

2025-03-02 Thread Richard Guo
On Wed, Feb 26, 2025 at 7:09 PM Tender Wang wrote: > Recently, I found Greenplum implement pull-up NOT IN subquery. They have the > below comments in their codes: > > We normalize NOT subqueries using the following axioms: > * > * val NOT IN (subq) => val <> ALL (subq) > > Richard, do you have a

Re: Anti join confusion

2025-03-02 Thread Tender Wang
Richard Guo 于2025年3月3日周一 15:34写道: > On Wed, Feb 26, 2025 at 7:09 PM Tender Wang wrote: > > Recently, I found Greenplum implement pull-up NOT IN subquery. They have > the below comments in their codes: > > > > We normalize NOT subqueries using the following axioms: > > * > > * val NOT IN (subq) =

Selectively invalidate caches in pgoutput module

2025-03-02 Thread Hayato Kuroda (Fujitsu)
Dear hackers, Hi, this is a fork thread from [1]. I want to propose a small optimization for logical replication system. Background == When the ALTER PUBLICATION command is executed, all entries in RelationSyncCache will be discarded anyway. This mechanism works well but is sometimes not

Re: Allow table AMs to define their own reloptions

2025-03-02 Thread Julien Tachoires
On Sun, Mar 02, 2025 at 09:56:41AM +0100, Julien Tachoires wrote: > With the help of the new TAM routine 'relation_options', table access > methods can with this patch define their own reloptions > parser/validator. > > These reloptions can be set via the following commands: > 1. CREATE TABLE ..

Re: Statistics Import and Export

2025-03-02 Thread Magnus Hagander
On Sat, Mar 1, 2025 at 9:48 PM Jeff Davis wrote: > On Sat, 2025-03-01 at 13:52 -0500, Greg Sabino Mullane wrote: > > > Can you expand on some of those cases? > > > > Certainly. I think one of the problems is that because this patch is > > solving a pg_upgrade issue, the focus is on the "dump and

Re: Statistics Import and Export

2025-03-02 Thread Corey Huinker
> > Also, we will need to think through the set of pg_dump options again. A >> lot of our tools seem to assume that "if it's the default, we don't >> need a way to ask for it explicitly", which makes it a lot harder to >> ever change the default and keep a coherent set of options. >> > > That's a g

Re: Optimization for lower(), upper(), casefold() functions.

2025-03-02 Thread Alexander Borisov
19.02.2025 01:56, Jeff Davis пишет: On Wed, 2025-02-19 at 01:54 +0300, Alexander Borisov wrote: In proposing the patch for v3, I struck a balance between improving performance and reducing binary size, without sacrificing code clarity. Fair enough. I will continue reviewing v3. Did you have