minor error message inconsistency in make_pathkey_from_sortinfo

2024-04-24 Thread jian he
hi. in make_pathkey_from_sortinfo equality_op = get_opfamily_member(opfamily, opcintype, opcintype, BTEqualStrategyNumber); if (!OidIsValid(equality_op)) /* shouldn't happen */ elog(ERROR, "missing operator %d(%u,%u) in opfamily %u", BTEqualStrategyNumber, opcintype, opcintype, opfamily);

Partitioned tables and [un]loggedness

2024-04-24 Thread Michael Paquier
Hi all, As a recent poke on a thread of 2019 has reminded me, the current situation of partitioned tables with unlogged is kind of weird: https://www.postgresql.org/message-id/15954-b61523bed4b110c4%40postgresql.org To sum up the situation: - ALTER TABLE .. SET LOGGED/UNLOGGED does not affect par

Re: Cleanup: remove unused fields from nodes

2024-04-24 Thread Michael Paquier
On Tue, Apr 23, 2024 at 11:03:40PM -0400, Tom Lane wrote: > Hah. Seems like the comment for isall needs to explain that it > exists for this purpose, so we don't make this mistake again. How about something like the attached? -- Michael diff --git a/src/include/nodes/parsenodes.h b/src/include/no

Rename libpq trace internal functions

2024-04-24 Thread Peter Eisentraut
libpq's pqTraceOutputMessage() used to look like this: case 'Z': /* Ready For Query */ pqTraceOutputZ(conn->Pfdebug, message, &logCursor); break; Commit f4b54e1ed98 introduced macros for protocol characters, so now it looks like this: case PqMsg_ReadyForQue

Re: Feature request: schema diff tool

2024-04-24 Thread Heikki Linnakangas
On 24/04/2024 09:44, Neszt Tibor wrote: Hello, A diff tool that would generate create, drop, alter, etc. commands from the differences between 2 specified schemes would be very useful. The diff could even manage data, so there would be insert, delete update command outputs, although I think t

Re: Is it acceptable making COPY format extendable?

2024-04-24 Thread Peter Eisentraut
On 23.04.24 07:14, Sutou Kouhei wrote: Hi, I'm proposing a patch that making COPY format extendable: https://www.postgresql.org/message-id/20231204.153548.2126325458835528809.kou%40clear-code.com https://commitfest.postgresql.org/48/4681/ It's based on the discussion at: https://www.postgresql.

Re: Show WAL write and fsync stats in pg_stat_io

2024-04-24 Thread Nazir Bilal Yavuz
Hi, On Fri, 19 Apr 2024 at 11:01, Nazir Bilal Yavuz wrote: > > On Thu, 18 Jan 2024 at 04:22, Michael Paquier wrote: > > > > > > On Wed, Jan 17, 2024 at 03:20:39PM +0300, Nazir Bilal Yavuz wrote: > > > > I agree with your points. While the other I/O related work is > > > > happening we can discus

Re: Avoid orphaned objects dependencies, take 3

2024-04-24 Thread Bertrand Drouvot
Hi, On Tue, Apr 23, 2024 at 04:20:46PM +, Bertrand Drouvot wrote: > Please find attached v2 that should not produce the issue anymore (I launched > a > lot of attempts without any issues). v1 was not strong enough as it was not > always checking for the dependent object existence. v2 now alwa

Re: WIP Incremental JSON Parser

2024-04-24 Thread Michael Paquier
On Fri, Apr 19, 2024 at 02:04:40PM -0400, Robert Haas wrote: > Yeah, I think this patch invented a new solution to a problem that > we've solved in a different way everywhere else. I think we should > change it to match what we do in general. As of ba3e6e2bca97, did you notice that test_json_parse

Re: Use XLOG_CONTROL_FILE macro everywhere?

2024-04-24 Thread Peter Eisentraut
On 19.04.24 05:50, Anton A. Melnikov wrote: There is a macro XLOG_CONTROL_FILE for control file name defined in access/xlog_internal.h And there are some places in code where this macro is used like here https://github.com/postgres/postgres/blob/84db9a0eb10dd1dbee6db509c0e427fa237177dc/src/bin/pg

Re: Use XLOG_CONTROL_FILE macro everywhere?

2024-04-24 Thread Anton A. Melnikov
On 24.04.2024 12:02, Peter Eisentraut wrote: On 19.04.24 05:50, Anton A. Melnikov wrote: May be better use this macro everywhere in C code? I don't know.  I don't find XLOG_CONTROL_FILE to be a very intuitive proxy for "pg_control". Then maybe replace XLOG_CONTROL_FILE with PG_CONTROL_FIL

Short-circuit sort_inner_and_outer if there are no mergejoin clauses

2024-04-24 Thread Richard Guo
In sort_inner_and_outer, we create mergejoin join paths by explicitly sorting both relations on each possible ordering of the available mergejoin clauses. However, if there are no available mergejoin clauses, we can skip this process entirely. It seems that this is a relatively common scenario.

Re: Fix parallel vacuum buffer usage reporting

