Make prep_status() message translatable

2025-04-06 Thread Kyotaro Horiguchi
Hello, The recent commit 173c97812ff made the following change: - prep_status("Adding \".old\" suffix to old global/pg_control"); + prep_status("Adding \".old\" suffix to old " XLOG_CONTROL_FILE); This change results in a message that is untranslatable, at least into Japanese. In ad

Re: Enhancing Memory Context Statistics Reporting

2025-04-06 Thread Rahila Syed
Hi Daniel, > > After a bit more polish I landed with the attached, which I most likely > will go > ahead with after another round in CI. > Thank you for refining the code. The changes look good to me. Regression tests ran smoothly in parallel with the memory monitoring function, pgbench results

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

2025-04-06 Thread Sutou Kouhei
Hi, In "Re: Make COPY format extendable: Extract COPY TO format implementations" on Sun, 6 Apr 2025 19:29:46 +0800, jian he wrote: > I did a brief review of v39-0001 and v39-0002. > > text: > COPY_FILE > COPY_FRONTEND > still appear on comments in copyfrom_internal.h and copyto.c, > Shoul

Re: Correct mismatched verb in a message

2025-04-06 Thread Michael Paquier
On Mon, Apr 07, 2025 at 03:13:59PM +0900, Kyotaro Horiguchi wrote: > The recent commit 1495eff7bdb introduced a message using a plural verb > for a singular subject. > > > pg_log_info("number of restored databases are %d", num_db_restore); > ~~~ >

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

2025-04-06 Thread Michael Paquier
On Fri, Apr 04, 2025 at 09:33:46PM +0530, vignesh C wrote: > The new test added currently passes even without the patch. It would > be ideal to have a test that fails without the patch and passes once > the patch is applied. Right. The subscription test and logical WAL senders passes without the

Unquoted file name in an error message

2025-04-06 Thread Kyotaro Horiguchi
Hello. While translating error messages related to pg_dumpall (1495eff7bdb), I noticed that one message lacks double quotes around the file name: could not open map file: %s Since this placeholder appears standalone and not embedded in a sentence, I initially thought it might fall outside the

Re: Introduce new multi insert Table AM and improve performance of various SQL commands with it for Heap AM

2025-04-06 Thread Daniil Davydov
Hi, On Sun, Apr 6, 2025 at 8:55 PM Jingtang Zhang wrote: > > It was quite a while since I last looked at the patch. I've tested it again, > and still get regression on patched version where a table has many columns. > And it is totally CPU-bounded on tts_virtual_copyslot. > > Unpatched version: >

Re: Changing shared_buffers without restart

2025-04-06 Thread Ashutosh Bapat
On Fri, Feb 28, 2025 at 5:31 PM Ashutosh Bapat wrote: > > I think we should add a way to monitor the progress of resizing; at > least whether resizing is complete and whether the new GUC value is in > effect. > I further tested this approach by tracing the barrier synchronization using the attach

RE: Fix 035_standby_logical_decoding.pl race conditions

2025-04-06 Thread Hayato Kuroda (Fujitsu)
Dear Bertrand, > I wonder if we could not keep this test and make the slot active for the > vacuum full case. Looking at drongo's failure in [1], there is no occurence > of "vacuum full" and that's probably linked to Andres's explanation in [2]: > > " > a VACUUM FULL on pg_class is > used, which

Correct mismatched verb in a message

2025-04-06 Thread Kyotaro Horiguchi
Hello. The recent commit 1495eff7bdb introduced a message using a plural verb for a singular subject. > pg_log_info("number of restored databases are %d", num_db_restore); ~~~ The attached patch fixes that issue. regards. -- Kyotaro Horiguch

Re: Parallel heap vacuum

2025-04-06 Thread Peter Smith
Hi Sawada-san. I was revisiting this thread after a long time. I found most of my previous review comments from v11-0001 were not yet addressed. I can't tell if they are deliberately left out, or if they are accidentally overlooked. Please see the details below. On Mon, Mar 10, 2025 at 3:05 PM Pe

Re: SQL Property Graph Queries (SQL/PGQ)

