Re: Improve verification of recovery_target_timeline GUC.

2025-02-13 Thread Michael Paquier
On Fri, Jan 24, 2025 at 01:36:45PM +, David Steele wrote: > I attached the wrong patch. Oops! Thanks for the new patch. > + timeline = strtoull(*newval, &endp, 0); > + > + if (*endp != '\0' || errno == EINVAL || errno == ERANGE) > { >

Re: AIO v2.3

2025-02-13 Thread Jakub Wartak
On Tue, Feb 11, 2025 at 12:10 AM Andres Freund wrote: >> TLDR; in terms of SELECTs the master vs aioworkers looks very solid! > Phew! Weee! Yay. Another good news: I've completed a full 24h pgbench run on the same machine and it did not fail or report anything suspicious. FYI, patchset didn't n

Re: Restrict publishing of partitioned table with a foreign table as partition

2025-02-13 Thread Shlok Kyal
On Thu, 13 Feb 2025 at 20:12, vignesh C wrote: > > On Thu, 13 Feb 2025 at 15:50, Shlok Kyal wrote: > > > > > > I have fixed the issue. Attached the updated v6 patch. > > There is another concurrency issue: > In case of create publication for all tables with > publish_via_partition_root we will ca

Re: Proposal - Allow extensions to set a Plan Identifier

2025-02-13 Thread Michael Paquier
On Thu, Feb 13, 2025 at 11:10:27AM -0600, Sami Imseih wrote: > I don't think direct setting of values is a good idea. We will need an API > similar to pgstat_report_query_id which ensures we are only reporting top > level planIds -and- in the case of multiple extensions with the capability > to set

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

2025-02-13 Thread Amit Kapila
On Wed, Feb 12, 2025 at 10:41 AM Ajin Cherian wrote: > > On Wed, Jan 29, 2025 at 9:31 AM Peter Smith wrote: > > Hi Ajin, > > Some review comments for patch v12-0001. > > == > Commit message > > 1. > Track transactions which have snapshot changes with a new flag > R

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-13 Thread Evgeny Voropaev
Hello Aleksander! Hello Álvaro! Thank you for your attention to the patch. Since BootStrapSlruPage() is the only caller of ZeroPage() it seems to me that it merely wastes space in SlruCtlData. On top of that I'm not 100% sure if all the supported platforms have C99 compilers with designated init

Re: [Feature Request] INSERT FROZEN to Optimize Large Cold Data Imports and Migrations

2025-02-13 Thread Sébastien
Thank you for your answer TOM. I'd like to have this option only for initial loading of huge amounts of data, where atomicity consistency is needed at all. Maybe an option on startup command just for initial import mode, would be nice. I had huge problems on server 3 weeks after a 6 TB migration f

Re: Move wal_buffers_full to WalUsage (and report it in pgss/explain)

2025-02-13 Thread Michael Paquier
On Tue, Feb 11, 2025 at 09:37:37AM +, Bertrand Drouvot wrote: > While at it, adding 0004 to report wal_buffers_full in VACUUM/ANALYZE > (VERBOSE). Thanks for summarizing the history behind WalUsage and wal_buffers_full. FWIW, 0001 that moves wal_buffers_full from PgStat_PendingWalStats to Wa

Re: Move wal_buffers_full to WalUsage (and report it in pgss/explain)

2025-02-13 Thread Michael Paquier
On Tue, Feb 11, 2025 at 02:05:18PM +, Bertrand Drouvot wrote: >> 2. I have a small suggestion for pg_stat_statements: would it make sense to >> move wal_buffers_full next to wal_records, wal_fpi and wal_bytes? This way, >> all WAL-related information would be grouped together. > > I think I pr

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

2025-02-13 Thread Peter Smith
Hi Ajin, Some review comments for the patch v13-0002. == src/backend/replication/logical/reorderbuffer.c 1. GENERAL I felt that a summary/overview of how all this filter/cache logic works should be given in the large file header comment at the top of this file. There may be some overlap wit

Re: Is pgAdmin the only front-end to PostgreSQL debugger ? And is "a working pl/pgsql debugger" something core should care to maintain ?

2025-02-13 Thread Pavel Stehule
Hi pá 14. 2. 2025 v 0:37 odesílatel Hannu Krosing napsal: > On Thu, Feb 13, 2025 at 8:10 PM Pavel Stehule > wrote: > > > > Hi > > > > čt 13. 2. 2025 v 18:00 odesílatel Hannu Krosing > napsal: > >> > >> Hallo PostgreSQL Hackers, > >> > >> > >> We recently discovered an error where pgAdmin fails

Re: Assignment before assert

2025-02-13 Thread Michael Paquier
On Fri, Feb 14, 2025 at 12:15:40AM +0100, Daniel Gustafsson wrote: > > On 13 Feb 2025, at 18:08, Dmitry Koval wrote: > > > > Hi! > > Function EvalPlanQualFetchRowMark contains an assignment > > > > ExecRowMark *erm = earm->rowmark; > > > > before assert > > > > Assert(earm != NULL); > > > > M

Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.

2025-02-13 Thread Shubham Khanna
On Thu, Feb 13, 2025 at 5:36 PM Shlok Kyal wrote: > > On Thu, 13 Feb 2025 at 15:20, Shubham Khanna > wrote: > > > > On Tue, Feb 11, 2025 at 9:56 PM Shlok Kyal wrote: > > > > > > On Tue, 11 Feb 2025 at 09:51, Shubham Khanna > > > wrote: > > > > > > > > On Fri, Feb 7, 2025 at 7:46 AM Hayato Kurod

Re: Change GUC hashtable to use simplehash?

2025-02-13 Thread John Naylor
Hi Anton, could you please test if the attached passes for you? This seems the simplest way. -- John Naylor Amazon Web Services diff --git a/src/include/common/hashfn_unstable.h b/src/include/common/hashfn_unstable.h index e07c0226c1..bb09f87abe 100644 --- a/src/include/common/hashfn_unstable.h ++

Re: DOCS - inactive_since field readability

2025-02-13 Thread Amit Kapila
On Fri, Feb 14, 2025 at 4:04 AM Peter Smith wrote: > > On Tue, Feb 11, 2025 at 10:10 PM Amit Kapila wrote: > > > ... > > The change in 0001 looks odd after seeing it in HTML format. We should > > either add one empty line between two paragraphs otherwise it doesn't > > appear good. Did you see mu

Re: Parallel heap vacuum

2025-02-13 Thread John Naylor
On Thu, Feb 13, 2025 at 5:37 AM Masahiko Sawada wrote: > > During eager vacuum scan, we reset the eager_scan_remaining_fails > counter when we start to scan the new region. So if we want to make > parallel heap vacuum behaves exactly the same way as the > single-progress vacuum in terms of the eag

Out-of-cycle release on 2025-02-20

2025-02-13 Thread Jonathan S. Katz
Hi, CVE-2025-1094[1] introduced a regression that was reported fairly shortly after the release[2]. Based on the nature of the report and the fact it's in libpq, the release team was unsure of what the overall prevalence of the issue given its client-facing, and decided to have an out-of-cycl

Re: Confine vacuum skip logic to lazy_scan_skip

2025-02-13 Thread Melanie Plageman
On Thu, Feb 13, 2025 at 8:30 PM Masahiko Sawada wrote: > > On Thu, Feb 13, 2025 at 4:55 PM Melanie Plageman > wrote: > > > > We don't want to hang onto that pin for a > > long time. But I can't move them to the bottom of the loop after we > > release the buffer because some of the code paths don'

Re: Confine vacuum skip logic to lazy_scan_skip

2025-02-13 Thread Masahiko Sawada
On Thu, Feb 13, 2025 at 4:55 PM Melanie Plageman wrote: > > Thanks for your review! I've made the changes in attached v18. > > I do want to know what you think we should do about what you brought > up about lazy_check_wraparound_failsafe() -- given my reply (below). > > On Thu, Feb 13, 2025 at 6:0

Re: DOCS - Question about pg_sequences.last_value notes

2025-02-13 Thread Peter Smith
On Fri, Feb 14, 2025 at 8:35 AM Nathan Bossart wrote: > > On Thu, Feb 13, 2025 at 03:59:45PM +1100, Peter Smith wrote: > > I noticed the pg_sequences system-view DOCS page [1] has a note about > > the 'last_value' field. But the note is not within the row for that > > field. Indeed, it is not even

Re: DROP CONSTRAINT, printing a notice and/or skipping when no action is taken

2025-02-13 Thread Andrew Atkinson
Oof, the subject line was meant to be DROP DEFAULT, not constraint On Thu, Feb 13, 2025 at 11:13 AM Andrew Atkinson wrote: > Hello. I noticed a small opportunity for a possible enhancement to DROP > DEFAULT, and wanted to share the idea. Apologies if this idea was suggested > before, I tried a

Re: Confine vacuum skip logic to lazy_scan_skip

2025-02-13 Thread Melanie Plageman
On Thu, Feb 13, 2025 at 6:52 PM Thomas Munro wrote: > > I've been poking, reading, and trying out these patches. They look good to > me. Thanks for the review. > Tiny nit, maybe this comment could say something less obvious, cf the > similar comment near the other stream: > > + /* Set up

Re: Confine vacuum skip logic to lazy_scan_skip

2025-02-13 Thread Melanie Plageman
Thanks for your review! I've made the changes in attached v18. I do want to know what you think we should do about what you brought up about lazy_check_wraparound_failsafe() -- given my reply (below). On Thu, Feb 13, 2025 at 6:08 PM Masahiko Sawada wrote: > > Sorry for the late chiming in. I've

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

2025-02-13 Thread Michael Paquier
On Thu, Feb 13, 2025 at 09:53:52AM -0800, Jacob Champion wrote: > I guess I'm going to zero in on your definition of "may know nothing > about". If that is true, something is very wrong IMO. > > My understanding of the backend code was that port->peer is only set > after OpenSSL has verified that

Re: Confine vacuum skip logic to lazy_scan_skip

2025-02-13 Thread Thomas Munro
On Fri, Feb 14, 2025 at 12:11 PM Melanie Plageman wrote: > I've done some clean-up including incorporating a few off-list pieces > of minor feedback from Andres. I've been poking, reading, and trying out these patches. They look good to me. Tiny nit, maybe this comment could say something less

Re: Is pgAdmin the only front-end to PostgreSQL debugger ? And is "a working pl/pgsql debugger" something core should care to maintain ?

2025-02-13 Thread Hannu Krosing
On Thu, Feb 13, 2025 at 8:10 PM Pavel Stehule wrote: > > Hi > > čt 13. 2. 2025 v 18:00 odesílatel Hannu Krosing napsal: >> >> Hallo PostgreSQL Hackers, >> >> >> We recently discovered an error where pgAdmin fails when stepping into >> nested function calls ( >> https://github.com/pgadmin-org/pgad

Re: dblink: Add SCRAM pass-through authentication

2025-02-13 Thread Jacob Champion
On Wed, Feb 12, 2025 at 11:54 AM Matheus Alcantara wrote: > Currently dblink_connstr_check and dblink_security_check only check if the > password is present on connection options, in case of not superuser. They also check for GSS delegation. I think SCRAM passthrough should ideally be considered

Re: Assignment before assert

2025-02-13 Thread Daniel Gustafsson
> On 13 Feb 2025, at 18:08, Dmitry Koval wrote: > > Hi! > Function EvalPlanQualFetchRowMark contains an assignment > > ExecRowMark *erm = earm->rowmark; > > before assert > > Assert(earm != NULL); > > Maybe these lines need to be swapped? That does admittedly look a bit odd, that assertion c

Re: Confine vacuum skip logic to lazy_scan_skip

2025-02-13 Thread Melanie Plageman
On Tue, Feb 11, 2025 at 8:10 PM Melanie Plageman wrote: > > On Thu, Feb 6, 2025 at 1:06 PM Melanie Plageman > wrote: > > > > On Wed, Feb 5, 2025 at 5:26 PM Melanie Plageman > > wrote: > > > > > > Yes, looking at these results, I also feel good about it. I've updated > > > the commit metadata in

Re: pg_stat_statements and "IN" conditions

2025-02-13 Thread Sami Imseih
Hi, Thanks for the updated patch! I spent some time looking at v24 today, and I have some findings/comments. 1/ Constants passed as parameters to a prepared statement will not be handled as expected. I did not not test explicit PREPARE/EXECUTE statement, but I assume it will have the same issue.

Re: Confine vacuum skip logic to lazy_scan_skip

2025-02-13 Thread Masahiko Sawada
On Tue, Feb 11, 2025 at 5:10 PM Melanie Plageman wrote: > > On Thu, Feb 6, 2025 at 1:06 PM Melanie Plageman > wrote: > > > > On Wed, Feb 5, 2025 at 5:26 PM Melanie Plageman > > wrote: > > > > > > Yes, looking at these results, I also feel good about it. I've updated > > > the commit metadata in

Re: describe special values in GUC descriptions more consistently

2025-02-13 Thread Nathan Bossart
On Thu, Feb 13, 2025 at 03:50:08PM -0700, David G. Johnston wrote: > Even if the diff has logic to it - only remove stuff from the first line, > only add stuff to the second, it isn't a big enough gain to offset leaving > the source ugly, IMHO. Okay, I took your suggestions in v7. -- nathan >Fro

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-02-13 Thread Daniel Gustafsson
> On 13 Feb 2025, at 22:23, Jacob Champion > wrote: > > On Wed, Feb 12, 2025 at 6:55 AM Peter Eisentraut wrote: >> This just depends on how people have built their libcurl, right? >> >> Do we have any information whether the async-dns-free build is a common >> configuration? > > I don't think

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Thomas Munro
On Fri, Feb 14, 2025 at 11:50 AM Thomas Munro wrote: > Yeah I guess you could in theory also stream pointers to individual > uncompressed result objects allocated with palloc(), that is point a > point in the per-buffer-data and make the consumer free it, but that > has other problems (less locali

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Thomas Munro
On Fri, Feb 14, 2025 at 5:52 AM Melanie Plageman wrote: > On Thu, Feb 13, 2025 at 11:28 AM Tomas Vondra wrote: > > On 2/13/25 17:01, Melanie Plageman wrote: > > I know it's not changing how much memory we allocate (compared to > > master). I haven't thought about the GinScanEntry - yes, flexible

Re: describe special values in GUC descriptions more consistently

2025-02-13 Thread David G. Johnston
On Thu, Feb 13, 2025 at 3:18 PM Nathan Bossart wrote: > On Wed, Feb 12, 2025 at 04:10:53PM -0700, David G. Johnston wrote: > > I presume it doesn't affect the actual output which just concatenates the > > fragments together but the source placement probably should be made > > consistent; the line

Re: Remove a unnecessary argument from execute_extension_script()

2025-02-13 Thread Nathan Bossart
Committed. -- nathan

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Nathan Bossart
On Thu, Feb 13, 2025 at 02:00:09PM -0500, Tom Lane wrote: > Justin Pryzby writes: >> The fprintf suggests that since 5dc1e42b4 PQescapeIdentifier ignores its len. > > Ugh, yes. Need something like the attached. Your patch looks right to me. -- nathan

Re: DOCS - inactive_since field readability

2025-02-13 Thread Peter Smith
On Tue, Feb 11, 2025 at 10:10 PM Amit Kapila wrote: > ... > The change in 0001 looks odd after seeing it in HTML format. We should > either add one empty line between two paragraphs otherwise it doesn't > appear good. Did you see multi-paragraphs in any other column > definitions? > > For the 0002

Re: Remove a unnecessary argument from execute_extension_script()

2025-02-13 Thread Nathan Bossart
On Thu, Feb 13, 2025 at 03:18:51PM -0300, Fabrízio de Royes Mello wrote: > On Thu, Feb 13, 2025 at 1:02 PM Yugo Nagata wrote: >> The attached patch is to remove a unnecessary argument "schemaOid" >> from the static function execute_extension_script(). It might have >> been intended to be used some

Re: describe special values in GUC descriptions more consistently

2025-02-13 Thread Nathan Bossart
On Wed, Feb 12, 2025 at 04:10:53PM -0700, David G. Johnston wrote: > I presume it doesn't affect the actual output which just concatenates the > fragments together but the source placement probably should be made > consistent; the line containing the initial default value specification > begins its

Re: Simplify the logic a bit (src/bin/scripts/reindexdb.c)

2025-02-13 Thread Álvaro Herrera
On 2025-Feb-13, Ranier Vilela wrote: > Hi. > > Coverity complained about possible dereference null pointer > in *reindex_one_database* function. > That's not really true. > But the logic is unnecessarily complicated. Hmm, this code looks quite suspect, but I wonder if instead of (what looks more

Re: DOCS - Question about pg_sequences.last_value notes

2025-02-13 Thread Nathan Bossart
On Thu, Feb 13, 2025 at 03:59:45PM +1100, Peter Smith wrote: > I noticed the pg_sequences system-view DOCS page [1] has a note about > the 'last_value' field. But the note is not within the row for that > field. Indeed, it is not even within the table. > > Is it deliberate? Apparently, this change

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-02-13 Thread Jacob Champion
On Wed, Feb 12, 2025 at 6:55 AM Peter Eisentraut wrote: > This just depends on how people have built their libcurl, right? > > Do we have any information whether the async-dns-free build is a common > configuration? I don't think the annual Curl survey covers that, unfortunately. On Wed, Feb 12,

Re: Get rid of WALBufMappingLock

2025-02-13 Thread Alexander Korotkov
Hi, Pavel! On Thu, Feb 13, 2025 at 6:39 PM Pavel Borisov wrote: > On Thu, 13 Feb 2025 at 14:08, Alexander Korotkov wrote: > > > > On Thu, Feb 13, 2025 at 11:45 AM Yura Sokolov > > wrote: > > > 13.02.2025 12:34, Alexander Korotkov пишет: > > > > On Wed, Feb 12, 2025 at 8:16 PM Yura Sokolov >

Re: explain analyze rows=%.0f

2025-02-13 Thread Robert Haas
On Thu, Feb 13, 2025 at 4:05 AM Ilia Evdokimov wrote: > 1. Documentation > (v9-0001-Clarify-display-of-rows-as-decimal-fractions-DOC.patch) > > One thing that bothers me is that the documentation explains how to compute > total time, but it does not clarify how to compute total rows. Maybe this

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Andres Freund
Hi, Thomas, there's a bit relevant to you at the bottom. Melanie chatted with me about the performance regressions in Tomas' benchmarks of the patch. I experimented some and I think I found a few interesting pieces. I looked solely at cyclic, wm=4096, matches=8, eic=16 as I wanted to narrow do

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Ranier Vilela
Em qui., 13 de fev. de 2025 às 16:05, Tom Lane escreveu: > Ranier Vilela writes: > > Interesting, Coverity has some new reports regarding PQescapeIdentifier. > > > CID 1591290: (#1 of 1): Out-of-bounds access (OVERRUN) > > 2. alloc_strlen: Allocating insufficient memory for the terminating null

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Tom Lane
Ranier Vilela writes: > Interesting, Coverity has some new reports regarding PQescapeIdentifier. > CID 1591290: (#1 of 1): Out-of-bounds access (OVERRUN) > 2. alloc_strlen: Allocating insufficient memory for the terminating null of > the string. [Note: The source code implementation of the functi

Re: Is pgAdmin the only front-end to PostgreSQL debugger ? And is "a working pl/pgsql debugger" something core should care to maintain ?

2025-02-13 Thread Pavel Stehule
Hi čt 13. 2. 2025 v 18:00 odesílatel Hannu Krosing napsal: > Hallo PostgreSQL Hackers, > > > We recently discovered an error where pgAdmin fails when stepping into > nested function calls ( > https://github.com/pgadmin-org/pgadmin4/issues/8443 ). > > So while waiting for this to be fixed I would

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Tom Lane
Justin Pryzby writes: > The fprintf suggests that since 5dc1e42b4 PQescapeIdentifier ignores its len. Ugh, yes. Need something like the attached. FTR, 5dc1e42b4 et al were quite subtle patches done under extreme time pressure. I wonder if they have any other issues. More eyes on those patches

Re: Patch: Log parameter types in detailed query logging

2025-02-13 Thread Степан
On Fri, Feb 14, 2025 at 1:03 AM Tom Lane wrote: > =?UTF-8?B?0KHRgtC10L/QsNC9?= writes: > > This patch adds the ability to log the types of parameters used in > queries > > when detailed query logging is enabled. > > If there's a patch in what you sent, I'm not seeing it. Looks like a > webpage

Re: Patch: Log parameter types in detailed query logging

2025-02-13 Thread Tom Lane
=?UTF-8?B?0KHRgtC10L/QsNC9?= writes: > This patch adds the ability to log the types of parameters used in queries > when detailed query logging is enabled. If there's a patch in what you sent, I'm not seeing it. Looks like a webpage dump or something. However, I suppose that it must add some ca

Re: Remove a unnecessary argument from execute_extension_script()

2025-02-13 Thread Fabrízio de Royes Mello
On Thu, Feb 13, 2025 at 1:02 PM Yugo Nagata wrote: > > Hi, > > The attached patch is to remove a unnecessary argument "schemaOid" > from the static function execute_extension_script(). It might have > been intended to be used some way initially, but actually this is > not used since schemaName is

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

2025-02-13 Thread Jacob Champion
On Tue, Feb 11, 2025 at 11:23 PM Michael Paquier wrote: > +be_tls_get_peer_subject_name(MyProcPort, lsslstatus.ssl_client_dn, > NAMEDATALEN); > +be_tls_get_peer_serial(MyProcPort, lsslstatus.ssl_client_serial, > NAMEDATALEN); > +be_tls_get_peer_issuer_name(MyProcPort, lss

Patch: Log parameter types in detailed query logging

2025-02-13 Thread Степан
Dear PostgreSQL Hackers, This patch adds the ability to log the types of parameters used in queries when detailed query logging is enabled. Currently, detailed logging only shows the parameter values, which often requires further investigation or asking the client to determine the data types. This

BackgroundPsql swallowing errors on windows

2025-02-13 Thread Andres Freund
Hi, One of the remaining tasks for AIO was to convert the tests to be proper tap tests. I did that and was thanked by the tests fairly randomly failing on windows. Which test fails changes from run to run. The symptom is that BackgroundPsql->query() sometimes would simply swallow errors that wer

DROP CONSTRAINT, printing a notice and/or skipping when no action is taken

2025-02-13 Thread Andrew Atkinson
Hello. I noticed a small opportunity for a possible enhancement to DROP DEFAULT, and wanted to share the idea. Apologies if this idea was suggested before, I tried a basic search for pgsql-hackers similar things but didn’t find a hit. I noticed when running an ALTER TABLE with DROP DEFAULT, wheth

Re: Proposal - Allow extensions to set a Plan Identifier

2025-02-13 Thread Sami Imseih
Thanks for the feedback! > I think that makes sense and then the idea would be later on to move to > something > like 5fd9dfa5f50, but for the "planId": is my understanding correct? correct. This is adding infrastructure to eventually have an in-core planId; but in the meanwhile give extensions

Assignment before assert

2025-02-13 Thread Dmitry Koval
Hi! Function EvalPlanQualFetchRowMark contains an assignment ExecRowMark *erm = earm->rowmark; before assert Assert(earm != NULL); Maybe these lines need to be swapped? -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com diff --git a/src/backend/e

pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Justin Pryzby
I found errors in our sql log after upgrading to 17.3. error_severity | ERROR message| schema "rptcache.44e3955c33bb79f55750897da0c5ab1fa2004af1_20250214" does not exist query | copy "rptcache.44e3955c33bb79f55750897da0c5ab1fa2004af1_20250214"."44e3955c33bb79f55750897da0c5ab1fa2

Is pgAdmin the only front-end to PostgreSQL debugger ? And is "a working pl/pgsql debugger" something core should care to maintain ?

2025-02-13 Thread Hannu Krosing
Hallo PostgreSQL Hackers, We recently discovered an error where pgAdmin fails when stepping into nested function calls ( https://github.com/pgadmin-org/pgadmin4/issues/8443 ). So while waiting for this to be fixed I would want to know if there are other debugger front-ends that could be used to

Re: pg17.3 PQescapeIdentifier() ignores len

2025-02-13 Thread Ranier Vilela
Em qui., 13 de fev. de 2025 às 13:51, Justin Pryzby escreveu: > I found errors in our sql log after upgrading to 17.3. > > error_severity | ERROR > message| schema > "rptcache.44e3955c33bb79f55750897da0c5ab1fa2004af1_20250214" does not exist > query | copy > "rptcache.44e3955c33b

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Melanie Plageman
On Thu, Feb 13, 2025 at 11:28 AM Tomas Vondra wrote: > > On 2/13/25 17:01, Melanie Plageman wrote: > > On Thu, Feb 13, 2025 at 10:46 AM Tomas Vondra wrote: > >> > >> I reviewed v29 today, and I think it's pretty much ready to go. > >> > >> The one part where I don't quite get is 0001, which repla

Re: pg_stat_statements and "IN" conditions

2025-02-13 Thread Dmitry Dolgov
> On Thu, Feb 13, 2025 at 01:47:01PM GMT, Álvaro Herrera wrote: > Also, how wed are you to > "query_id_merge_values" as a name? It's not in any way obvious that > this is about values in arrays. How about query_id_squash_arrays? Or > are you thinking in having values in other types of structures

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

2025-02-13 Thread Sami Imseih
> I don't understand why we would change any naming here at all. I think > you should be looking at a much broader consensus and plus-ones that a > renaming is needed. -1 from me. The reason for the change is because "query jumble" will no longer make sense if the jumble code can now be used for

Remove a unnecessary argument from execute_extension_script()

2025-02-13 Thread Yugo Nagata
Hi, The attached patch is to remove a unnecessary argument "schemaOid" from the static function execute_extension_script(). It might have been intended to be used some way initially, but actually this is not used since schemaName is sufficient. Regards, Yugo Nagata -- Yugo Nagata diff --git a/

Re: Get rid of WALBufMappingLock

2025-02-13 Thread Pavel Borisov
Hi, Yura and Alexander! On Thu, 13 Feb 2025 at 14:08, Alexander Korotkov wrote: > > On Thu, Feb 13, 2025 at 11:45 AM Yura Sokolov > wrote: > > 13.02.2025 12:34, Alexander Korotkov пишет: > > > On Wed, Feb 12, 2025 at 8:16 PM Yura Sokolov > > > wrote: > > >> 08.02.2025 13:07, Alexander Korotko

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Tomas Vondra
On 2/13/25 17:01, Melanie Plageman wrote: > On Thu, Feb 13, 2025 at 10:46 AM Tomas Vondra wrote: >> >> I reviewed v29 today, and I think it's pretty much ready to go. >> >> The one part where I don't quite get is 0001, which replaces a >> FLEXIBLE_ARRAY_MEMBER array with a fixed-length array. It's

Re: [Feature Request] INSERT FROZEN to Optimize Large Cold Data Imports and Migrations

2025-02-13 Thread Greg Sabino Mullane
On Thu, Feb 13, 2025 at 9:45 AM Sébastien wrote: > This issue is particularly critical during database *migrations* or *version > upgrades*, where a full data reload is often necessary. Each time a major > PostgreSQL upgrade occurs, users must reimport large datasets, leading to > the same proble

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Melanie Plageman
On Thu, Feb 13, 2025 at 10:46 AM Tomas Vondra wrote: > > I reviewed v29 today, and I think it's pretty much ready to go. > > The one part where I don't quite get is 0001, which replaces a > FLEXIBLE_ARRAY_MEMBER array with a fixed-length array. It's not wrong, > but I don't quite see the benefits

Re: Draft for basic NUMA observability

2025-02-13 Thread Bertrand Drouvot
Hi, On Fri, Feb 07, 2025 at 03:32:43PM +0100, Jakub Wartak wrote: > As I have promised to Andres on the Discord hacking server some time > ago, I'm attaching the very brief (and potentially way too rushed) > draft of the first step into NUMA observability on PostgreSQL that was > based on his pres

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Tomas Vondra
On 2/10/25 23:31, Melanie Plageman wrote: > On Mon, Feb 10, 2025 at 4:22 PM Melanie Plageman > wrote: >> >> I don't really know what to do about this. The behavior of master >> parallel bitmap heap scan can be emulated with the patch by increasing >> effective_io_concurrency. But, IIRC we didn't w

Re: pg_attribute_noreturn(), MSVC, C11

2025-02-13 Thread Peter Eisentraut
On 22.01.25 19:16, Peter Eisentraut wrote: On 06.01.25 15:52, Peter Eisentraut wrote: On 03.01.25 21:51, Dagfinn Ilmari Mannsåker wrote: Peter Eisentraut writes: I suggest we define pg_noreturn as 1. If C11 is supported, then _Noreturn, else 2. If GCC-compatible, then __attribute__((noretur

Re: [Feature Request] INSERT FROZEN to Optimize Large Cold Data Imports and Migrations

2025-02-13 Thread Tom Lane
=?UTF-8?Q?S=C3=A9bastien?= writes: > Implementation details: >- A new INSERT FROZEN option could be introduced, similar to COPY FREEZE, >allowing direct insertion of tuples in a frozen state. >- This would likely require changes in heap storage logic to ensure >tuples are written

Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options

2025-02-13 Thread Oliver Ford
On Mon, Feb 3, 2025 at 11:46 AM Tatsuo Ishii wrote: > > > I've looked at it again and I think the code is correct, but I > > miswrote that the array needs to be sorted. The above query returns: > > x | y | nth_value > > ---+---+--- > > 1 | 1 | 2 > > 2 | 2 | 1 > > 3 |

[Feature Request] INSERT FROZEN to Optimize Large Cold Data Imports and Migrations

2025-02-13 Thread Sébastien
One-line Summary: Introduce an INSERT FROZEN feature to bypass vacuum processing for large-scale cold data imports, reducing the impact on system performance post-import. For large imports, migrations and major version upgrades. Business Use-case: When importing massive datasets (e.g., 6-10TB) in

Fwd: [Feature Request] Per-Database Transaction Logs for Enhanced Isolation and New Capabilities

2025-02-13 Thread Sébastien
Introduce per-database transaction logs (WAL) and transaction ID spaces to improve database isolation, enable hot-mounting/unmounting, selective replication, and open new possibilities in PostgreSQL. Business Use-case: With modern SSDs offering high throughput and low latency, maintaining a single

Re: Restrict publishing of partitioned table with a foreign table as partition

2025-02-13 Thread vignesh C
On Thu, 13 Feb 2025 at 15:50, Shlok Kyal wrote: > > > I have fixed the issue. Attached the updated v6 patch. There is another concurrency issue: In case of create publication for all tables with publish_via_partition_root we will call check_foreign_tables: @@ -876,6 +876,10 @@ CreatePublication(P

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Melanie Plageman
On Thu, Feb 13, 2025 at 7:08 AM Tomas Vondra wrote: > > > > On 2/13/25 01:40, Melanie Plageman wrote: > > On Sun, Feb 9, 2025 at 9:27 AM Tomas Vondra wrote: > >> > >> For the nvme RAID (device: raid-nvme), it's looks almost exactly the > >> same, except that with parallel query (page 27) there's

Simplify the logic a bit (src/bin/scripts/reindexdb.c)

2025-02-13 Thread Ranier Vilela
Hi. Coverity complained about possible dereference null pointer in *reindex_one_database* function. That's not really true. But the logic is unnecessarily complicated. Let's simplify it to humans and machines. patch attached. Best regards, Ranier Vilela simplifies-reindex-one-database-reindex

Re: Address the bug in 041_checkpoint_at_promote.pl

2025-02-13 Thread Nitin Jadhav
> > Anyway, how did you find that? Did you see a pattern when running the > > test on a very slow machine or just from a read? That was a good > > catch. > +1. I was wondering the same. I was writing a TAP test to reproduce a crash recovery issue and used parts of 041_checkpoint_at_promote.pl. U

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

2025-02-13 Thread Fujii Masao
On 2025/02/06 8:57, Ryo Kanbayashi wrote: On Wed, Feb 5, 2025 at 9:31 PM Ryo Kanbayashi wrote: Hi hackers, When I wrote patch of ecpg command notice bug, I recognized needs of regression tests for ecpg command notices and I say that I write the tests. Thanks for working on this! I expl

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-13 Thread Aleksander Alekseev
Hi Alvaro, > > Since BootStrapSlruPage() is the only caller of ZeroPage() it seems to > > me that it merely wastes space in SlruCtlData. On top of that I'm not > > 100% sure if all the supported platforms have C99 compilers with > > designated initializers support. > > They do -- we use them quite

Re: SQL:2011 application time

2025-02-13 Thread Peter Eisentraut
On 23.01.25 16:40, Peter Eisentraut wrote: I think my interpretation of what RESTRICT should do is different. The clause "Execution of referential actions" in the SQL standard only talks about referenced and referencing columns, not periods.  So this would mean you can change the period column

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-13 Thread Álvaro Herrera
On 2025-Feb-13, Aleksander Alekseev wrote: > Since BootStrapSlruPage() is the only caller of ZeroPage() it seems to > me that it merely wastes space in SlruCtlData. On top of that I'm not > 100% sure if all the supported platforms have C99 compilers with > designated initializers support. They do

Re: Virtual generated columns

2025-02-13 Thread jian he
On Tue, Feb 11, 2025 at 10:34 AM Richard Guo wrote: > > On Mon, Feb 10, 2025 at 1:16 PM Zhang Mingli wrote: > > I believe virtual columns should behave like stored columns, except they > > don't actually use storage. > > Virtual columns are computed when the table is read, and they should adhere

Re: Adding NetBSD and OpenBSD to Postgres CI

2025-02-13 Thread Nazir Bilal Yavuz
Hi, On Wed, 12 Feb 2025 at 17:49, Andres Freund wrote: > I finally pushed this. The meson fix backpatched to 16. > > I did some very minor polishing, reordering the OS lists to stay alphabetical, > instead of adding netbsd/openbsd somewhere to the front of lists. Thanks! > Obviously not your fa

Re: Using Expanded Objects other than Arrays from plpgsql

2025-02-13 Thread Pavel Borisov
On Tue, 11 Feb 2025 at 21:50, Tom Lane wrote: > > Andrey Borodin writes: > > On 7 Feb 2025, at 02:05, Tom Lane wrote: > >> Do you have any further comments on this patch? > > > No, all steps of the patch set look good to me. > > Pushed then. Thanks for reviewing! Thanks to Michel and everyone w

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Tomas Vondra
On 2/13/25 05:15, Thomas Munro wrote: > On Thu, Feb 13, 2025 at 1:40 PM Melanie Plageman > wrote: >> On Sun, Feb 9, 2025 at 9:27 AM Tomas Vondra wrote: >>> For the nvme RAID (device: raid-nvme), it's looks almost exactly the >>> same, except that with parallel query (page 27) there's a clear area

Re: pg_stat_statements and "IN" conditions

2025-02-13 Thread Álvaro Herrera
On 2025-Feb-13, Dmitry Dolgov wrote: > Here is how it looks like (posting only the first patch, since we > concentrate on it). This version handles just a little more to cover > simpe cases like the implicit convertion above. The GUC is also moved > out from pgss and renamed to query_id_merge_valu

Re: BitmapHeapScan streaming read user and prelim refactoring

2025-02-13 Thread Tomas Vondra
On 2/13/25 01:40, Melanie Plageman wrote: > On Sun, Feb 9, 2025 at 9:27 AM Tomas Vondra wrote: >> >> For the nvme RAID (device: raid-nvme), it's looks almost exactly the >> same, except that with parallel query (page 27) there's a clear area of >> regression with eic=1 (look for "column" of red

Re: NOT ENFORCED constraint feature

2025-02-13 Thread Álvaro Herrera
On 2025-Feb-13, Ashutosh Bapat wrote: > > So considering that, I think a three-state system makes more sense. > > Something like: > > > > 1) NOT ENFORCED -- no data is checked > > 2) NOT VALID -- existing data is unchecked, new data is checked > > 3) ENFORCED -- all data is checked > > > > Transit

Re: Adding a '--clean-publisher-objects' option to 'pg_createsubscriber' utility.

2025-02-13 Thread Shlok Kyal
On Thu, 13 Feb 2025 at 15:20, Shubham Khanna wrote: > > On Tue, Feb 11, 2025 at 9:56 PM Shlok Kyal wrote: > > > > On Tue, 11 Feb 2025 at 09:51, Shubham Khanna > > wrote: > > > > > > On Fri, Feb 7, 2025 at 7:46 AM Hayato Kuroda (Fujitsu) > > > wrote: > > > > > > > > Dear Shubham, > > > > > > > >

Re: Elimination of the repetitive code at the SLRU bootstrap functions.

2025-02-13 Thread Aleksander Alekseev
Hi Evgeny, > The functions, bootstrapping SLRU pages, such as BootStrapMultiXact, > BootStrapCLOG, ActivateCommitTs, multixact_redo and others, have a lot > of repetitive code. > > A new proposed function BootStrapSlruPage moves a duplicating code into > the single place. Additionally, a new membe

Re: Improve CRC32C performance on SSE4.2

2025-02-13 Thread John Naylor
On Thu, Feb 13, 2025 at 4:18 AM Nathan Bossart wrote: > > I think the idea behind USE_SSE42_CRC32C is to avoid the function pointer > overhead if possible. I looked at switching to always using runtime checks > for this stuff, and we concluded that we'd better not [0]. > > [0] https://postgr.es/m

Re: Windows meson build

2025-02-13 Thread Vladlen Popolitov
Vladlen Popolitov писал(а) 2025-02-13 17:58: The following review has been posted through the commitfest application: make installcheck-world: tested, failed Implements feature: tested, failed Spec compliant: tested, failed Documentation:tested, failed Hi! Previou

Re: Non-text mode for pg_dumpall

2025-02-13 Thread Mahendra Singh Thalor
Thanks Jian. On Wed, 12 Feb 2025 at 12:45, jian he wrote: > > On Wed, Feb 12, 2025 at 1:17 AM Mahendra Singh Thalor > wrote: > > > > > > > > There are some tests per https://commitfest.postgresql.org/52/5495, I > > > will check it later. > > hi. > the cfbot failure is related to function _tocEnt

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

2025-02-13 Thread Alvaro Herrera
On 2025-Feb-12, Sami Imseih wrote: > Greg S. Mullane wrote: > > > I agree fingerprint is the right final word. But "jumble" conveys > > the *process* better than "fingerprinting". I view it as jumbling > > produces an object that can be fingerprinted. > > hmm, "jumble" describes something that i

Re: Small memory fixes for pg_createsubcriber

2025-02-13 Thread Ranier Vilela
Em qua., 12 de fev. de 2025 às 18:17, Tom Lane escreveu: > Ranier Vilela writes: > > Coverity has some reports about pg_createsubcriber. > > > CID 1591322: (#1 of 1): Resource leak (RESOURCE_LEAK) > > 10. leaked_storage: Variable dbname going out of scope leaks the storage > it > > points to. >

  1   2   >