2024-04-24 Thread Anthonin Bonnefoy
Thanks for the review! > I think that if the anayze command doesn't have the same issue, we > don't need to change it. Good point, I've wrongly assumed that analyze was also impacted but there's no parallel analyze so the block count is correct. > (a) make lazy vacuum use BufferUsage instead o

Re: Use XLOG_CONTROL_FILE macro everywhere?

2024-04-24 Thread Daniel Gustafsson
> On 24 Apr 2024, at 11:13, Anton A. Melnikov wrote: > > On 24.04.2024 12:02, Peter Eisentraut wrote: >> On 19.04.24 05:50, Anton A. Melnikov wrote: >>> >>> May be better use this macro everywhere in C code? >> I don't know. I don't find XLOG_CONTROL_FILE to be a very intuitive proxy >> for "p

Re: Use XLOG_CONTROL_FILE macro everywhere?

2024-04-24 Thread Anton A. Melnikov
On 24.04.2024 12:19, Daniel Gustafsson wrote: On 24 Apr 2024, at 11:13, Anton A. Melnikov wrote: On 24.04.2024 12:02, Peter Eisentraut wrote: On 19.04.24 05:50, Anton A. Melnikov wrote: May be better use this macro everywhere in C code? I don't know. I don't find XLOG_CONTROL_FILE to be a

Re: Q: Escapes in jsonpath Idents

2024-04-24 Thread Peter Eisentraut
On 17.03.24 20:12, Erik Wienhold wrote: Mentioning JSON and \v in the same sentence is wrong: JavaScript allows that escape in strings but JSON doesn't. I think the easiest is to just replace "JSON" with "JavaScript" in that sentence to make it right. The paragraph also already says "embedded s

Re: minor error message inconsistency in make_pathkey_from_sortinfo

