Re: POC: GROUP BY optimization

2024-04-24 Thread jian he
hi. I found an interesting case. 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_seqscan = off; EXPLAIN (COSTS

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

2024-04-24 Thread Amit Kapila
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 Commitfest entry for this: > >> https://commitfest.postgresql.org/47/4816/

Re: Fix parallel vacuum buffer usage reporting

2024-04-24 Thread Masahiko Sawada
On Mon, Apr 22, 2024 at 5:07 PM 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. >>

Feature request: schema diff tool

2024-04-24 Thread Neszt Tibor
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 the schema diff management is much more

Re: ecpg_config.h symbol missing with meson

2024-04-24 Thread Peter Eisentraut
On 17.04.24 18:15, Tom Lane wrote: Peter Eisentraut writes: I checked the generated ecpg_config.h with make and meson, and the meson one is missing #define HAVE_LONG_LONG_INT 1 This is obviously quite uninteresting, since that is required by C99. But it would be more satisfactory if we

Re: Extend ALTER DEFAULT PRIVILEGES for large objects

2024-04-24 Thread Yugo NAGATA
On Tue, 23 Apr 2024 23:47:38 -0400 Tom Lane wrote: > Yugo NAGATA writes: > > Currently, ALTER DEFAULT PRIVILEGE doesn't support large objects, > > so if we want to allow users other than the owner to use the large > > object, we need to grant a privilege on it every time a large object > > is

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

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

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

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

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?

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

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

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: 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

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

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

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: 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

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: 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

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

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

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, ); > break; > > Commit f4b54e1ed98 introduced macros for

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

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

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]

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

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

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

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

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

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: 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: 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)

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

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)

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

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

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

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

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... > >

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)

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

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

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

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

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

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: 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

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

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: 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

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: 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

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

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: 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

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

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],

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 |

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:

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 >

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: 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: 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 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

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: 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

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

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: 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

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

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

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

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 > >

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

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: 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 >

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

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: > >

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: 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

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

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: Why don't we support external input/output functions for the composite types

2024-04-24 Thread Dilip Kumar
On Thu, Apr 25, 2024 at 10:14 AM Tom Lane wrote: > > 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 > >

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 Michael Paquier
On Thu, Apr 25, 2024 at 12:20:05AM -0400, Tom Lane wrote: > It would definitely make sense for a new port to start by getting > things going with gcc only, and then look at resurrecting xlc > support. Sriram mentioned upthread that he was looking at both of them. I'd be ready to assume that most

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

Re: Is it acceptable making COPY format extendable?

2024-04-24 Thread Sutou Kouhei
Hi, Thanks for replying this. In <02cccd36-3083-4a50-aae4-f957e96fb...@eisentraut.org> "Re: Is it acceptable making COPY format extendable?" on Wed, 24 Apr 2024 09:57:38 +0200, Peter Eisentraut wrote: >> I'm proposing a patch that making COPY format extendable: >>

Re: Introduce XID age and inactive timeout based replication slot invalidation

2024-04-24 Thread Bharath Rupireddy
On Mon, Apr 22, 2024 at 7:21 PM Masahiko Sawada wrote: > > > Please find the attached v35 patch. > > The documentation says about both 'active' and 'inactive_since' > columns of pg_replication_slots say: > > --- > active bool > True if this slot is currently actively being used > > inactive_since

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

Re: Avoid orphaned objects dependencies, take 3

2024-04-24 Thread Bertrand Drouvot
Hi, On Wed, Apr 24, 2024 at 03:00:00PM +0300, Alexander Lakhin wrote: > 24.04.2024 11:38, Bertrand Drouvot wrote: > > I gave more thought to v2 and the approach seems reasonable to me. > > Basically what > > it does is that in case the object is already dropped before we take the > > new lock >

Re: cataloguing NOT NULL constraints

2024-04-24 Thread Alexander Lakhin
24.04.2024 20:36, Alvaro Herrera wrote: So I added a restriction that we only accept such a change when recursively adding a constraint, or during binary upgrade. This should limit the damage: you're no longer able to change an existing constraint from NO INHERIT to YES INHERIT merely by doing

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

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

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

  1   2   >