2025-04-06 Thread Ashutosh Bapat
On Sat, Apr 5, 2025 at 6:20 PM Junwang Zhao wrote: > > Hi Ashutosh and Peter, > > Since this PGQ feature won't be in PG 18, I'd like to raise a discussion of > the possibility of implementing the quantifier feature, which I think is a > quite useful feature in the graph database area. I agree tha

Re: [PATCH] Fix build on MINGW on ARM64

2025-04-06 Thread Tom Lane
Andrew Dunstan writes: > On 2025-04-01 Tu 11:15 AM, Andrew Dunstan wrote: >> On 2025-04-01 Tu 8:47 AM, vignesh C wrote: >>> There is an existing CF entry for this at [1]. If no one picks this >>> till the end of this CF, we can move it to next CF. >>> [1] - https://commitfest.postgresql.org/patch/

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

2025-04-06 Thread Sergey Tatarintsev
07.04.2025 03:27, Álvaro Herrera пишет: On 2025-Apr-01, Shlok Kyal wrote: I have modified the comment in create_publication.sgml and also added comment in the restrictions section of logical-replication.sgml. I have also added a more detailed explanation in comment of 'check_foreign_tables' I

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

2025-04-06 Thread Michael Paquier
On Thu, Apr 03, 2025 at 12:36:59AM +0900, Ryo Kanbayashi wrote: > I'll reflect your notice and suggestion to the patch current I'm > working on :) Thanks for that. And I have forgotten to add you as a reviewer of what has been committed as 2c7bd2ba507e. Sorry for that :/ -- Michael signature.a

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

2025-04-06 Thread Michael Paquier
On Mon, Mar 31, 2025 at 04:26:27PM -0500, Andrew Jackson wrote: > I am working on a feature adjacent to the connection service functionality > and noticed some issues with the tests introduced in this thread. Basically > they incorrectly invoke the append perl function by passing multiple > strings

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

2025-04-06 Thread Yuya Watari
Hello David, Thank you very much for updating the patches and clearly addressing these points. On Mon, Apr 7, 2025 at 8:04 AM David Rowley wrote: > > I used the attached .txt file to highlight the places where the > iterator returned the same member twice and saw only that > find_ec_member_match

Re: Removing unneeded self joins

2025-04-06 Thread Richard Guo
FWIW, I reported some issues with this commit in [1]. Any thoughts on how to fix them? [1] https://www.postgresql.org/message-id/flat/CAMbWs49PE3CvnV8vrQ0Dr%3DHqgZZmX0tdNbzVNJxqc8yg-8kDQQ%40mail.gmail.com Thanks Richard

Re: Modern SHA2- based password hashes for pgcrypto

2025-04-06 Thread Andres Freund
Hi, On 2025-04-05 19:22:58 +0200, Alvaro Herrera wrote: > I have pushed this now, hoping it won't explode. I have a WIP patch that adds gcc specific allocator attributes for palloc et al. Just rebased that. It warns on the new code as follows: [1489/1804 42 82%] Compiling C object contrib/pgcr

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

2025-04-06 Thread Richard Guo
On Sat, Apr 5, 2025 at 4:14 AM Robert Haas wrote: > On Tue, Apr 1, 2025 at 10:14 PM Richard Guo wrote: > > The attnotnull catalog information being discussed here is intended > > for use during constant folding (and possibly sublink pull-up), which > > occurs long before partition pruning. Am I

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Tom Lane
Chapman Flack writes: > On 04/06/25 20:01, Tom Lane wrote: >> Looking more closely at ProcedureCreate(), it makes a dependency >> if a transform *exists* for the argument or result type, whether >> a TRANSFORM clause is present or not. Surely this is completely >> bogus? We should be depending o

RE: pg_recvlogical cannot create slots with failover=true

2025-04-06 Thread Zhijie Hou (Fujitsu)
On Sat, Apr 5, 2025 at 1:45 AM Masahiko Sawada wrote: Hi, > Thank you for updating the patch! Pushed with small cosmetic changes. Thanks for pushing the feature ! I noticed one typo in the doc and here is a tiny patch to fix it. -The --two-phase and --falover options +The --two

Re: New criteria for autovacuum

2025-04-06 Thread Sami Imseih
> I wasn't thinking about adding a new VM setting functionality to index > only scan in particular. heapam_index_fetch_tuple() already calls > heap_page_prune_opt() which will do pruning under certain conditions. > I was thinking that we start updating the VM after pruning in the > on-access case t

Re: Use XLOG_CONTROL_FILE macro everywhere?

2025-04-06 Thread Anton A. Melnikov
On 07.04.2025 03:32, Fujii Masao wrote: I've pushed the patch. Thanks! Thanks! Have a nice day! -- Anton A. Melnikov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company

Re: rename pg_log_standby_snapshot

2025-04-06 Thread Sami Imseih
> > > I think this would all be a nice argument to have when introducing a new > > function. But I don't think it's a wart sufficiently big to justify > breaking > > compatibility. > > Yeah, I would side as well with the compatibility argument on this > one. I don't really agree with this. I thin

Re: Some read stream improvements

2025-04-06 Thread Thomas Munro
On Mon, Apr 7, 2025 at 1:29 PM Andres Freund wrote: > On 2025-04-03 14:43:40 +1300, Thomas Munro wrote: > > On Thu, Apr 3, 2025 at 11:17 AM Andres Freund wrote: > > > I don't actually see any reason for buffer_limit to be a 16bit quantity? > > > It's > > > just to clamp things down, right? > > >

Re: Some read stream improvements

2025-04-06 Thread Andres Freund
Hi, On 2025-04-03 14:43:40 +1300, Thomas Munro wrote: > On Thu, Apr 3, 2025 at 11:17 AM Andres Freund wrote: > > I don't actually see any reason for buffer_limit to be a 16bit quantity? > > It's > > just to clamp things down, right? > > Ugh. It might be worth just flipping this whole thing ove

Re: Logging which local address was connected to in log_line_prefix

2025-04-06 Thread Greg Sabino Mullane
On Sun, Apr 6, 2025 at 6:01 PM Tom Lane wrote: > 1. Ignore the inconsistency, commit 0004 as-is. > > 2. Change the output to be an empty string in background processes. >This is consistent, but it goes against our upthread feeling that > "[none]" would avoid confusion. > I lean for #1. Yes,

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Tom Lane
Chapman Flack writes: > Only slightly tangentially: what things count as "objects that depend > on the transform" for purposes of DROP TRANSFORM ... CASCADE / RESTRICT ? > I just now dropped (in 17.4) a transform named in an existing routine's > declaration, with nary a peep. Hmm, really? Proced

Re: Possibly hard-to-read message

2025-04-06 Thread Daniel Gustafsson
> On 7 Apr 2025, at 02:43, David G. Johnston wrote: > How about: > > + "if set to a number, overrides the default two second \\watch > interval\n" > > I do like the consistency of "if set" even though most of the others are > booleans. Ah yes, number is better. I'll go ahead with that in

Re: per backend WAL statistics

2025-04-06 Thread Michael Paquier
On Mon, Mar 31, 2025 at 07:42:19AM +, Bertrand Drouvot wrote: > I think we can simply move the pgstat_fetch_stat_backend() call at the end > of pgstat_fetch_stat_backend_by_pid(), like in the attached. With this in > place > the issue is fixed on my side. > > Thoughts? Confirmed. I agree th

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Chapman Flack
On 04/06/25 20:01, Tom Lane wrote: > Looking more closely at ProcedureCreate(), it makes a dependency > if a transform *exists* for the argument or result type, whether > a TRANSFORM clause is present or not. Surely this is completely > bogus? We should be depending on the OIDs mentioned in protr

Re: Possibly hard-to-read message