2024-04-24 Thread Yugo NAGATA
On Wed, 24 Apr 2024 15:05:00 +0800 jian he wrote: > hi. > > in make_pathkey_from_sortinfo > > equality_op = get_opfamily_member(opfamily, > opcintype, > opcintype, > BTEqualStrategyNumber); > if (!OidIsValid(equality_op)) /* shouldn't happen */ > elog(ERROR, "missing operator %d(%u,%u) in

Re: Cleanup: remove unused fields from nodes

2024-04-24 Thread Matthias van de Meent
On Wed, 24 Apr 2024 at 09:28, Michael Paquier wrote: > > On Tue, Apr 23, 2024 at 11:03:40PM -0400, Tom Lane wrote: > > Hah. Seems like the comment for isall needs to explain that it > > exists for this purpose, so we don't make this mistake again. > > How about something like the attached? LGTM.

Re: Q: Escapes in jsonpath Idents

2024-04-24 Thread Peter Eisentraut
On 18.03.24 01:09, Erik Wienhold wrote: The error message 'syntax error at or near "$oo" of jsonpath input' for the second case ($.f$oo), however, looks as if the scanner identifies '$oo' as a variable instead of contiuing the scan of identifier (f$oo) for the member accessor. Looks like a bug t

Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.

2024-04-24 Thread Alexander Korotkov
On Wed, Apr 17, 2024 at 6:41 PM Pavel Borisov wrote: >> I did notice (I meant to point out) that I have concerns about this >> part of the new uniqueness check code: >> " >> if (P_IGNORE(topaque) || !P_ISLEAF(topaque)) >> break; >> " >> >> My concern here is with the !P_ISLEAF(topaque) test -

Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.

2024-04-24 Thread Alexander Korotkov
On Wed, Apr 17, 2024 at 9:38 AM Peter Eisentraut wrote: > On 24.10.23 22:13, Alexander Korotkov wrote: > > On Wed, Sep 28, 2022 at 11:44 AM Aleksander Alekseev > > wrote: > >>> I think, this patch was marked as "Waiting on Author", probably, by > >>> mistake. Since recent changes were done witho

Remove unnecessary code rom be_lo_put()

2024-04-24 Thread Yugo NAGATA
Hi, I noticed that a permission check is performed in be_lo_put() just after returning inv_open(), but teh permission should be already checked in inv_open(), so I think we can remove this part of codes. I attached a patch for this fix. Regards, Yugo Nagata -- Yugo NAGATA diff --git a/src/back

Re: Why does pgindent's README say to download typedefs.list from the buildfarm?

2024-04-24 Thread Andrew Dunstan
On 2024-04-23 Tu 06:23, Alvaro Herrera wrote: But there are others: InjectionPointEntry, ResourceOwnerData, JsonNonTerminal, JsonParserSem, ... The last two are down to me. Let's just get rid of them like the attached (no need for a typedef at all) cheers andrew -- Andrew Dunstan EDB:h

Re: Why does pgindent's README say to download typedefs.list from the buildfarm?

2024-04-24 Thread Peter Eisentraut
On 22.04.24 22:28, Tom Lane wrote: Nathan Bossart writes: On Mon, Apr 22, 2024 at 04:08:08PM -0400, Tom Lane wrote: I think the actual plan now is that we'll sync the in-tree copy with the buildfarm's results (and then do a tree-wide pgindent) every so often, probably shortly before beta every

Re: Race condition in FetchTableStates() breaks synchronization of subscription tables

2024-04-24 Thread Amit Kapila
On Tue, Apr 23, 2024 at 4:53 PM Amit Kapila wrote: > > On Wed, Mar 13, 2024 at 11:59 AM vignesh C wrote: > > > > On Wed, 13 Mar 2024 at 10:12, Zhijie Hou (Fujitsu) > > wrote: > > > > > > > > > For 0002, instead of avoid resetting the latch, is it possible to let the > > > logical rep worker wake

Re: Race condition in FetchTableStates() breaks synchronization of subscription tables

2024-04-24 Thread vignesh C
On Wed, 24 Apr 2024 at 11:59, Amit Kapila wrote: > > On Wed, Mar 13, 2024 at 9:19 AM vignesh C wrote: > > > > On Tue, 12 Mar 2024 at 09:34, Ajin Cherian wrote: > > > > > > > > > > > > On Tue, Mar 12, 2024 at 2:59 PM vignesh C wrote: > > >> > > >> > > >> Thanks, I have created the following Comm

Re: doc: create table improvements

2024-04-24 Thread Peter Eisentraut
> + The reliability characteristics of a table are governed by its > + persistence mode. The default mode is described > + here > + There are two alternative modes that can be specified during > + table creation: > + temporary and > + unlogged. Not sure reliability is the best word

Re: Rename libpq trace internal functions

2024-04-24 Thread Yugo NAGATA
On Wed, 24 Apr 2024 09:39:02 +0200 Peter Eisentraut wrote: > libpq's pqTraceOutputMessage() used to look like this: > > case 'Z': /* Ready For Query */ > pqTraceOutputZ(conn->Pfdebug, message, &logCursor); > break; > > Commit f4b54e1ed98 introduced macros fo

Re: Why does pgindent's README say to download typedefs.list from the buildfarm?

2024-04-24 Thread Andrew Dunstan
On 2024-04-24 We 06:12, Peter Eisentraut wrote: On 22.04.24 22:28, Tom Lane wrote: Nathan Bossart  writes: On Mon, Apr 22, 2024 at 04:08:08PM -0400, Tom Lane wrote: I think the actual plan now is that we'll sync the in-tree copy with the buildfarm's results (and then do a tree-wide pgindent)

Re: Remove unnecessary code rom be_lo_put()

2024-04-24 Thread Peter Eisentraut
On 24.04.24 11:59, Yugo NAGATA wrote: I noticed that a permission check is performed in be_lo_put() just after returning inv_open(), but teh permission should be already checked in inv_open(), so I think we can remove this part of codes. I attached a patch for this fix. Yes, I think you are rig

Proposal: Early providing of PGDG repositories for the major Linux distributions like Fedora or Debian

2024-04-24 Thread Hans Buschmann
Yesterday Fedora 40 was released as GA available release. According to the project website (download for Linux/Fedora): " the PostgreSQL project provides a repository of packages of all supported versions for the most common distributions

Re: POC: GROUP BY optimization

2024-04-24 Thread jian he
hi one more question (maybe a dumb one) drop table if exists t1; CREATE TABLE t1 AS SELECT (i % 10)::numeric AS x,(i % 10)::int8 AS y,'abc' || i % 10 AS z, i::int4 AS w FROM generate_series(1, 100) AS i; CREATE INDEX t1_x_y_idx ON t1 (x, y); ANALYZE t1; SET enable_hashagg = off; SET enable

Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?

2024-04-24 Thread Daniel Gustafsson
> On 24 Apr 2024, at 00:20, Michael Paquier wrote: > > On Tue, Apr 23, 2024 at 10:08:13PM +0200, Daniel Gustafsson wrote: >> Hearing no objections to this plan (and the posted v10), I'll go ahead with >> 0001, 0003 and 0004 into v17 tomorrow. > > WFM, thanks. Done. Attached are the two remaini

Re: Q: Escapes in jsonpath Idents

2024-04-24 Thread David E. Wheeler
On Apr 24, 2024, at 05:51, Peter Eisentraut wrote: >A is classified as follows. > >Case: > >a) A that is a is acontext variable>. > >b) A that begins with is a > . > >c) Otherwise, a is a . > > Does this help? I wasn't following all the discussion to

Re: Q: Escapes in jsonpath Idents

2024-04-24 Thread David E. Wheeler
On Apr 24, 2024, at 05:46, Peter Eisentraut wrote: > I have committed this patch, and backpatched it, as a bug fix, because the > existing description was wrong. To keep the patch minimal for backpatching, > I didn't do the conversion to a list. I'm not sure I like that anyway, > because it

Re: Avoid orphaned objects dependencies, take 3

2024-04-24 Thread Alexander Lakhin
Hi Bertrand, 24.04.2024 11:38, Bertrand Drouvot wrote: Please find attached v2 that should not produce the issue anymore (I launched a lot of attempts without any issues). v1 was not strong enough as it was not always checking for the dependent object existence. v2 now always checks if the objec

New GUC autovacuum_max_threshold ?

