Re: pg_stat_statements and "IN" conditions

2023-02-14 Thread David Geier
Hi, On 2/11/23 13:08, Dmitry Dolgov wrote: On Sat, Feb 11, 2023 at 11:47:07AM +0100, Dmitry Dolgov wrote: The original version of the patch was doing all of this, i.e. handling numerics, Param nodes, RTE_VALUES. The commentary about find_const_walker in tests is referring to a part of that,

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-02-14 Thread Kyotaro Horiguchi
At Tue, 14 Feb 2023 22:35:01 -0800, Maciek Sakrejda wrote in > On Tue, Feb 14, 2023 at 11:08 AM Andres Freund wrote: > > One thing I started to wonder about since is whether we should remove the > > io_ > > prefix from io_object, io_context. The prefixes make sense on the C level, > > but >

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2023-02-14 Thread Bharath Rupireddy
On Wed, Feb 15, 2023 at 6:25 AM Andres Freund wrote: > > > Done, PSA v2 patch. > > This feels way too complicated to me. How about something more like the > attached? Thanks. I kind of did cost analysis of v2 and v3: Input: zero-fill a file of size 256*8K. v2 patch: iovec initialization with

Re: [EXTERNAL] Re: [PATCH] Support using "all" for the db user in pg_ident.conf

2023-02-14 Thread Michael Paquier
On Mon, Feb 13, 2023 at 03:13:04PM +0100, Jelte Fennema wrote: > On Mon, 13 Feb 2023 at 15:06, Pavel Luzanov wrote: >> Does it make sense to reflect changes to the PG-USERNAME field in the >> pg_ident.conf.sample file? >> >> The same relates to the regexp supportin the DATABASE and USER fieldsof

Re: [PATCH] Add pretty-printed XML output option

2023-02-14 Thread Jim Jones
On 15.02.23 02:09, Peter Smith wrote: With v8, in my environment, in psql I see something slightly different: test_pub=# SET XML OPTION CONTENT; SET test_pub=# SELECT xmlformat(''); ERROR: invalid XML document DETAIL: line 1: switching encoding : no input line 1: Document is empty test_pub=#

Re: Support logical replication of DDLs

2023-02-14 Thread Amit Kapila
On Fri, Feb 10, 2023 at 10:01 PM vignesh C wrote: > > On Fri, 10 Feb 2023 at 21:50, vignesh C wrote: > > The attached v68 version patch has the changes for the same. > > I was not sure if we should support ddl replication of > create/alter/drop subscription commands as there might be some data >

Re: recovery modules

2023-02-14 Thread Michael Paquier
On Mon, Feb 13, 2023 at 05:02:37PM -0800, Nathan Bossart wrote: > Sorry for then noise, cfbot alerted me to a missing #include, which I've > added in v13. + basic_archive_context = data->context; + Assert(CurrentMemoryContext != basic_archive_context); So this is what it means to document

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-02-14 Thread Maciek Sakrejda
On Tue, Feb 14, 2023 at 11:08 AM Andres Freund wrote: > One thing I started to wonder about since is whether we should remove the io_ > prefix from io_object, io_context. The prefixes make sense on the C level, but > it's not clear to me that that's also the case on the table level. Yeah, +1.

Re: ANY_VALUE aggregate

2023-02-14 Thread Maciek Sakrejda
I could have used such an aggregate in the past, so +1. This is maybe getting into nit-picking, but perhaps it should be documented as returning an "arbitrary" value instead of a "non-deterministic" one? Technically the value is deterministic: there's a concrete algorithm specifying how it's

Re: Exit walsender before confirming remote flush in logical replication

2023-02-14 Thread Kyotaro Horiguchi
At Mon, 13 Feb 2023 17:13:43 -0800, Andres Freund wrote in > On 2023-02-14 10:05:40 +0900, Kyotaro Horiguchi wrote: > > What do you think about the need for explicitly specifying the > > default? I'm fine with specifying the default using a single word, > > such as WAIT_FOR_REMOTE_FLUSH. > >

Re: Support logical replication of DDLs