2025-04-06 Thread David G. Johnston
On Sun, Apr 6, 2025 at 2:52 PM Daniel Gustafsson wrote: > > Looking at the other variables they tend to use "if set, then" so we should > probably stick to that for this as well? Something like the below perhaps? > > HELP0(" WATCH_INTERVAL\n" > - "number of seconds \

Re: Use XLOG_CONTROL_FILE macro everywhere?

2025-04-06 Thread Fujii Masao
On 2025/04/06 4:10, Anton A. Melnikov wrote: Hi! On 05.04.2025 06:11, Fujii Masao wrote: Thanks for checking! Barring any objections, I'll go ahead and commit the patch. As for me all is ok. Thanks! I've pushed the patch. Thanks! Regards, -- Fujii Masao Advanced Computing Technology

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Chapman Flack
On 04/06/25 15:47, Tom Lane wrote: > Chapman Flack writes: >> Can a spread-out variadic "any" arg list ever vary >> in length or type on the fly at a single call site? > > Don't think so. Only slightly tangentially: what things count as "objects that depend on the transform" for purposes of DROP

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

2025-04-06 Thread David Rowley
On Sat, 5 Apr 2025 at 16:55, David Rowley wrote: > I am still thinking about the duplicate members being returned from > the iterator for child join rels due to them being duplicated into > each component relid element in ec_childmembers. I did consider if > these could just not be duplicated and

Re: History doc page clarification on naming

2025-04-06 Thread Daniel Gustafsson
> On 6 Mar 2025, at 14:12, Dave Page wrote: > On Thu, 6 Mar 2025 at 12:19, Daniel Gustafsson > wrote: >> > On 6 Mar 2025, at 12:05, Dave Page > > > wrote: >> > >> > Further to my previous patch to update the licence preamble >> > (https://www.po

Re: Logging which local address was connected to in log_line_prefix

2025-04-06 Thread Tom Lane
Michael Paquier writes: > I'd suggest the addition of this data to csvlog.c and jsonlog.c, > perhaps only adding this information if local_host[0] is not '\0' > rather than assigning a default "[none]" all the time to save some > space in the entries generated. I think that's completely impractic

Re: Logging which local address was connected to in log_line_prefix

2025-04-06 Thread Michael Paquier
On Sun, Apr 06, 2025 at 06:01:01PM -0400, Tom Lane wrote: > I don't really care for #3 or #4, but I'm ambivalent between #1 and > #2. I think the worry about confusion originated when the patch > would print "[local]" for either a Unix socket or a background > process, and that certainly was confu

Re: [PATCH] clarify palloc comment on quote_literal_cstr

2025-04-06 Thread Michael Paquier
On Sun, Apr 06, 2025 at 12:37:24PM -0500, Steve Chavez wrote: > I found the numbers in `quote_literal_cstr` palloc quite magical. So I've > added a comment clarifying what they mean. The change is small: > > /* We make a worst-case result area; wasting a little space is OK */ > - res

Re: Logging which local address was connected to in log_line_prefix

2025-04-06 Thread Tom Lane
Greg Sabino Mullane writes: > I have not attempted the caching change yet. After some thought I concluded that caching the local-address string in MyProcPort itself would be the most robust way of making that work. Otherwise you need some way to update the cache when MyProcPort is created (in cas

Re: Possibly hard-to-read message

2025-04-06 Thread Daniel Gustafsson
> On 27 Mar 2025, at 02:42, David G. Johnston > wrote: > On second thought, something like: > > WATCH_INTERVAL: an integer number of seconds; overrides the default two > second \watch interval > > (not quite happy but it's close...keeps the 2s reference point) Looking at the other variables

Re: Typo in comment for pgstat_database_flush_cb()

2025-04-06 Thread Michael Paquier
On Sun, Apr 06, 2025 at 01:31:50PM +0200, Etsuro Fujita wrote: > +1 for both suggestions. So I modified the comment as such in each > file with such a flush_cb function. I will push the patch. Thanks for the fix. Could you also backpatch that down to v15? It would be good to keep this level of

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

2025-04-06 Thread Andrew Dunstan
On 2025-04-06 Su 1:51 PM, Tom Lane wrote: =?utf-8?Q?=C3=81lvaro?= Herrera writes: On 2025-Apr-06, Tom Lane wrote: If we can cite the SQL standard then it's an entirely defensible restriction. We can. It says (in 5.2 and ) ::= ::= [ ... ] ::= | ::= !! See the Syntax Rules. ::= !!

Re: [PoC] Federated Authn/z with OAUTHBEARER

2025-04-06 Thread Christoph Berg
> On Thu, Apr 3, 2025 at 12:50 PM Daniel Gustafsson wrote: > > Thanks, both LGTM so pushed. Ack, the build there worked now. (Albeit without running any tests, but let's not care too much about this snowflake architecture.) > On Tue, Apr 1, 2025 at 3:40 PM Jacob Champion > While I was looking in

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

2025-04-06 Thread Álvaro Herrera
On 2025-Apr-01, Shlok Kyal wrote: > I have modified the comment in create_publication.sgml and also added > comment in the restrictions section of logical-replication.sgml. > I have also added a more detailed explanation in comment of > 'check_foreign_tables' > > I have attached the updated v11 p

Re: Update Unicode data to Unicode 16.0.0

2025-04-06 Thread Nathan Bossart
On Sun, Apr 06, 2025 at 09:16:17AM -0500, Nathan Bossart wrote: > Coverity is unhappy about these. I think we should at least do something > like the following. I'll commit this when I have an opportunity. Committed. -- nathan

Re: AIO v2.5

2025-04-06 Thread Alexander Lakhin
Hello Andres, 02.04.2025 14:58, Andres Freund wrote: Hi, I've pushed fixes for 1) and 2) and am working on 3). When running multiple installcheck's against a single server (please find the ready-to-use script attached (I use more sophisticated version with additional patches to make installch

BAS_BULKREAD vs read stream

2025-04-06 Thread Andres Freund
Hi, There are two issues with BAS_BULKREAD interactions with read stream. One for 17+ and one for 18+. The 17+ issue: While trying to analyze issues with BAS_BULKREAD's size vs AIO I was getting really confusing results. After an embarassingly long time I figured out that a good chunk of those

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Tom Lane
Chapman Flack writes: > Can a spread-out variadic "any" arg list ever vary > in length or type on the fly at a single call site? Don't think so. > I notice that funccache only hashes the first nargs > argument types. Yeah; the languages it serves today don't support VARIADIC ANY, so it's not re

Re: Modern SHA2- based password hashes for pgcrypto

2025-04-06 Thread Tom Lane
Alvaro Herrera writes: > I have pushed this now, hoping it won't explode. mamba is not happy: ccache cc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wshadow=compati

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Chapman Flack
On 04/06/25 13:33, Tom Lane wrote: > Maybe you'd be interested in using funccache. O funccache, where were you a year or two ago? Can a spread-out variadic "any" arg list ever vary in length or type on the fly at a single call site? I notice that funccache only hashes the first nargs argument typ

Re: New criteria for autovacuum

2025-04-06 Thread Melanie Plageman
On Sat, Apr 5, 2025 at 2:02 AM Konstantin Knizhnik wrote: > > A more targeted solution to your specific problem would be to update > the visibility map on access. Then, the first time you have to fetch > that heap page, you could mark it all-visible (assuming the long > running transaction has end

Re: Parallel heap vacuum

2025-04-06 Thread Melanie Plageman
On Sun, Apr 6, 2025 at 1:02 AM Masahiko Sawada wrote: > > The eager freeze scan is the pre-existing feature but it's pretty new > code that was pushed just a couple months ago. I didn't want to make > the newly introduced code complex further in one major release > especially if it's in a vacuum a

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Chapman Flack
On 04/06/25 13:59, Tom Lane wrote: > polymorphic arguments: the element type of an anyarray argument can > change on-the-fly from one call to the next in the same query. Yuck! I had not guessed that. Regards, -Chap

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

2025-04-06 Thread Alvaro Herrera
On 2025-Apr-05, jian he wrote: > hi. > + /* FIXME use CompactAttribute */ > Form_pg_attribute att = TupleDescAttr(relation->rd_att, i - > 1); > if (att->attnotnull && att->attnotnullvalid && > !att->attisdropped) > { >

Re: datfrozenxid > relfrozenxid w/ crash before XLOG_HEAP_INPLACE

2025-04-06 Thread Noah Misch
On Wed, Jun 19, 2024 at 06:29:08PM -0700, Noah Misch wrote: > https://postgr.es/m/20240512232923.aa.nmi...@google.com wrote: > > Separable, nontrivial things not fixed in the attached patch stack: > > > - Trouble is possible, I bet, if the system crashes between the > > inplace-update > > memcp

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Tom Lane
I wrote: > Chapman Flack writes: >> I wonder, though, if there might be code in the wild, or even in corners >> of the core I haven't looked in, where FmgrInfo structs aren't being used >> that way, and could get reused for successive calls of one routine but >> with, say, different nargs or argum

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

2025-04-06 Thread Tom Lane
=?utf-8?Q?=C3=81lvaro?= Herrera writes: > On 2025-Apr-06, Tom Lane wrote: >> If we can cite the SQL standard then it's an entirely defensible >> restriction. > We can. It says (in 5.2 and ) > ::= > ::= [ ... ] > ::= | > ::= !! See the Syntax Rules. > ::= !! See the Syntax Rules. Hmm,

Re: FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Tom Lane
Chapman Flack writes: > To wit, given a query like > SELECT hello(n), hello(x) > FROM (VALUES > (1::int4, 1.0::float4), > (2, 2.0), > (3, 3.0)) AS t(n,x); > the core code allocates one FmgrInfo for each of the two uses. Yeah, there's no attempt to merge FmgrInf

Re: Modern SHA2- based password hashes for pgcrypto

2025-04-06 Thread Bernd Helmle
Am Samstag, dem 05.04.2025 um 19:22 +0200 schrieb Alvaro Herrera: > Hello, > > I have pushed this now, hoping it won't explode. > > Thanks! Very cool, i keep my fingers crossed. Thanks, Bernd

[PATCH] clarify palloc comment on quote_literal_cstr

2025-04-06 Thread Steve Chavez
Hello hackers, I found the numbers in `quote_literal_cstr` palloc quite magical. So I've added a comment clarifying what they mean. The change is small: /* We make a worst-case result area; wasting a little space is OK */ - result = palloc(len * 2 + 3 + 1); + result = palloc(

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

2025-04-06 Thread Álvaro Herrera
On 2025-Apr-06, Tom Lane wrote: > I'd be 100% behind forbidding all ASCII control characters in all > identifiers. I can't see any situation in which that's a good thing, > and I can think of plenty where it's a mistake (eg your editor > decided to change space to tab) or done with underhanded in

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

2025-04-06 Thread Tom Lane
=?utf-8?Q?=C3=81lvaro?= Herrera writes: > Grumble. I'd rather introduce a partial restriction now only for names > that affect the tools failing outright (pg_dumpall in particular), than > do nothing for this release. If we feel the need to extend the > restriction later, that's easy to do and b

FmgrInfo allocation patterns (and PL handling as staged programming)

2025-04-06 Thread Chapman Flack
Hi hackers, The way the core code allocates FmgrInfo structures has a pleasing property (at least in the parts of the code I have read and the cases I've tested) that the docs don't seem to emphasize. To wit, given a query like SELECT hello(n), hello(x) FROM (VALUES (1::int4, 1.0::float4), (

Re: Removing unneeded self joins

2025-04-06 Thread Alexander Korotkov
On Sun, Apr 6, 2025 at 5:41 PM Tom Lane wrote: > Alexander Korotkov writes: > > Nevertheless, should we consider revisiting this flag? I see the only > > other GUC simultaneously QUERY_TUNING_METHOD and GUC_NOT_IN_SAMPLE is > > optimize_bounded_sort, which is not exposed in a standard build. > >

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

2025-04-06 Thread David G. Johnston
On Sun, Apr 6, 2025 at 4:30 AM jian he wrote: > > CREATE FUNCTION test_copy_format(internal) > RETURNS copy_handler > AS 'MODULE_PATHNAME', 'test_copy_format' > LANGUAGE C; > src/backend/commands/copy.c: ProcessCopyOptions > if (strcmp(fmt, "text") == 0) >

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

2025-04-06 Thread Mahendra Singh Thalor
On Sun, 6 Apr 2025 at 20:53, Álvaro Herrera wrote: > > On 2025-Apr-06, Andrew Dunstan wrote: > > > On 2025-03-28 Fr 10:43 AM, Nathan Bossart wrote: > > > > Taking a step back, are we sure that 1) this is the right place to do these > > > checks and 2) we shouldn't apply the same restrictions to al

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

2025-04-06 Thread Andrew Dunstan
Sent from my iPhone > On Apr 6, 2025, at 11:23 AM, Álvaro Herrera wrote: > > On 2025-Apr-06, Andrew Dunstan wrote: > >> On 2025-03-28 Fr 10:43 AM, Nathan Bossart wrote: > >>> Taking a step back, are we sure that 1) this is the right place to do these >>> checks and 2) we shouldn't apply the

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

2025-04-06 Thread Álvaro Herrera
On 2025-Apr-06, Andrew Dunstan wrote: > On 2025-03-28 Fr 10:43 AM, Nathan Bossart wrote: > > Taking a step back, are we sure that 1) this is the right place to do these > > checks and 2) we shouldn't apply the same restrictions to all names? I'm > > wondering if it would be better to add these c

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

2025-04-06 Thread Nathan Bossart
On Sun, Apr 06, 2025 at 10:24:58AM -0400, Andrew Dunstan wrote: > On 2025-03-28 Fr 10:43 AM, Nathan Bossart wrote: >> Taking a step back, are we sure that 1) this is the right place to do these >> checks and 2) we shouldn't apply the same restrictions to all names? I'm >> wondering if it would be

Re: Removing unneeded self joins

2025-04-06 Thread Tom Lane
Alexander Korotkov writes: > Nevertheless, should we consider revisiting this flag? I see the only > other GUC simultaneously QUERY_TUNING_METHOD and GUC_NOT_IN_SAMPLE is > optimize_bounded_sort, which is not exposed in a standard build. enable_self_join_elimination is documented, and it has no

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

2025-04-06 Thread Andrew Dunstan
On 2025-03-28 Fr 10:43 AM, Nathan Bossart wrote: On Fri, Mar 28, 2025 at 05:08:26PM +0530, Mahendra Singh Thalor wrote: Here, I am attaching updated patches for review. v04_001* has the changes for CREATE DATABASE/ROLE/USER and v04_002* has the changes into pg_upgrade to give ALERTS for inval

Re: Update Unicode data to Unicode 16.0.0

2025-04-06 Thread Nathan Bossart
On Wed, Mar 05, 2025 at 02:33:42PM -0600, Nathan Bossart wrote: > + /* > + * The builtin provider did not exist prior to version 17. While there > are > + * still problems that could potentially be caught from earlier > versions, > + * such as an index on NORMALIZE(), we don't

Re: Introduce new multi insert Table AM and improve performance of various SQL commands with it for Heap AM

2025-04-06 Thread Jingtang Zhang
Hi, Daniil Davydov. Thanks for sharing your patch! It was quite a while since I last looked at the patch. I've tested it again, and still get regression on patched version where a table has many columns. And it is totally CPU-bounded on tts_virtual_copyslot. Unpatched version: 1 col: Time: 8909.

Re: Draft for basic NUMA observability

2025-04-06 Thread Tomas Vondra
On 4/6/25 14:57, Jakub Wartak wrote: > On Sun, Apr 6, 2025 at 12:29 AM Andres Freund wrote: >> >> Hi, > > Hi Andres/Tomas, > > I've noticed that Tomas responded to this while writing this, so I'm > attaching git-am patches based on his v25 (no squash) and there's only > one new (last one cont

Re: Removing unneeded self joins

2025-04-06 Thread Tender Wang
Alexander Korotkov 于2025年4月6日周日 19:50写道: > On Sun, Apr 6, 2025 at 2:42 PM Tender Wang wrote: > > Daniel Gustafsson 于2025年4月6日周日 19:23写道: > >> > >> > On 6 Apr 2025, at 06:02, Tender Wang wrote: > >> > >> > I find that the postgresql.conf.sample file doesn't contain > enable_self_join_eliminatio

Re: Draft for basic NUMA observability

2025-04-06 Thread Jakub Wartak
On Sun, Apr 6, 2025 at 12:29 AM Andres Freund wrote: > > Hi, Hi Andres/Tomas, I've noticed that Tomas responded to this while writing this, so I'm attaching git-am patches based on his v25 (no squash) and there's only one new (last one contains fixes based on this review) + slight commit amendme

Re: Draft for basic NUMA observability

2025-04-06 Thread Tomas Vondra
On 4/6/25 01:00, Andres Freund wrote: > Hi, > > On 2025-04-05 18:29:22 -0400, Andres Freund wrote: >> I think one thing that the docs should mention is that calling the numa >> functions/views will force the pages to be allocated, even if they're >> currently unused. >> >> Newly started server,

Re: Draft for basic NUMA observability

2025-04-06 Thread Tomas Vondra
On 4/6/25 00:29, Andres Freund wrote: > Hi, > > I just played around with this for a bit. As noted somewhere further down, > pg_buffercache_numa.page_num ends up wonky in different ways for the different > pages. > > I think one thing that the docs should mention is that calling the numa > funct

Re: Removing unneeded self joins

2025-04-06 Thread Alexander Korotkov
On Sun, Apr 6, 2025 at 2:42 PM Tender Wang wrote: > Daniel Gustafsson 于2025年4月6日周日 19:23写道: >> >> > On 6 Apr 2025, at 06:02, Tender Wang wrote: >> >> > I find that the postgresql.conf.sample file doesn't contain >> > enable_self_join_elimination guc. >> > If this is necessary, please see the at

Re: Removing unneeded self joins

2025-04-06 Thread Tender Wang
Daniel Gustafsson 于2025年4月6日周日 19:23写道: > > On 6 Apr 2025, at 06:02, Tender Wang wrote: > > > I find that the postgresql.conf.sample file doesn't contain > enable_self_join_elimination guc. > > If this is necessary, please see the attached patch. > > The GUC is marked as not supposed by the in t

Re: Thinko in pgstat_build_snapshot()

2025-04-06 Thread Etsuro Fujita
On Sun, Mar 30, 2025 at 10:47 PM Gurjeet Singh wrote: > On Sun, Mar 30, 2025 at 4:31 AM Heikki Linnakangas wrote: > > On 30/03/2025 13:23, Etsuro Fujita wrote: > > > While working on something else I noticed $SUBJECT: we are allocating > > > more memory than necessary and copying more data than n

Re: Typo in comment for pgstat_database_flush_cb()

2025-04-06 Thread Etsuro Fujita
On Sun, Mar 30, 2025 at 7:54 PM Gurjeet Singh wrote: > On Sun Mar 30, 2025 at 4:39 AM PDT, Heikki Linnakangas wrote: > > On 30/03/2025 14:32, Heikki Linnakangas wrote: > >> On 30/03/2025 13:28, Etsuro Fujita wrote: > >>> Another thing I noticed is $SUBJECT: I think “if lock could not > >>> immedia

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

2025-04-06 Thread jian he
On Thu, Mar 27, 2025 at 11:29 AM Sutou Kouhei wrote: > We can merge 0001 quickly, right? I did a brief review of v39-0001 and v39-0002. text: COPY_FILE COPY_FRONTEND still appear on comments in copyfrom_internal.h and copyto.c, Should it be removed? +#include "commands/copyto_internal.h" #incl

Re: Removing unneeded self joins

2025-04-06 Thread Daniel Gustafsson
> On 6 Apr 2025, at 06:02, Tender Wang wrote: > I find that the postgresql.conf.sample file doesn't contain > enable_self_join_elimination guc. > If this is necessary, please see the attached patch. The GUC is marked as not supposed by the in the sample file, either it really shouldn't or that

Re: Improve CRC32C performance on SSE4.2

2025-04-06 Thread John Naylor
On Sat, Apr 5, 2025 at 5:15 AM Nathan Bossart wrote: > > I noticed that autoconf is defining USE_AVX512_CRC_WITH_RUNTIME_CHECK, but > everywhere else expects USE_AVX512_CRC32C_WITH_RUNTIME_CHECK (with the > "32C" included). I tested the v16 patches (with the macro fixed and > assertions enabled)