2024-04-24 Thread Frédéric Yhuel
Hello, I would like to suggest a new parameter, autovacuum_max_threshold, which would set an upper limit on the number of tuples to delete/update/insert prior to vacuum/analyze. A good default might be 50. The idea would be to replace the following calculation : vacthresh = (float4) vac

Re: Why does pgindent's README say to download typedefs.list from the buildfarm?

2024-04-24 Thread Tom Lane
Andrew Dunstan writes: > On 2024-04-24 We 06:12, Peter Eisentraut wrote: >> Is the code to extract typedefs available somewhere independent of the >> buildfarm? It would be useful sometimes to be able to run this >> locally, like before and after some patch, to keep the in-tree >> typedefs lis

Re: Cleanup: remove unused fields from nodes

2024-04-24 Thread Tom Lane
Michael Paquier writes: > On Tue, Apr 23, 2024 at 11:03:40PM -0400, Tom Lane wrote: >> Hah. Seems like the comment for isall needs to explain that it >> exists for this purpose, so we don't make this mistake again. > How about something like the attached? I was thinking about wording like

Re: WIP Incremental JSON Parser

2024-04-24 Thread Andrew Dunstan
On 2024-04-24 We 04:56, Michael Paquier wrote: On Fri, Apr 19, 2024 at 02:04:40PM -0400, Robert Haas wrote: Yeah, I think this patch invented a new solution to a problem that we've solved in a different way everywhere else. I think we should change it to match what we do in general. As of ba3

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

2024-04-24 Thread Bharath Rupireddy
On Wed, Apr 3, 2024 at 1:10 AM Jeff Davis wrote: > > Here's where I think this API should go: > > 1. Have table_modify_begin/end and table_modify_buffer_insert, like > those that are implemented in your patch. I added table_modify_begin, table_modify_buffer_insert, table_modify_buffer_flush and t

Re: Remove unnecessary code rom be_lo_put()

2024-04-24 Thread Tom Lane
Peter Eisentraut writes: > On 24.04.24 11:59, Yugo NAGATA wrote: >> I noticed that a permission check is performed in be_lo_put() >> just after returning inv_open(), but teh permission should be >> already checked in inv_open(), so I think we can remove this >> part of codes. I attached a patch fo

Re: Small filx on the documentation of ALTER DEFAULT PRIVILEGES

2024-04-24 Thread Tom Lane
Yugo NAGATA writes: > We can specify more than one privilege type in > "ALTER DEFAULT PRIVILEGES GRANT/REVOKE ON SCHEMAS", > for example, > ALTER DEFAULT PRIVILEGES GRANT USAGE,CREATE ON SCHEMAS TO PUBLIC; > However, the syntax described in the documentation looks to > be allowing only one,

Re: Fix parallel vacuum buffer usage reporting

2024-04-24 Thread Alena Rybakina
On 22.04.2024 11:07, Anthonin Bonnefoy wrote: On Sat, Apr 20, 2024 at 2:00 PM Alena Rybakina wrote: Hi, thank you for your work with this subject. While I was reviewing your code, I noticed that your patch conflicts with another patch [0] that been committed. [0] https:/

Re: pg_combinebackup does not detect missing files

2024-04-24 Thread Robert Haas
On Tue, Apr 23, 2024 at 7:23 PM David Steele wrote: > > I don't understand what you mean here. I thought we were in agreement > > that verifying contents would cost a lot more. The verification that > > we can actually do without much cost can only check for missing files > > in the most recent ba

Re: Tarball builds in the new world order

2024-04-24 Thread Greg Sabino Mullane
On Tue, Apr 23, 2024 at 6:06 PM Tom Lane wrote: > This change seems like a good thing anyway for anyone who's tempted > to use "make dist" manually, since they wouldn't necessarily want > to package HEAD either. Now, if we just do it exactly like that > then trying to "make dist" without setting

Re: doc: create table improvements

2024-04-24 Thread David G. Johnston
On Wed, Apr 24, 2024 at 3:30 AM Peter Eisentraut wrote: > > + The reliability characteristics of a table are governed by its > > + persistence mode. The default mode is described > > + here > > + There are two alternative modes that can be specified during > > + table creation: >

Re: Tarball builds in the new world order