2023-02-14 Thread Amit Kapila
On Fri, Feb 10, 2023 at 8:23 PM Masahiko Sawada wrote: > > On Thu, Feb 9, 2023 at 6:55 PM Ajin Cherian wrote: > > > (v67) > > I have some questions about adding the infrastructure for DDL deparsing. > > Apart from the changes made by 0001 patch to add infrastructure for > DDL deparsing, 0002

DDL result is lost by CREATE DATABASE with WAL_LOG strategy

2023-02-14 Thread Ryo Matsumura (Fujitsu)
Hi, hackers. I found that CREATE DATABASE occurs lost of DDL result after crash server. The direct cause is that the checkpoint skips sync for page of template1's main fork because buffer status is not marked as BM_PERMANENT in BufferAlloc(). Have you any knowledge about it? Reproduction: 1)

Re: some namespace.c refactoring

2023-02-14 Thread Tom Lane
Peter Eisentraut writes: > Here are two patches that refactor the mostly repetitive "${object} is > visible" and get_${object}_oid() functions in namespace.c. This uses > the functions in objectaddress.c to look up the appropriate per-catalog > system caches and attribute numbers, similar to

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-02-14 Thread Amit Kapila
On Wed, Feb 15, 2023 at 9:23 AM shiy.f...@fujitsu.com wrote: > > On Sat, Feb 4, 2023 7:24 PM Amit Kapila wrote: > > > > On Thu, Feb 2, 2023 at 2:03 PM Önder Kalacı wrote: > > > > > > On v23, I dropped the planner support for picking the index. Instead, it > > > simply > > > iterates over the

Re: Support logical replication of DDLs