2024-04-24 Thread Peter Eisentraut
On 24.04.24 00:05, Tom Lane wrote: It makes tarballs all right, but whatever commit ID you specify is semi-ignored, and you get a tarball corresponding to HEAD of master. (The PDFs come from the right version, though!) The reason for that is that the mk-one-release script does this (shorn of no

Re: Tarball builds in the new world order

2024-04-24 Thread Tom Lane
Peter Eisentraut writes: > On 24.04.24 00:05, Tom Lane wrote: >> # Export the selected git ref >> git archive ${gitref} | tar xf - -C pgsql > Where does ${gitref} come from? Why doesn't this line use git archive > HEAD | ... ? ${gitref} is an argument to the script, specifying the commit to be

Re: Tarball builds in the new world order

2024-04-24 Thread Tom Lane
Greg Sabino Mullane writes: > On Tue, Apr 23, 2024 at 6:06 PM Tom Lane wrote: >> Now, if we just do it exactly like that >> then trying to "make dist" without setting PG_COMMIT_HASH will >> fail, since "git archive" has no default for its >> argument. I can't quite decide if that's a good thing

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

2024-04-24 Thread Pavel Stehule
st 24. 4. 2024 v 14:50 odesílatel Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> napsal: > On Wed, Apr 3, 2024 at 1:10 AM Jeff Davis wrote: > > > > Here's where I think this API should go: > > > > 1. Have table_modify_begin/end and table_modify_buffer_insert, like > > those that are

Use WALReadFromBuffers in more places

2024-04-24 Thread Bharath Rupireddy
Hi, Commit 91f2cae7a4e that introduced WALReadFromBuffers only used it for physical walsenders. It can also be used in more places benefitting logical walsenders, backends running pg_walinspect and logical decoding functions if the WAL is available in WAL buffers. I'm attaching a 0001 patch for th

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2024-04-24 Thread Bharath Rupireddy
On Thu, Apr 11, 2024 at 6:31 AM Michael Paquier wrote: > > On Tue, Apr 09, 2024 at 09:33:49AM +0300, Andrey M. Borodin wrote: > > As far as I understand CF entry [0] is committed? I understand that > > there are some open followups, but I just want to determine correct > > CF item status... > > So

Re: doc: create table improvements

2024-04-24 Thread David G. Johnston
On Wed, Apr 24, 2024 at 7:45 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Apr 24, 2024 at 3:30 AM Peter Eisentraut > wrote: > >> > + The reliability characteristics of a table are governed by its >> > + persistence mode. The default mode is described >> > + here >

Re: Add notes to pg_combinebackup docs

2024-04-24 Thread Robert Haas
On Mon, Apr 22, 2024 at 2:52 PM Robert Haas wrote: > On Thu, Apr 18, 2024 at 3:25 PM Daniel Gustafsson wrote: > > > On 18 Apr 2024, at 20:11, Robert Haas wrote: > > > 2. As (1), but make check_control_files() emit a warning message when > > > the problem case is detected. > > > > Being in the po

Re: cataloguing NOT NULL constraints

2024-04-24 Thread Alvaro Herrera
On 2024-Apr-22, Alvaro Herrera wrote: > > On d9f686a72~1 this script results in: > > ERROR:  cannot change NO INHERIT status of inherited NOT NULL constraint > > "t_a_not_null" on relation "t" > > Right. Now I'm beginning to wonder if allowing ADD CONSTRAINT to mutate > a pre-existing NO INHERI

Re: Row pattern recognition

2024-04-24 Thread Jacob Champion
On Tue, Apr 23, 2024 at 8:13 PM Tatsuo Ishii wrote: > SELECT v.a, count(*) OVER w > FROM (VALUES ('A'),('B'),('B'),('C')) AS v (a) > WINDOW w AS ( > ORDER BY v.a > ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING > PATTERN (B+) > DEFINE B AS a = 'B' > ) > a | count > ---+--- > A |

some additional (small) problems with pg_combinebackup and tablespaces

2024-04-24 Thread Robert Haas
Tomas Vondra pointed out to me a couple of mistakes that I made with regard to pg_combinebackup and tablespaces. One is that I screwed up the long_options array by specifying tablespace-mapping as no_argument rather than required_argument. That doesn't break the tests I just committed because, in

Re: Add notes to pg_combinebackup docs

2024-04-24 Thread Daniel Gustafsson
> On 22 Apr 2024, at 20:52, Robert Haas wrote: > > On Thu, Apr 18, 2024 at 3:25 PM Daniel Gustafsson wrote: >>> On 18 Apr 2024, at 20:11, Robert Haas wrote: >>> 2. As (1), but make check_control_files() emit a warning message when >>> the problem case is detected. >> >> Being in the post-freez

Re: New GUC autovacuum_max_threshold ?

2024-04-24 Thread Melanie Plageman
On Wed, Apr 24, 2024 at 8:08 AM Frédéric Yhuel wrote: > > Hello, > > I would like to suggest a new parameter, autovacuum_max_threshold, which > would set an upper limit on the number of tuples to delete/update/insert > prior to vacuum/analyze. Hi Frédéric, thanks for the proposal! You are tacklin

Re: some additional (small) problems with pg_combinebackup and tablespaces

2024-04-24 Thread Daniel Gustafsson
> On 24 Apr 2024, at 19:59, Robert Haas wrote: > Here is a very small patch correcting these regrettable errors. Patch LGTM. In addition to those, unless I'm reading it wrong the current coding seems to include a "-P" short option which is missing in the command parsing switch statement (or in

Re: Q: Escapes in jsonpath Idents

2024-04-24 Thread Erik Wienhold
On 2024-04-24 13:52 +0200, David E. Wheeler wrote: > On Apr 24, 2024, at 05:51, Peter Eisentraut wrote: > > >A is classified as follows. > > > >Case: > > > >a) A that is a is a > path context variable>. > > > >b) A that begins with is a > > . > > > >c) Ot

Re: Statistics Import and Export

2024-04-24 Thread Bruce Momjian
On Tue, Apr 23, 2024 at 06:33:48PM +0200, Matthias van de Meent wrote: > I've heard of use cases where dumping stats without data would help > with production database planner debugging on a non-prod system. > > Sure, some planner inputs would have to be taken into account too, but > having an exa

Re: Statistics Import and Export

2024-04-24 Thread Matthias van de Meent
On Wed, 24 Apr 2024 at 21:31, Bruce Momjian wrote: > > On Tue, Apr 23, 2024 at 06:33:48PM +0200, Matthias van de Meent wrote: > > I've heard of use cases where dumping stats without data would help > > with production database planner debugging on a non-prod system. > > > > Sure, some planner inpu

Re: New GUC autovacuum_max_threshold ?

2024-04-24 Thread Nathan Bossart
On Wed, Apr 24, 2024 at 03:10:27PM -0400, Melanie Plageman wrote: > On Wed, Apr 24, 2024 at 8:08 AM Frédéric Yhuel > wrote: >> I would like to suggest a new parameter, autovacuum_max_threshold, which >> would set an upper limit on the number of tuples to delete/update/insert >> prior to vacuum/ana

Re: Partitioned tables and [un]loggedness

2024-04-24 Thread Nathan Bossart
On Wed, Apr 24, 2024 at 04:17:44PM +0900, Michael Paquier wrote: > - Support ALTER TABLE .. SET LOGGED/UNLOGGED for partitioned tables, > where the command only works on partitioned tables so that's only a > catalog switch. I'm not following what this means. Does SET [UN]LOGGED on a partitioned t

Re: Add SPLIT PARTITION/MERGE PARTITIONS commands

2024-04-24 Thread Justin Pryzby
On Mon, Apr 22, 2024 at 01:31:48PM +0300, Alexander Korotkov wrote: > Hi! > > On Fri, Apr 19, 2024 at 4:29 PM Alexander Korotkov > wrote: > > On Fri, Apr 19, 2024 at 2:26 AM Dmitry Koval wrote: > > > 18.04.2024 19:00, Alexander Lakhin wrote: > > > > leaves a strange constraint: > > > > \d+ t* >

Re: Q: Escapes in jsonpath Idents

2024-04-24 Thread David E. Wheeler
On Apr 24, 2024, at 3:22 PM, Erik Wienhold wrote: > Thanks Peter! But what is the definition of the entire path expression? > Perhaps something like: > > ::= { "." } > > That would imply that "$.$foo" is a valid path that accesses a variable > member (but I guess the path evaluation is a

Re: BitmapHeapScan streaming read user and prelim refactoring

2024-04-24 Thread Melanie Plageman
On Tue, Apr 23, 2024 at 6:43 PM Tomas Vondra wrote: > > On 4/23/24 18:05, Melanie Plageman wrote: > > The patch with a fix is attached. I put the test in > > src/test/regress/sql/join.sql. It isn't the perfect location because > > it is testing something exercisable with a join but not directly >

Re: Experiments with Postgres and SSL

2024-04-24 Thread Peter Eisentraut
On 08.04.24 10:38, Heikki Linnakangas wrote: On 08/04/2024 04:25, Heikki Linnakangas wrote: One important open item now is that we need to register a proper ALPN protocol ID with IANA. I sent a request for that: https://mailarchive.ietf.org/arch/msg/tls-reg-review/9LWPzQfOpbc8dTT7vc9ahNeNaiw/

Re: A varint implementation for PG?

2024-04-24 Thread Nathan Bossart
On Thu, Jan 05, 2023 at 06:36:15PM -0500, Robert Haas wrote: > Andres asked me off-list if I could take another look at this. I'm curious whether there are plans to pick this up again. IMHO it seems like a generally good idea. AFAICT the newest version of the patch is in a separate thread [0], w

Re: Experiments with Postgres and SSL

2024-04-24 Thread Peter Eisentraut
On 01.03.24 22:49, Jacob Champion wrote: If we're interested in ALPN negotiation in the future, we may also want to look at GREASE [1] to keep those options open in the presence of third-party implementations. Unfortunately OpenSSL doesn't do this automatically yet. If we don't have a reason not

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-04-24 Thread Noah Misch
On Mon, Apr 15, 2024 at 04:12:38PM +0700, John Naylor wrote: > - Some paths for single-value leaves are not covered: > > https://anarazel.de/postgres/cov/16-vs-HEAD-2024-04-14/src/include/lib/radixtree.h.gcov.html#L904 > https://anarazel.de/postgres/cov/16-vs-HEAD-2024-04-14/src/include/lib/radixt

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2024-04-24 Thread Nathan Bossart
On Tue, Apr 23, 2024 at 11:47:38PM -0400, Tom Lane wrote: > On the whole I find this proposed feature pretty unexciting > and dubiously worthy of the implementation/maintenance effort. I don't have any particularly strong feelings on $SUBJECT, but I'll admit I'd be much more interested in resolvin

Re: Partitioned tables and [un]loggedness

2024-04-24 Thread David G. Johnston
On Wed, Apr 24, 2024 at 1:26 PM Nathan Bossart wrote: > On Wed, Apr 24, 2024 at 04:17:44PM +0900, Michael Paquier wrote: > > - Support ALTER TABLE .. SET LOGGED/UNLOGGED for partitioned tables, > > where the command only works on partitioned tables so that's only a > > catalog switch. > > I'm not

Re: Partitioned tables and [un]loggedness

2024-04-24 Thread Michael Paquier
On Wed, Apr 24, 2024 at 03:26:40PM -0500, Nathan Bossart wrote: > On Wed, Apr 24, 2024 at 04:17:44PM +0900, Michael Paquier wrote: > > - Support ALTER TABLE .. SET LOGGED/UNLOGGED for partitioned tables, > > where the command only works on partitioned tables so that's only a > > catalog switch. >

Re: Partitioned tables and [un]loggedness

2024-04-24 Thread Michael Paquier
On Wed, Apr 24, 2024 at 03:36:35PM -0700, David G. Johnston wrote: > On Wed, Apr 24, 2024 at 1:26 PM Nathan Bossart > wrote: >> On Wed, Apr 24, 2024 at 04:17:44PM +0900, Michael Paquier wrote: >>> - CREATE TABLE PARTITION OF would make a new partition inherit the >>> logged ness of the parent if U

Re: Improve WALRead() to suck data directly from WAL buffers when possible

2024-04-24 Thread Michael Paquier
On Wed, Apr 24, 2024 at 09:46:20PM +0530, Bharath Rupireddy wrote: > Thanks. I started a new thread > https://www.postgresql.org/message-id/CALj2ACVfF2Uj9NoFy-5m98HNtjHpuD17EDE9twVeJng-jTAe7A%40mail.gmail.com. Cool, thanks. -- Michael signature.asc Description: PGP signature

Re: Partitioned tables and [un]loggedness

2024-04-24 Thread David G. Johnston
On Wed, Apr 24, 2024 at 4:35 PM Michael Paquier wrote: > > I disagree here, actually. Temporary tables are a different beast > because they require automated cleanup which would include interacting > with the partitionining information if temp and non-temp relations are > mixed. That's why the

Re: Partitioned tables and [un]loggedness

2024-04-24 Thread Michael Paquier
On Thu, Apr 25, 2024 at 08:35:32AM +0900, Michael Paquier wrote: > That's why the current restrictions are in place: you should > be able to mix them. Correction due to a ENOCOFFEE: you should *not* be able to mix them. -- Michael signature.asc Description: PGP signature

Re: Remove unnecessary code rom be_lo_put()

2024-04-24 Thread Michael Paquier
On Wed, Apr 24, 2024 at 09:25:09AM -0400, Tom Lane wrote: > I agree. Do you want to do the honors? Good catch. The same check happens when the object is opened. Note that you should be able to remove utils/acl.h at the top of be-fsstubs.c as this would remove the last piece of code that does an

Re: Partitioned tables and [un]loggedness

2024-04-24 Thread Michael Paquier
On Wed, Apr 24, 2024 at 04:43:58PM -0700, David G. Johnston wrote: > My point is that if you feel that treating logged as a copy-able property > is OK then doing the following should also just work: > > postgres=# create temp table parentt ( id integer ) partition by range (id); > CREATE TABLE > p

Re: Use XLOG_CONTROL_FILE macro everywhere?

2024-04-24 Thread Michael Paquier
On Wed, Apr 24, 2024 at 12:32:46PM +0300, Anton A. Melnikov wrote: > To ensure backward compatibility we can save the old macro like this: > > #define XLOG_CONTROL_FILE "global/pg_control" > #define PG_CONTROL_FILE XLOG_CONTROL_FILE > > With the best wishes, Not sure that I wou

docs: minor typo fix for "lower(anymultirange)"

2024-04-24 Thread Ian Lawrence Barwick
Hi Here: https://www.postgresql.org/docs/current/functions-range.html#MULTIRANGE-FUNCTIONS-TABLE the description for "lower(anymultirange)": > (NULL if the multirange is empty has no lower bound). is missing "or" and should be: > (NULL if the multirange is empty or has no lower bound).

Re: Experiments with Postgres and SSL

2024-04-24 Thread Jacob Champion
On Wed, Apr 24, 2024 at 1:57 PM Peter Eisentraut wrote: > I'm concerned that there appears to be some confusion over whether ALPN > is a performance feature or a security feature. RFC 7301 appears to be > pretty clear that it's for performance, not for security. It was also designed to give bene

Re: docs: minor typo fix for "lower(anymultirange)"

2024-04-24 Thread Richard Guo
On Thu, Apr 25, 2024 at 8:40 AM Ian Lawrence Barwick wrote: > Hi > > Here: > > > https://www.postgresql.org/docs/current/functions-range.html#MULTIRANGE-FUNCTIONS-TABLE > > the description for "lower(anymultirange)": > > > (NULL if the multirange is empty has no lower bound). > > is missing "or"

Re: Cleanup: remove unused fields from nodes

2024-04-24 Thread Michael Paquier
On Wed, Apr 24, 2024 at 08:31:57AM -0400, Tom Lane wrote: > I was thinking about wording like > > * True if DEALLOCATE ALL. This is redundant with "name == NULL", > * but we make it a separate field so that exactly this condition > * (and not the precise name) will be accounted for

RE: Race condition in FetchTableStates() breaks synchronization of subscription tables

2024-04-24 Thread Zhijie Hou (Fujitsu)
On Wednesday, April 24, 2024 6:29 PM vignesh C wrote: > > On Wed, 24 Apr 2024 at 11:59, Amit Kapila wrote: > > > > On Wed, Mar 13, 2024 at 9:19 AM vignesh C wrote: > > > > > > On Tue, 12 Mar 2024 at 09:34, Ajin Cherian wrote: > > > > > > > > > > > > > > > > On Tue, Mar 12, 2024 at 2:59 PM vign

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-04-24 Thread Masahiko Sawada
On Mon, Apr 15, 2024 at 6:12 PM John Naylor wrote: > > I took a look at the coverage report from [1] and it seems pretty > good, but there are a couple more tests we could do. Thank you for checking! > > - RT_KEY_GET_SHIFT is not covered for key=0: > > https://anarazel.de/postgres/cov/16-vs-HEAD

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-04-24 Thread Masahiko Sawada
On Thu, Apr 25, 2024 at 6:03 AM Noah Misch wrote: > > On Mon, Apr 15, 2024 at 04:12:38PM +0700, John Naylor wrote: > > - Some paths for single-value leaves are not covered: > > > > https://anarazel.de/postgres/cov/16-vs-HEAD-2024-04-14/src/include/lib/radixtree.h.gcov.html#L904 > > https://anaraze

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-04-24 Thread John Naylor
On Thu, Apr 25, 2024 at 9:50 AM Masahiko Sawada wrote: > > > I saw a SIGSEGV there when using tidstore to write a fix for something else. > > Patch attached. > > Great find, thank you for the patch! +1 (This occurred to me a few days ago, but I was far from my computer.) With the purge function

Re: docs: minor typo fix for "lower(anymultirange)"

2024-04-24 Thread Michael Paquier
On Thu, Apr 25, 2024 at 09:02:34AM +0800, Richard Guo wrote: > Good catch! I checked the descriptions for "upper(anymultirange)", > "lower(anyrange)" and "upper(anyrange)", and they are all correct. We > should fix this one. +1. -- Michael signature.asc Description: PGP signature

Re: Support "Right Semi Join" plan shapes

2024-04-24 Thread Richard Guo
Here is another rebase with a commit message to help review. I also tweaked some comments. Thanks Richard v5-0001-Support-Right-Semi-Join-plan-shapes.patch Description: Binary data

Re: AIX support

2024-04-24 Thread Bruce Momjian
On Sat, Apr 20, 2024 at 12:25:47PM -0400, Tom Lane wrote: > > I can see several ways going forward: > > 1. We revert the removal of AIX support and carry on with the status quo > > ante. (The removal of AIX is a regression; it is timely and in scope > > now to revert the change.) > > 2. Like (1)

Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?

2024-04-24 Thread Michael Paquier
On Wed, Apr 24, 2024 at 01:31:12PM +0200, Daniel Gustafsson wrote: > Done. Attached are the two remaining patches, rebased over HEAD, for removing > support for OpenSSL 1.0.2 in v18. Parking them in the commitfest for now. You have mentioned once upthread the documentation of PQinitOpenSSL():

Re: AIX support

2024-04-24 Thread Michael Paquier
On Wed, Apr 24, 2024 at 11:39:37PM -0400, Bruce Momjian wrote: > On Sat, Apr 20, 2024 at 12:25:47PM -0400, Tom Lane wrote: >> So I'm totally not in favor of #1, at least not without some hard >> commitments and follow-through on really cleaning up the mess >> (which maybe looks more like your #2).

Re: AIX support

2024-04-24 Thread Tom Lane
Michael Paquier writes: > Some of the portability changes removed in 0b16bb877 feel indeed > obsolete, so it may not hurt to start an analysis from scratch to see > the minimum amount of work that would be really required with the > latest versions of xlc, using the newest compilers as a supported

Why don't we support external input/output functions for the composite types

2024-04-24 Thread Dilip Kumar
Hi, I'm curious about composite types in PostgreSQL. By default, when we create a composite type, it utilizes the "record_in" and "record_out" functions for input/output. Do you think it would be beneficial to expand the syntax to allow users to specify custom input/output functions when creating

Re: [PoC] Improve dead tuple storage for lazy vacuum

2024-04-24 Thread Masahiko Sawada
On Thu, Apr 25, 2024 at 12:17 PM John Naylor wrote: > > On Thu, Apr 25, 2024 at 9:50 AM Masahiko Sawada wrote: > > > > > I saw a SIGSEGV there when using tidstore to write a fix for something > > > else. > > > Patch attached. > > > > Great find, thank you for the patch! > > +1 > > (This occurred

Re: Why don't we support external input/output functions for the composite types

2024-04-24 Thread Tom Lane
Dilip Kumar writes: > I'm curious about composite types in PostgreSQL. By default, when we > create a composite type, it utilizes the "record_in" and "record_out" > functions for input/output. Do you think it would be beneficial to > expand the syntax to allow users to specify custom input/output

  1   2   >