2023-02-14 Thread Peter Smith
On Thu, Feb 9, 2023 at 8:55 PM Ajin Cherian wrote: > > On Fri, Feb 3, 2023 at 11:41 AM Peter Smith wrote: > > > > Here are some review comments for patch v63-0001. > > > > == > > src/backend/catalog/aclchk.c > > > > 3. ExecuteGrantStmt > > > > + /* Copy the grantor id needed for DDL

Re: Todo: Teach planner to evaluate multiple windows in the optimal order

2023-02-14 Thread John Naylor
On Tue, Feb 14, 2023 at 5:46 PM David Rowley wrote: > > I didn't do a detailed review of the sort patch, but I did wonder > about the use of the name "fallback" in the new functions. The > comment in the following snippet from qsort_tuple_unsigned_compare() > makes me think "tiebreak" is a

Re: Support logical replication of DDLs

2023-02-14 Thread Peter Smith
On Sat, Feb 11, 2023 at 3:21 AM vignesh C wrote: > > On Thu, 9 Feb 2023 at 03:47, Peter Smith wrote: > > > > Hi Vignesh, thanks for addressing my v63-0002 review comments. > > > > I confirmed most of the changes. Below is a quick follow-up for the > > remaining ones. > > > > On Mon, Feb 6, 2023

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-02-14 Thread shiy.f...@fujitsu.com
On Sat, Feb 4, 2023 7:24 PM Amit Kapila wrote: > > On Thu, Feb 2, 2023 at 2:03 PM Önder Kalacı wrote: > > > >> > >> and if there's more > >> than one candidate index pick any one. Additionally, we can allow > >> disabling the use of an index scan for this particular case. If we are > >> too

Wrong query results caused by loss of join quals

2023-02-14 Thread Richard Guo
I came across $subject on HEAD and here is the query I'm using. create table t1 (a int, b int); create table t2 (a int, b int); create table t3 (a int, b int); insert into t1 values (1, 1); insert into t2 values (2, 200); insert into t3 values (3, 3); # select * from t1 left join t2 on true,

Re: REASSIGN OWNED vs ALTER TABLE OWNER TO permission inconsistencies

2023-02-14 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Wed, Feb 8, 2023 at 5:49 AM Nazir Bilal Yavuz wrote: > > My colleague Adam realized that when transferring ownership, 'REASSIGN > > OWNED' command doesn't check 'CREATE privilege on the table's schema' on > > new owner but 'ALTER TABLE

RE: Perform streaming logical transactions by background workers and parallel apply

2023-02-14 Thread houzj.f...@fujitsu.com
On Wednesday, February 15, 2023 10:34 AM Amit Kapila wrote: > > On Tue, Feb 14, 2023 at 7:45 PM Masahiko Sawada > wrote: > > > > On Tue, Feb 14, 2023 at 3:58 PM Peter Smith > wrote: > > > > > > On Tue, Feb 14, 2023 at 5:04 PM Amit Kapila > wrote: > > > > > > > > On Fri, Feb 10, 2023 at 8:56

KeepLogSeg needs some fixes on behavior

2023-02-14 Thread Kyotaro Horiguchi
This is a derived thread form [1], that discusses some subtle behaviors of KeepLogSeg. 1: https://www.postgresql.org/message-id/20230213194131.hgzs6ropcvhda...@awork3.anarazel.de At Mon, 13 Feb 2023 11:41:31 -0800, Andres Freund wrote > Hi, > > On 2023-02-13 15:45:49 +0900, Kyotaro Horiguchi

Re: Perform streaming logical transactions by background workers and parallel apply

2023-02-14 Thread Amit Kapila
On Tue, Feb 14, 2023 at 7:45 PM Masahiko Sawada wrote: > > On Tue, Feb 14, 2023 at 3:58 PM Peter Smith wrote: > > > > On Tue, Feb 14, 2023 at 5:04 PM Amit Kapila wrote: > > > > > > On Fri, Feb 10, 2023 at 8:56 AM Peter Smith wrote: > > > > > > > > My first impression was the > > > >

Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-02-14 Thread Peter Smith
Here are some review comments for patch v23. == General 1. IIUC the previous logic for checking "cost" comparisons and selecting the "cheapest" strategy is no longer present in the latest patch. In that case, I think there are some leftover stale comments that need changing. For example,

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2023-02-14 Thread Andres Freund
Hi On 2023-02-15 10:28:37 +0900, Kyotaro Horiguchi wrote: > At Tue, 14 Feb 2023 16:55:25 -0800, Andres Freund wrote > in > > Hi, > > > > On 2023-02-14 18:00:00 +0530, Bharath Rupireddy wrote: > > > Done, PSA v2 patch. > > > > This feels way too complicated to me. How about something more

Re: Improve logging when using Huge Pages

2023-02-14 Thread Justin Pryzby
On Mon, Feb 13, 2023 at 08:18:52PM -0800, Nathan Bossart wrote: > On Mon, Feb 13, 2023 at 05:22:45PM -0600, Justin Pryzby wrote: > > +Reports whether huge pages are in use by the current process. > > +See for more information. > > nitpick: Should this say "server" instead of

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2023-02-14 Thread Kyotaro Horiguchi
At Tue, 14 Feb 2023 16:55:25 -0800, Andres Freund wrote in > Hi, > > On 2023-02-14 18:00:00 +0530, Bharath Rupireddy wrote: > > Done, PSA v2 patch. > > This feels way too complicated to me. How about something more like the > attached? I like this one, but the parameters offset and size are

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2023-02-14 Thread Michael Paquier
On Tue, Feb 14, 2023 at 04:46:07PM -0800, Andres Freund wrote: > Then it really shouldn't have been named pg_pwrite_zeros(). The point of the > p{write,read}{,v} family of functions is to be able to specify the offset to > read/write at. I assume the p is for position, but I'm not sure. 'p' could

pg_statistic MCVs use float4 but extended stats use float8

2023-02-14 Thread Justin Pryzby
It seems odd that stats_ext uses double: postgres=# SELECT attrelid::regclass, attname, atttypid::regtype, relkind FROM pg_attribute a JOIN pg_class c ON c.oid=a.attrelid WHERE attname='most_common_freqs'; attrelid | attname | atttypid | relkind

Re: make_ctags: use -I option to ignore pg_node_attr macro

2023-02-14 Thread Tatsuo Ishii
>> I fixed the above issues and refactored the code. >> Attached is the updated version of the patch. Thought? > > Thank you! Looks good to me. Fix pushed. Thank you! Best reagards, -- Tatsuo Ishii SRA OSS LLC English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp

Re: Can we do something to help stop users mistakenly using force_parallel_mode?

2023-02-14 Thread Andrew Dunstan
On 2023-02-14 Tu 17:32, David Rowley wrote: On Wed, 15 Feb 2023 at 11:27, Andrew Dunstan wrote: It's just occurred to me that this could break the buildfarm fairly comprehensively. I just took a count and we have 74 members using force_parallel_mode. Maybe we need to keep

Re: [PATCH] Add pretty-printed XML output option

2023-02-14 Thread Peter Smith
On Wed, Feb 15, 2023 at 11:05 AM Jim Jones wrote: > > On 14.02.23 23:45, Peter Smith wrote: > > Those results implied to me that this function code (in my environment > > anyway) is somehow introducing a side effect causing the *other* XML > > tests to fail. > > I believe I've found the issue. It

Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

2023-02-14 Thread Kyotaro Horiguchi
At Tue, 14 Feb 2023 15:43:26 +0100, "Drouvot, Bertrand" wrote in > Oh right, my bad (the issue has been introduced in V2). > Fixed in V4. Great! > > I thought that we might be able to return entry_ref->pending since the > > callers don't call pfree on the returned pointer, but it is not great

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2023-02-14 Thread Andres Freund
Hi, On 2023-02-14 18:00:00 +0530, Bharath Rupireddy wrote: > On Mon, Feb 13, 2023 at 11:09 PM Andres Freund wrote: > > > > > Later code assigns iov[0].iov_len thus we need to provide a separate > > > iov non-const variable, or can we use pwrite instead there? (I didn't > > > find

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2023-02-14 Thread Andres Freund
Hi, On 2023-02-14 16:06:24 +0900, Michael Paquier wrote: > On Mon, Feb 13, 2023 at 05:10:56PM -0800, Andres Freund wrote: > > I just tried to use pg_pwrite_zeros - and couldn't because it doesn't have > > an > > offset parameter. Huh, what lead to the function being so constrained? > > Its

Re: We shouldn't signal process groups with SIGQUIT

2023-02-14 Thread Andres Freund
Hi, On 2023-02-14 14:23:32 -0800, Nathan Bossart wrote: > On Tue, Feb 14, 2023 at 12:47:12PM -0800, Andres Freund wrote: > > Not really related: I do wonder how often we end up self deadlocking in > > quickdie(), due to the ereport() not beeing reentrant. We'll "fix" it soon > > after, due to

Re: [PATCH] Add pretty-printed XML output option

2023-02-14 Thread Jim Jones
On 14.02.23 23:45, Peter Smith wrote: Those results implied to me that this function code (in my environment anyway) is somehow introducing a side effect causing the *other* XML tests to fail. I believe I've found the issue. It is probably related to the XML OPTION settings, as it seems to

Re: User functions for building SCRAM secrets

2023-02-14 Thread Jonathan S. Katz
On 2/14/23 3:19 PM, Jonathan S. Katz wrote: On 2/14/23 3:17 PM, Andres Freund wrote: This reliably fails on CI: https://cirrus-ci.com/github/postgresql-cfbot/postgresql/commitfest%2F42%2F3988 I think this is related to encoding issues. The 32bit debian task intentionally uses LANG=C.

Re: [PATCH] Add pretty-printed XML output option

2023-02-14 Thread Peter Smith
On Wed, Feb 15, 2023 at 8:55 AM Jim Jones wrote: > > On 13.02.23 13:15, Jim Jones wrote: > > diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/xml.out > /tmp/cirrus-ci-build/build/testrun/regress/regress/results/xml.out > --- /tmp/cirrus-ci-build/src/test/regress/expected/xml.out

Re: Can we do something to help stop users mistakenly using force_parallel_mode?

2023-02-14 Thread David Rowley
On Wed, 15 Feb 2023 at 11:27, Andrew Dunstan wrote: > It's just occurred to me that this could break the buildfarm fairly > comprehensively. I just took a count and we have 74 members using > force_parallel_mode. Maybe we need to keep force_parallel_mode as an > alternative spelling for

Re: Can we do something to help stop users mistakenly using force_parallel_mode?

2023-02-14 Thread Andrew Dunstan
On 2023-02-13 Mo 06:16, David Rowley wrote: On Sat, 11 Feb 2023 at 04:34, Andrew Dunstan wrote: On 2023-02-09 Th 15:25, David Rowley wrote: Likely the hardest part to get right here is the new name. Can anyone think of anything better than debug_parallel_query? WFM Thanks for chipping in.

Re: We shouldn't signal process groups with SIGQUIT

2023-02-14 Thread Nathan Bossart
On Tue, Feb 14, 2023 at 12:47:12PM -0800, Andres Freund wrote: > Not really related: I do wonder how often we end up self deadlocking in > quickdie(), due to the ereport() not beeing reentrant. We'll "fix" it soon > after, due to postmasters SIGKILL. Perhaps we should turn on >

Re: Change xl_hash_vacuum_one_page.ntuples from int to uint16

2023-02-14 Thread Nathan Bossart
On Sat, Jan 21, 2023 at 06:42:08AM +0100, Drouvot, Bertrand wrote: > On 1/20/23 9:01 PM, Nathan Bossart wrote: >> Should we also change the related >> variables (e.g., ndeletable in _hash_vacuum_one_page()) to uint16? > > Yeah, I thought about it too. What I saw is that there is other places that

Re: [PATCH] Add pretty-printed XML output option

2023-02-14 Thread Jim Jones
On 13.02.23 13:15, Jim Jones wrote: diff -U3 /tmp/cirrus-ci-build/src/test/regress/expected/xml.out /tmp/cirrus-ci-build/build/testrun/regress/regress/results/xml.out --- /tmp/cirrus-ci-build/src/test/regress/expected/xml.out 2023-02-12 09:02:57.077569000 + +++

Re: Move defaults toward ICU in 16?

2023-02-14 Thread Jonathan S. Katz
On 2/13/23 8:11 PM, Jeff Davis wrote: On Thu, 2023-02-02 at 05:13 -0800, Jeff Davis wrote: As a project, do we want to nudge users toward ICU as the collation provider as the best practice going forward? One consideration here is security. Any vulnerability in ICU collation routines could

Re: We shouldn't signal process groups with SIGQUIT

2023-02-14 Thread Andres Freund
Hi, On 2023-02-14 15:38:24 -0500, Tom Lane wrote: > Andres Freund writes: > > ISTM that signal_child() should downgrade SIGQUIT to SIGTERM when sending to > > the process group. That way we'd maintain the current behaviour for postgres > > itself, but stop core-dumping archive/restore scripts

Re: We shouldn't signal process groups with SIGQUIT

2023-02-14 Thread Tom Lane
Andres Freund writes: > ISTM that signal_child() should downgrade SIGQUIT to SIGTERM when sending to > the process group. That way we'd maintain the current behaviour for postgres > itself, but stop core-dumping archive/restore scripts (as well as other > subprocesses that e.g. trusted PLs might

RE: UUID v7

2023-02-14 Thread Kyzer Davis (kydavis)
Hello Group, I am happy to see others interested in the improvements provided by UUIDv7! I caught up on the thread and you all are correct. Work has moved on GitHub from uuid6/uuid6-ietf-draft to ietf-wg-uuidrev/rfc4122bis - Draft 00 merged RFC4122 with Draft 04 and fixed as many problems as

Extensible Rmgr for Table Ams

2023-02-14 Thread Pradeep Kumar
Hello All, Im working on my postgres FDW extension, to support logical replication I need to use Custom WAL resource manager. In postgres extensions have the flexibility to register their resource managers in RmgrTable[]. But Like RmgrTable[] we have another resource manager related table

Re: jsonpath syntax extensions

2023-02-14 Thread Alexander Iansiti
These syntax extensions would make the jsonpath syntax a super powerful query language capable of most nosql workloads people would have. Especially querying jsonpath with a variable key to look for is a sorely missed feature from the language. I would be open to reviewing the patches if need

We shouldn't signal process groups with SIGQUIT

2023-02-14 Thread Andres Freund
Hi, The default reaction to SIGQUIT is to create core dumps. We use SIGQUIT to implement immediate shutdowns. We send the signal to the entire process group. The result of that is that we regularly produce core dumps for binaries like sh/cp. I regularly see this on my local system, I've seen it

Re: Possible false valgrind error reports

2023-02-14 Thread Tom Lane
Karina Litskevich writes: > In 82d0a46ea32 AllocSetRealloc() was changed to allow decreasing size of > external chunks and give memory back to the malloc pool. Two > VALGRIND_MAKE_MEM_UNDEFINED() calls were not changed to work properly in the > case of decreasing size: they can mark memory behind

Re: User functions for building SCRAM secrets

2023-02-14 Thread Jonathan S. Katz
On 2/14/23 3:17 PM, Andres Freund wrote: Hi, On 2023-01-23 00:58:40 -0500, Jonathan S. Katz wrote: Here is another attempt at this patch that takes into account the SCRAM code refactor. I addressed some of Daniel's previous feedback, but will need to make another pass on the docs and the

Re: User functions for building SCRAM secrets

2023-02-14 Thread Andres Freund
Hi, On 2023-01-23 00:58:40 -0500, Jonathan S. Katz wrote: > Here is another attempt at this patch that takes into account the SCRAM code > refactor. I addressed some of Daniel's previous feedback, but will need to > make another pass on the docs and the assert trace as the main focus of this >

Re: doc: add missing "id" attributes to extension packaging page

2023-02-14 Thread Andres Freund
Hi, On 2023-01-26 21:48:54 +0100, Brar Piening wrote: > On 18.01.2023 at 06:50, Brar Piening wrote: > > > I'll give it a proper look this weekend. > > It turns out I didn't get a round tuit. > > ... and I'm afraid I probably will not be able to work on this until > mid/end February so we'll

Re: pg_dump versus hash partitioning

2023-02-14 Thread Tom Lane
Here's a set of draft patches around this issue. 0001 does what I last suggested, ie force load-via-partition-root for leaf tables underneath a partitioned table with a partitioned-by-hash enum column. It wasn't quite as messy as I first feared, although we do need a new query (and pg_dump now

Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)

2023-02-14 Thread Andres Freund
Hi, On 2023-02-11 10:24:37 -0800, Andres Freund wrote: > Just pushed the actual pg_stat_io view, the splitting of the tablespace test, > and the pg_stat_io tests. One thing I started to wonder about since is whether we should remove the io_ prefix from io_object, io_context. The prefixes make

Re: Force testing of query jumbling code in TAP tests

2023-02-14 Thread Andres Freund
Hi, On 2023-02-14 16:04:16 +0900, Michael Paquier wrote: > On Mon, Feb 13, 2023 at 09:45:12AM -0800, Andres Freund wrote: > > Shouldn't there at least be some basic verification of pg_stat_statements > > output being sane after running the test? Even if that's perhaps just > > actually > >

Re: Move defaults toward ICU in 16?

2023-02-14 Thread Andres Freund
Hi, On 2023-02-14 09:48:08 -0800, Jeff Davis wrote: > On Fri, 2023-02-10 at 18:00 -0800, Andres Freund wrote: > > But, shouldn't pg_upgrade be able to deal with this? As long as the > > databases > > are created with template0, we can create the collations at that > > point? > > Are you saying

Re: Move defaults toward ICU in 16?

2023-02-14 Thread Jeff Davis
On Fri, 2023-02-10 at 18:00 -0800, Andres Freund wrote: > Until something like my patch above is done more generally > applicable, I think > your patch should disable ICU on windows. Can't just fail to build. > > Perhaps we don't need to force ICU use to on with the meson build, > given that > it

Re: Weird failure with latches in curculio on v15

2023-02-14 Thread Nathan Bossart
Here is a new version of the stopgap/back-branch fix for restore_command. This is more or less a rebased version of v4 with an added stderr message as Andres suggested upthread. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com >From 20edca59834c7755bfddb070fb9db3f59dc6ff96 Mon Sep

Re: Extensible Rmgr for Table Ams

2023-02-14 Thread Jeff Davis
On Tue, 2023-02-14 at 19:09 +0530, Pradeep Kumar wrote: > GetRmgrDesc() are widely used in XLogDumpDisplayRecord() and > XLogDumpDisplayStats() in pg_waldump.c. In function GetRmgrDesc() for > custom resource managers by the default they are assign  >        1) rm_desc = default_desc >        2)

Re: Allow tailoring of ICU locales with custom rules

2023-02-14 Thread Laurenz Albe
On Mon, 2023-02-06 at 22:16 +0100, Peter Eisentraut wrote: > Right.  Here is a new patch with this fixed. Thanks. I played some more with it, and still are still some missing odds and ends: - There is a new option ICU_RULES to CREATE DATABASE, but it is not reflected in \h CREATE DATABASE.

Re: run pgindent on a regular basis / scripted manner

2023-02-14 Thread Andrew Dunstan
On 2023-02-13 Mo 13:29, Jelte Fennema wrote: On Mon, 13 Feb 2023 at 17:47, Andrew Dunstan wrote: OK, but I'd like to hear from more people about what they want. Experience tells me that making assumptions about how people work is not a good idea. I doubt anyone's work pattern is like mine.

Re: odd buildfarm failure - "pg_ctl: control file appears to be corrupt"

2023-02-14 Thread Anton A. Melnikov
Hi, Thomas! On 14.02.2023 06:38, Anton A. Melnikov wrote: Also i did several experiments with fsync=on and found more appropriate behavior: The stress test with sizeof(ControlFileData) = 512+8 = 520 bytes failed in a 4,5 hours, but the other one with ordinary sizeof(ControlFileData) = 296 not

Possible false valgrind error reports

2023-02-14 Thread Karina Litskevich
Hi hackers, In 82d0a46ea32 AllocSetRealloc() was changed to allow decreasing size of external chunks and give memory back to the malloc pool. Two VALGRIND_MAKE_MEM_UNDEFINED() calls were not changed to work properly in the case of decreasing size: they can mark memory behind the new allocated

Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry

2023-02-14 Thread Drouvot, Bertrand
Hi, On 2/14/23 7:11 AM, Kyotaro Horiguchi wrote: Isn't it ignoring the second call to pgstat_fetch_pending_entry? Oh right, my bad (the issue has been introduced in V2). Fixed in V4. I thought that we might be able to return entry_ref->pending since the callers don't call pfree on the

Re: daitch_mokotoff module

2023-02-14 Thread Dag Lem
I sincerely hope this resolves any blocking issues with copyright / legalese / credits. Best regards Dag Lem diff --git a/contrib/fuzzystrmatch/Makefile b/contrib/fuzzystrmatch/Makefile index 0704894f88..12baf2d884 100644 --- a/contrib/fuzzystrmatch/Makefile +++ b/contrib/fuzzystrmatch/Makefile

Re: Perform streaming logical transactions by background workers and parallel apply

2023-02-14 Thread Masahiko Sawada
On Tue, Feb 14, 2023 at 3:58 PM Peter Smith wrote: > > On Tue, Feb 14, 2023 at 5:04 PM Amit Kapila wrote: > > > > On Fri, Feb 10, 2023 at 8:56 AM Peter Smith wrote: > > > > > > On Fri, Feb 10, 2023 at 1:32 PM houzj.f...@fujitsu.com > > > wrote: > > > > > > > > On Tuesday, February 7, 2023

Re: meson: Non-feature feature options

2023-02-14 Thread Nazir Bilal Yavuz
Hi, On 2/8/23 19:23, Andres Freund wrote: For the 'uuid' option, I'm not sure what the best way to address this would. We could establish a search order of libraries that is used if no specific one is set (similar to libreadline, libedit, in a way). So we'd have one option 'uuid' that is of

some namespace.c refactoring

2023-02-14 Thread Peter Eisentraut
Here are two patches that refactor the mostly repetitive "${object} is visible" and get_${object}_oid() functions in namespace.c. This uses the functions in objectaddress.c to look up the appropriate per-catalog system caches and attribute numbers, similar to other refactoring patches I have

Re: appendBinaryStringInfo stuff

2023-02-14 Thread Peter Eisentraut
On 10.02.23 20:08, Corey Huinker wrote: On Fri, Feb 10, 2023 at 7:16 AM Peter Eisentraut > wrote: On 19.12.22 07:13, Peter Eisentraut wrote: > Also, the argument type of appendBinaryStringInfo() is char *. There is > some code

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-02-14 Thread David Geier
Hi! On 2/14/23 12:11, David Geier wrote: Hi, I think I fixed the compilation errors. It was due to a few variables being declared under #if defined(__x86_64__) && defined(__linux__) while being used also under non x86 Linux. I also removed again the code to obtain the TSC frequency under

Re: Make EXPLAIN generate a generic plan for a parameterized query

2023-02-14 Thread Laurenz Albe
On Mon, 2023-02-13 at 16:33 -0800, Andres Freund wrote: > On 2023-02-05 18:24:03 +0100, Laurenz Albe wrote: > > Anyway, attached is v7 that tries to do it that way. > > This consistently fails on CI: > https://cirrus-ci.com/github/postgresql-cfbot/postgresql/commitfest%2F42%2F3962 > >

Re: Use pg_pwritev_with_retry() instead of write() in dir_open_for_write() to avoid partial writes?

2023-02-14 Thread Bharath Rupireddy
On Mon, Feb 13, 2023 at 11:09 PM Andres Freund wrote: > > > Later code assigns iov[0].iov_len thus we need to provide a separate > > iov non-const variable, or can we use pwrite instead there? (I didn't > > find pg_pwrite_with_retry(), though) > > Given that we need to do that, and given that we

Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?

2023-02-14 Thread David Geier
Hi, On 2/7/23 19:12, Andres Freund wrote: This fails to build on several platforms: https://cirrus-ci.com/github/postgresql-cfbot/postgresql/commitfest%2F42%2F3751 I think I fixed the compilation errors. It was due to a few variables being declared under #if defined(__x86_64__) &&

Re: Support logical replication of DDLs

2023-02-14 Thread Amit Kapila
On Fri, Feb 10, 2023 at 4:36 PM Amit Kapila wrote: > > On Thu, Feb 9, 2023 at 3:25 PM Ajin Cherian wrote: > > > > Comments on 0001 and 0002 > === > Few more comments on 0001 and 0003 === 1. I think having 'internal' in an exposed function

Re: Todo: Teach planner to evaluate multiple windows in the optimal order

2023-02-14 Thread David Rowley
On Tue, 14 Feb 2023 at 17:21, John Naylor wrote: > Not rechecking seems to eliminate the regression in 4 cases, and reduce it in > the other 2 cases. For those 2 cases (10e6 rows, random, mod 10 and 100), it > might be worthwhile to "zoom in" with more measurements, but haven't done > that

Re: pg_walinspect memory leaks

2023-02-14 Thread Bharath Rupireddy
On Tue, Feb 14, 2023 at 6:25 AM Andres Freund wrote: > > Hi, > > On 2023-02-13 15:22:02 -0800, Peter Geoghegan wrote: > > More concretely, it looks like GetWALRecordInfo() calls > > CStringGetTextDatum/cstring_to_text in a way that accumulates way too > > much memory in ExprContext. > >

RE: Support logical replication of DDLs

2023-02-14 Thread houzj.f...@fujitsu.com
On Tuesday, February 14, 2023 9:44 AM Peter Smith wrote: > > FYI - the latest patch cannot be applied. > Thanks for reporting. I will post a rebased patch after fixing some of the comments raised so far(in a day or so). Best regards, Hou zj

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

2023-02-14 Thread Andrey Lepikhov
On 2/6/23 06:47, Yuya Watari wrote: Of course, I'm not sure if my approach in v16-0003 is ideal, but it may help solve your concern above. Since simple_rel_array[0] is no longer necessary with my patch, I removed the setup_append_rel_entry() function in v16-0004. However, to work the patch, I

RE: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

2023-02-14 Thread shiy.f...@fujitsu.com
On Mon, Feb 13, 2023 7:01 PM shiy.f...@fujitsu.com wrote: > > On Thu, Feb 2, 2023 4:34 PM Önder Kalacı wrote: > > > >> > >> and if there's more > >> than one candidate index pick any one. Additionally, we can allow > >> disabling the use of an index scan for this particular case. If we are >

Re: Support logical replication of DDLs

2023-02-14 Thread Alvaro Herrera
On 2023-Feb-14, Peter Smith wrote: > FYI - the latest patch cannot be applied. Yeah, that's because I applied the removal of "ON" to transforms' identity string. -- Álvaro HerreraBreisgau, Deutschland — https://www.EnterpriseDB.com/

Re: [PATCH] Support SK_SEARCHNULL / SK_SEARCHNOTNULL for heap-only scans

2023-02-14 Thread Aleksander Alekseev
Hi Andres, > Shouldn't need to extract the column if we just want to know if it's NULL (see > heap_attisnull()). Afaics the value isn't accessed after this. Many thanks. Fixed. -- Best regards, Aleksander Alekseev v2-0001-Support-SK_SEARCHNULL-SK_SEARCHNOTNULL-for-heap-o.patch Description: