Re: Extract numeric filed in JSONB more effectively

2023-08-21 Thread Andy Fan
> > >>> Perhaps one of the more senior developers will chime in, but to me, >>> leaving out the relabel nodes looks more like "all of PostgreSQL's >>> type checking happened before the SupportRequestSimplify, so nothing >>> has noticed that we rewrote the tree with mismatched types, and as >>>

Re: Testing autovacuum wraparound (including failsafe)

2023-08-21 Thread Michael Paquier
On Wed, Jul 12, 2023 at 01:47:51PM +0200, Daniel Gustafsson wrote: > +# bump the query timeout to avoid false negatives on slow test syetems. > +$ENV{PG_TEST_TIMEOUT_DEFAULT} = 600; > Does this actually work? Utils.pm read the environment variable at compile > time in the BEGIN block so this

Re: DecodeInterval fixes

2023-08-21 Thread Michael Paquier
On Mon, Jul 10, 2023 at 10:42:31AM -0700, Jacob Champion wrote: > On Mon, Jul 10, 2023 at 10:19 AM Reid Thompson > wrote: >> I made a another pass through the separated patches, it looks good to >> me. > > LGTM too. (Thanks Tom for the clarification on ECPG.) +SELECT INTERVAL '42 days 2

Re: PG 16 draft release notes ready

2023-08-21 Thread David Rowley
On Tue, 22 Aug 2023 at 10:08, Bruce Momjian wrote: > > On Sat, Aug 19, 2023 at 04:24:48AM +0200, Erwin Brandstetter wrote: > > I posted to pgsql-docs first, but was kindly redirected here by Jonathan: > > > > The release notes for Postgres 16 says here: > >

Re: pg_rewind WAL segments deletion pitfall

2023-08-21 Thread Michael Paquier
On Fri, Aug 18, 2023 at 03:40:57PM +0900, torikoshia wrote: > Thanks for the patch, I've marked this as ready-for-committer. > > BTW, this issue can be considered a bug, right? > I think it would be appropriate to provide backpatch. Hmm, I agree that there is a good argument in back-patching as

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Amit Kapila
On Tue, Aug 22, 2023 at 7:19 AM Peter Smith wrote: > > Here are some review comments for v23-0001 > > == > 1. GENERAL -- git apply > > The patch fails to apply cleanly. There are whitespace warnings. > > [postgres@CentOS7-x64 oss_postgres_misc]$ git apply >

Re: persist logical slots to disk during shutdown checkpoint

2023-08-21 Thread Amit Kapila
On Mon, Aug 21, 2023 at 6:36 PM Ashutosh Bapat wrote: > > On Sun, Aug 20, 2023 at 8:40 AM Amit Kapila wrote: > > > > The other possibility is that we introduce yet another dirty flag for > > slots, say dirty_for_shutdown_checkpoint which will be set when we > > update confirmed_flush LSN. The

Re: Make all Perl warnings fatal

2023-08-21 Thread Michael Paquier
On Mon, Aug 21, 2023 at 11:51:24AM -0400, Andrew Dunstan wrote: > It's not really the same as -Werror, because many warnings can be generated > at runtime rather than compile-time. > > Still, I guess that might not matter too much since apart from plperl we > only use perl for building / testing.

Re: should frontend tools use syncfs() ?

2023-08-21 Thread Michael Paquier
On Mon, Aug 21, 2023 at 07:06:32PM -0700, Nathan Bossart wrote: > This would look something like the attached patch. I think this is nicer. > With this patch, we don't have to choose between including fd.h or > redefining the macros in the frontend code. Yes, this one is moving the needle in the

Re: [PATCH] Add function to_oct

2023-08-21 Thread John Naylor
On Tue, Aug 22, 2023 at 3:10 AM Dean Rasheed wrote: > > OK, cool. This looks good to me. LGTM too. -- John Naylor EDB: http://www.enterprisedb.com

Re: Extract numeric filed in JSONB more effectively

2023-08-21 Thread Andy Fan
(Just relalized this was sent to chap in private, resent it again). On Mon, Aug 21, 2023 at 6:50 PM Andy Fan wrote: > > > On Mon, Aug 21, 2023 at 11:19 AM Chapman Flack > wrote: > >> On 2023-08-20 21:31, Andy Fan wrote: >> > Highlighting the user case of makeRelableType is interesting! But

Re: Oversight in reparameterize_path_by_child leading to executor crash

2023-08-21 Thread Richard Guo
On Tue, Aug 22, 2023 at 4:48 AM Tom Lane wrote: > I spent some time reviewing the v4 patch. I noted that > path_is_reparameterizable_by_child still wasn't modeling the pass/fail > behavior of reparameterize_path_by_child very well, because that > function checks this at every recursion level: >

Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500

2023-08-21 Thread Jian Guo
Sure, Tomas. Here is the PG Commitfest link: https://commitfest.postgresql.org/44/4510/ From: Tomas Vondra Sent: Monday, August 21, 2023 18:56 To: Jian Guo ; Hans Buschmann ; pgsql-hackers@lists.postgresql.org Cc: Zhenghua Lyu Subject: Re: Wrong rows

Re: should frontend tools use syncfs() ?

2023-08-21 Thread Nathan Bossart
On Tue, Aug 22, 2023 at 10:50:01AM +0900, Michael Paquier wrote: > On Mon, Aug 21, 2023 at 06:44:07PM -0700, Nathan Bossart wrote: >> I'm hoping there's a simpler path forward here. pg_rewind only needs the >> following lines from fd.h: >> >> /* Filename components */ >> #define

Re: should frontend tools use syncfs() ?

2023-08-21 Thread Michael Paquier
On Mon, Aug 21, 2023 at 06:44:07PM -0700, Nathan Bossart wrote: > I'm hoping there's a simpler path forward here. pg_rewind only needs the > following lines from fd.h: > > /* Filename components */ > #define PG_TEMP_FILES_DIR "pgsql_tmp" > #define PG_TEMP_FILE_PREFIX

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Peter Smith
Here are some review comments for v23-0001 == 1. GENERAL -- git apply The patch fails to apply cleanly. There are whitespace warnings. [postgres@CentOS7-x64 oss_postgres_misc]$ git apply ../patches_misc/v23-0001-Always-persist-to-disk-logical-slots-during-a-sh.patch

Re: should frontend tools use syncfs() ?

2023-08-21 Thread Nathan Bossart
On Tue, Aug 22, 2023 at 08:56:26AM +0900, Michael Paquier wrote: > --- a/src/include/storage/fd.h > +++ b/src/include/storage/fd.h > @@ -43,15 +43,11 @@ > #ifndef FD_H > #define FD_H > > +#ifndef FRONTEND > + > #include > #include > > Ugh. So you need this part because pg_rewind's

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Peter Smith
Hi Kuroda-san, Here are some review comments for v22-0003. (FYI, I was already mid-way through this review before you posted new v23* patches, so I am posting it anyway in case some comments still apply.) == src/bin/pg_upgrade/check.c 1. check_for_lost_slots + /* logical slots can be

Re: Logging of matching pg_hba.conf entry during auth skips trust auth, potential security issue

2023-08-21 Thread Michael Paquier
On Mon, Aug 21, 2023 at 07:43:56PM -0400, Isaac Morland wrote: > I hope we're not really considering removing the "trust" method. For > testing and development purposes it's very handy — just tell the database, > running in a VM, to allow all connections and just believe who they say > they are

Re: should frontend tools use syncfs() ?

2023-08-21 Thread Michael Paquier
On Fri, Aug 18, 2023 at 09:01:11AM -0700, Nathan Bossart wrote: > On Thu, Aug 17, 2023 at 12:50:31PM +0900, Michael Paquier wrote: >> SyncMethod may be a bit too generic as name for the option structure. >> How about a PGSyncMethod or pg_sync_method? > > In v4, I renamed this to DataDirSyncMethod

Re: Logging of matching pg_hba.conf entry during auth skips trust auth, potential security issue

2023-08-21 Thread Jacob Champion
On Mon, Aug 21, 2023 at 4:22 PM Michael Paquier wrote: > There are additionally two more comments in the SSL tests that could > be removed, I guess. Here's a v4, with Robert's latest suggestion > added. LGTM. > I am not sure that we need to change this historic term, TBH. Perhaps > it would

Re: Logging of matching pg_hba.conf entry during auth skips trust auth, potential security issue

2023-08-21 Thread Isaac Morland
On Mon, 21 Aug 2023 at 19:23, Michael Paquier wrote: I am not sure that we need to change this historic term, TBH. Perhaps > it would be shorter to just rip off the trust method from the tree > with a deprecation period but that's not something I'm much in favor > off either (I use it daily for

Re: should frontend tools use syncfs() ?

2023-08-21 Thread Michael Paquier
On Mon, Aug 21, 2023 at 04:08:46PM -0400, Robert Haas wrote: > Doesn't seem worth it to me. I think --no-sync is more intuitive than > --sync-method=none, it's certainly shorter, and it's a pretty > important setting because we use it when running the regression tests. No arguments against that

Re: Logging of matching pg_hba.conf entry during auth skips trust auth, potential security issue

2023-08-21 Thread Michael Paquier
On Mon, Aug 21, 2023 at 10:49:16AM -0700, Jacob Champion wrote: > On Sun, Aug 20, 2023 at 4:58 PM Michael Paquier wrote: > > Attached is a v3 to do these two things, with adjustments for two SSL > > tests. Any objections about it? > > (Sorry for the long weekend delay.) No objections; you may

Re: Logging of matching pg_hba.conf entry during auth skips trust auth, potential security issue

2023-08-21 Thread Michael Paquier
On Mon, Aug 21, 2023 at 09:27:51AM -0400, Robert Haas wrote: > + * No authentication identity was set; this happens e.g. when the > + * trust method is in use. For audit purposes, log a breadcrumb to > + * explain where in the HBA this happened. > > Proposed rewrite: "Normally, if

Re: PG 16 draft release notes ready

2023-08-21 Thread Bruce Momjian
On Sat, Aug 19, 2023 at 04:24:48AM +0200, Erwin Brandstetter wrote: > I posted to pgsql-docs first, but was kindly redirected here by Jonathan: > > The release notes for Postgres 16 says here: > https://www.postgresql.org/docs/16/release-16.html#RELEASE-16-PERFORMANCE > > Same as here: >

Re: PG 16 draft release notes ready

2023-08-21 Thread Bruce Momjian
On Sat, Aug 19, 2023 at 12:59:47PM -0400, Bruce Momjian wrote: > On Thu, Aug 17, 2023 at 08:37:28AM +0300, Pavel Luzanov wrote: > > I can try to explain how I understand it myself. > > > > In v15 and early, inheritance of granted to role privileges depends on > > INHERIT attribute of a role: > >

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-08-21 Thread Jeff Davis
On Mon, 2023-08-21 at 15:14 -0400, Robert Haas wrote: > Another, related thing that I recently discovered would > be useful is a way to say "I'd like to switch the search_path to X, > but I'd also like to discover what the prevailing search_path was > just > before entering this function."

Re: Oversight in reparameterize_path_by_child leading to executor crash

2023-08-21 Thread Tom Lane
I spent some time reviewing the v4 patch. I noted that path_is_reparameterizable_by_child still wasn't modeling the pass/fail behavior of reparameterize_path_by_child very well, because that function checks this at every recursion level: /* * If the path is not parameterized by the

Re: SLRUs in the main buffer pool - Page Header definitions

2023-08-21 Thread Robert Haas
On Fri, Aug 18, 2023 at 12:15 PM Nathan Bossart wrote: > I think I agree with Stephen. We routinely make changes that require > updates to extensions, and I doubt anyone is terribly wild about > maintaining two SLRU systems for several years. Yeah, maintaining two systems doesn't sound like a

Re: [PATCH] Add function to_oct

2023-08-21 Thread Dean Rasheed
On Mon, 21 Aug 2023 at 20:15, Nathan Bossart wrote: > > I added some examples for negative inputs. > > I renamed it to to_bin(). > > I reordered the functions in the docs. > OK, cool. This looks good to me. Regards, Dean

Re: should frontend tools use syncfs() ?

2023-08-21 Thread Robert Haas
On Wed, Aug 16, 2023 at 11:50 PM Michael Paquier wrote: > >> Do we actually need --no-sync at all if --sync-method is around? We > >> could have an extra --sync-method=none at option level with --no-sync > >> still around mainly for compatibility? Or perhaps that's just > >> over-designing

Re: C function to return double precision[][]

2023-08-21 Thread Joe Conway
On 8/21/23 15:31, Markur Sens wrote: Is there any piece of code I could see how to achieve $subject ? I haven’t found anything in the standard library or contrib modules. I’m trying to build ArrayType ** of sorts and return a Datum of those but I can’t seem to manage memory correctly. There

Re: Optimize Arm64 crc32 implementation in PostgreSQL

2023-08-21 Thread Nathan Bossart
On Mon, Aug 21, 2023 at 09:32:42AM +, Xiang Gao wrote: > Currently PostgreSQL has three different variants of a 32-bit CRC > calculation: CRC-32C, CRC-32(Ethernet polynomial), > and a legacy CRC-32 version that uses the lookup table. Some ARMv8 (AArch64) > CPUs implement the CRC32 extension

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-08-21 Thread Jeff Davis
On Sat, 2023-08-19 at 11:59 -0700, Andres Freund wrote: > If you install a bunch of extensions into public - very very > common from what I have seen - you can't really remove public from > the search > path. Which then basically makes all approaches of resolving any of > the > security issues via

C function to return double precision[][]

2023-08-21 Thread Markur Sens
Is there any piece of code I could see how to achieve $subject ? I haven’t found anything in the standard library or contrib modules. I’m trying to build ArrayType ** of sorts and return a Datum of those but I can’t seem to manage memory correctly.

Re: [PATCH] Add function to_oct

2023-08-21 Thread Nathan Bossart
On Mon, Aug 21, 2023 at 09:31:37AM +0100, Dean Rasheed wrote: > Hmm, I think just including the doc text update, without the examples > of positive and negative inputs, might not be sufficient to make the > meaning clear to everyone. I added some examples for negative inputs. > Something else

Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }

2023-08-21 Thread Robert Haas
On Wed, Aug 16, 2023 at 1:45 PM Jeff Davis wrote: > On Wed, 2023-08-16 at 08:51 +0200, Peter Eisentraut wrote: > > On 12.08.23 04:35, Jeff Davis wrote: > > > The attached patch implements a new SEARCH clause for CREATE > > > FUNCTION. > > > The SEARCH clause controls the search_path used when

Re: Logging of matching pg_hba.conf entry during auth skips trust auth, potential security issue

2023-08-21 Thread Jacob Champion
On Sun, Aug 20, 2023 at 4:58 PM Michael Paquier wrote: > Attached is a v3 to do these two things, with adjustments for two SSL > tests. Any objections about it? (Sorry for the long weekend delay.) No objections; you may want to adjust the comment above the test block in t/001_password.pl, as

Re: [17] Special search_path names "!pg_temp" and "!pg_catalog"

2023-08-21 Thread Jeff Davis
On Sat, 2023-08-19 at 07:18 +0200, Pavel Stehule wrote: > cannot be better special syntax > > CREATE OR REPLACE FUNCTION xxx() > RETURNS yyy AS $$ ... $$$ > SET SEARCH_PATH DISABLE > > with possible next modification > > SET SEARCH_PATH CATALOG .. only for pg_catalog > SET SEARCH_PATH MINIMAL

Re: Make all Perl warnings fatal

2023-08-21 Thread Andrew Dunstan
On 2023-08-21 Mo 02:20, Peter Eisentraut wrote: To avoid a complete bloodbath on cfbot, here is an updated patch set that includes a workaround for the getprotobyname() issue mentioned below. On 10.08.23 07:58, Peter Eisentraut wrote: We have a lot of Perl scripts in the tree, mostly code

Re: meson: pgxs Makefile.global differences

2023-08-21 Thread Tristan Partin
On Mon Aug 21, 2023 at 10:33 AM CDT, Andrew Dunstan wrote: On 2023-08-17 Th 16:51, Andres Freund wrote: > Hi, > > On 2023-08-17 14:45:54 -0500, Tristan Partin wrote: >> On Thu Aug 17, 2023 at 2:32 PM CDT, Andrew Dunstan wrote: >>> I started digging into a warning I noticed on my FDW builds

Re: meson: pgxs Makefile.global differences

2023-08-21 Thread Peter Eisentraut
On 21.08.23 17:33, Andrew Dunstan wrote: Where should we do that? And how about the -g that's also missing for debug-enabled builds? I think it's the options in these two tables that meson handles internally and that we should explicitly reproduce for Makefile.global:

Re: meson: pgxs Makefile.global differences

2023-08-21 Thread Andrew Dunstan
On 2023-08-17 Th 16:51, Andres Freund wrote: Hi, On 2023-08-17 14:45:54 -0500, Tristan Partin wrote: On Thu Aug 17, 2023 at 2:32 PM CDT, Andrew Dunstan wrote: I started digging into a warning I noticed on my FDW builds where Postgres is built with meson,

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-21 Thread Önder Kalacı
Hi, Thanks for the explanation. As described in the commit message, we assume that extensions use the > hook in a similar way to FDWs I'm not sure if it is fair to assume that extensions use any hook in any way. So my question is: does the Citus extension use the hook like this? > (Sorry, I

Re: BUG #18059: Unexpected error 25001 in stored procedure

2023-08-21 Thread Robert Haas
On Sat, Aug 19, 2023 at 1:19 PM Tom Lane wrote: > What I'm inclined to propose, therefore, is that we make revalidation > be a no-op for every statement type for which transformStmt() reaches > its default: case. (When it does so, the resulting CMD_UTILITY Query > will not get any processing

Re: Logging of matching pg_hba.conf entry during auth skips trust auth, potential security issue

2023-08-21 Thread Robert Haas
On Sun, Aug 20, 2023 at 7:58 PM Michael Paquier wrote: > Attached is a v3 to do these two things, with adjustments for two SSL > tests. Any objections about it? + * No authentication identity was set; this happens e.g. when the + * trust method is in use. For audit purposes, log a breadcrumb

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Hayato Kuroda (Fujitsu)
Dear Hou, Thank you for reviewing! The patch can be available in [1]. > 1. > > +check_for_lost_slots(ClusterInfo *cluster) > +{ > + int i, > + ntups, > + i_slotname; > + PGresult *res; > + DbInfo

Re: persist logical slots to disk during shutdown checkpoint

2023-08-21 Thread Ashutosh Bapat
On Sun, Aug 20, 2023 at 8:40 AM Amit Kapila wrote: > > On Sat, Aug 19, 2023 at 12:46 PM Julien Rouhaud wrote: > > > > On Sat, 19 Aug 2023, 14:16 Amit Kapila, wrote: > >> > > > >> The idea discussed in the thread [1] is to always persist logical > >> slots to disk during the shutdown checkpoint.

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Hayato Kuroda (Fujitsu)
Dear Peter, Thank you for reviewing! The patch can be available in [1]. > Commit Message > > 1. > This commit allows nodes with logical replication slots to be upgraded. While > reading information from the old cluster, a list of logical replication slots > is > newly extracted. At the later

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Hayato Kuroda (Fujitsu)
Dear Sawada-san, Thank you for reviewing! New patch set can be available in [1]. > > 0001: > > Do we need regression tests to make sure that the slot's > confirmed_flush_lsn matches the LSN of the latest shutdown_checkpoint > record? Added. I wondered the location of the test, but put on

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Hayato Kuroda (Fujitsu)
Dear Amit, Thank you for giving comments! PSA new version patch set. > 1. > + ALTER > SUBSCRIPTION ... DISABLE. > + After the upgrade is complete, execute the > + ALTER SUBSCRIPTION ... CONNECTION > command to update the > + connection string, and then re-enable the subscription.

Re: Support run-time partition pruning for hash join

2023-08-21 Thread Andy Fan
On Mon, Aug 21, 2023 at 11:48 AM Richard Guo wrote: > If we have a hash join with an Append node on the outer side, something > like > > Hash Join >Hash Cond: (pt.a = t.a) >-> Append > -> Seq Scan on pt_p1 pt_1 > -> Seq Scan on pt_p2 pt_2 > -> Seq Scan on

Reproducibility (Re: Remove distprep)

2023-08-21 Thread Christoph Berg
Re: Michael Paquier > Is reproducibility something you've brought to a separate thread? > FWIW, I'd be interested in improving this area for the in-core code, > if need be. (Not material for this thread, of course). All the "normal" things like C compilation are actually already reproducible.

Re: Oversight in reparameterize_path_by_child leading to executor crash

2023-08-21 Thread Ashutosh Bapat
On Mon, Aug 21, 2023 at 4:09 PM Richard Guo wrote: > > > On Sun, Aug 20, 2023 at 11:48 PM Tom Lane wrote: >> >> I looked over the v3 patch. I think it's going in generally >> the right direction, but there is a huge oversight: >> path_is_reparameterizable_by_child does not come close to

Re: POC PATCH: copy from ... exceptions to: (was Re: VLDB Features)

2023-08-21 Thread torikoshia
Since v5 patch failed applying anymore, updated the patch. On 2023-03-23 02:50, Andres Freund wrote: I suggest adding a few more tests: - COPY with a datatype error that can't be handled as a soft error I didn't know proper way to test this, but I've found data type widget's input function

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-21 Thread Etsuro Fujita
Sorry, I hit the send button by mistake. On Sun, Aug 20, 2023 at 4:34 AM Andres Freund wrote: > On 2023-08-19 20:09:25 +0900, Etsuro Fujita wrote: > > * The problem we had with the set_join_pathlist_hook hook is that in > > such a typical use case, previously, if the replaced joins had any > >

Re: postgres_fdw: wrong results with self join + enable_nestloop off

2023-08-21 Thread Etsuro Fujita
Hi, On Sun, Aug 20, 2023 at 4:34 AM Andres Freund wrote: > > Hi, > > On 2023-08-19 20:09:25 +0900, Etsuro Fujita wrote: > > Maybe my explanation was not enough, so let me explain: > > > > * I think you could use the set_join_pathlist_hook hook as you like at > > your own responsibility, but

Re: Extract numeric filed in JSONB more effectively

2023-08-21 Thread Andy Fan
> > > Interestingly, when I relabel both places, like this: > > Oid targetOid = fexpr->funcresulttype; > Const *target = makeConst( >OIDOID, -1, InvalidOid, sizeof(Oid), >ObjectIdGetDatum(targetOid), false, true); > RelabelType *rTarget = makeRelabelType((Expr

Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500

2023-08-21 Thread Tomas Vondra
On 8/21/23 10:16, Jian Guo wrote: > Hi hackers, > > I found a new approach to fix this issue, which seems better, so I would > like to post another version of the patch here. The origin patch made > the assumption of the values of Vars from CTE must be unique, which > could be very wrong. This

Re: Fix typo in src/interfaces/libpq/po/zh_CN.po

2023-08-21 Thread Zhang Mingli
> > This was fixed by Peter as mentioned upthread, but the translations are > maintained in its own Git repository so the commit is not visible in the main > Git repo. Translations are synced with the main repo before releases. The > commit can be seen here: > >

Re: Oversight in reparameterize_path_by_child leading to executor crash

2023-08-21 Thread Richard Guo
On Sun, Aug 20, 2023 at 11:48 PM Tom Lane wrote: > I looked over the v3 patch. I think it's going in generally > the right direction, but there is a huge oversight: > path_is_reparameterizable_by_child does not come close to modeling > the success/failure conditions of

Re: Adding a LogicalRepWorker type field

2023-08-21 Thread Amit Kapila
On Mon, Aug 21, 2023 at 5:34 AM Peter Smith wrote: > > On Fri, Aug 18, 2023 at 6:16 PM Zhijie Hou (Fujitsu) > wrote: > > > > On Friday, August 18, 2023 11:20 AM Amit Kapila > > wrote: > > > > > > On Mon, Aug 14, 2023 at 12:08 PM Peter Smith > > > wrote: > > > > > > > > The main patch for

Re: [dsm] comment typo

2023-08-21 Thread Junwang Zhao
On Mon, Aug 21, 2023 at 5:16 PM Daniel Gustafsson wrote: > > > On 18 Aug 2023, at 11:10, Junwang Zhao wrote: > > > > In the following sentence, I believe either 'the' or 'a' should be kept, not > > both. I here keep the 'the', but feel free to change. > > > * handle: The handle of an existing

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Zhijie Hou (Fujitsu)
On Friday, August 18, 2023 9:52 PM Kuroda, Hayato/黒田 隼人 wrote: > > Dear Peter, > > PSA new version patch set. Thanks for updating the patch! Here are few comments about 0003 patch. 1. +check_for_lost_slots(ClusterInfo *cluster) +{ + int i, +

Re: Fix typo in src/interfaces/libpq/po/zh_CN.po

2023-08-21 Thread Daniel Gustafsson
> On 19 Aug 2023, at 13:36, Zhang Mingli wrote: > >> On Aug 16, 2023, at 22:24, Peter Eisentraut wrote: >> >> On 16.08.23 09:34, Zhang Mingli wrote: >>> The Chinese words there are ok, but the `Unix-domian` should be >>> `Unix-domain`. >> >> fixed, thanks > > Hi, Peter, thanks and just

RE: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Zhijie Hou (Fujitsu)
On Monday, August 21, 2023 11:21 AM Amit Kapila wrote: > > On Sun, Aug 20, 2023 at 6:49 PM Masahiko Sawada > wrote: > > > > On Thu, Aug 17, 2023 at 10:31 PM Amit Kapila > wrote: > > > > > > > > > > > Sorry I was not clear. I meant the logical replication slots that > > > > are > > > > *not*

Optimize Arm64 crc32 implementation in PostgreSQL

2023-08-21 Thread Xiang Gao
Hi all, Currently PostgreSQL has three different variants of a 32-bit CRC calculation: CRC-32C, CRC-32(Ethernet polynomial), and a legacy CRC-32 version that uses the lookup table. Some ARMv8 (AArch64) CPUs implement the CRC32 extension which is equivalent with CRC-32(Ethernet polynomial), so

Re: [dsm] comment typo

2023-08-21 Thread Daniel Gustafsson
> On 18 Aug 2023, at 11:10, Junwang Zhao wrote: > > In the following sentence, I believe either 'the' or 'a' should be kept, not > both. I here keep the 'the', but feel free to change. > * handle: The handle of an existing object, or for DSM_OP_CREATE, the > - *a new handle the caller

Re: UUID v7

2023-08-21 Thread Andrey M. Borodin
> On 20 Aug 2023, at 23:56, Andrey M. Borodin wrote: > > I've observed, that pre-generating and buffering random numbers makes UUID generation 10 times faster. Without buffering postgres=# with x as (select gen_uuid_v7() from generate_series(1,1e6)) select count(*) from x; Time: 5286.572

Re: [PATCH] Add function to_oct

2023-08-21 Thread Dean Rasheed
On Sun, 20 Aug 2023 at 16:25, Nathan Bossart wrote: > > On Sat, Aug 19, 2023 at 08:35:46AM +0100, Dean Rasheed wrote: > > > The way that negative inputs are handled really should be documented, > > or at least it should include a couple of examples. > > I used your suggestion and noted that the

Re: pg_upgrade - typo in verbose log

2023-08-21 Thread Daniel Gustafsson
> On 18 Aug 2023, at 02:47, Michael Paquier wrote: > > On Thu, Aug 17, 2023 at 06:09:31PM +1000, Peter Smith wrote: >> Ping. > > Funnily enough, I was looking at this entry yesterday, before you > replied, and was wondering what's happening here. It was a combination of summer vacation, doing

Re: Wrong rows estimations with joins of CTEs slows queries by more than factor 500

2023-08-21 Thread Jian Guo
Hi hackers, I found a new approach to fix this issue, which seems better, so I would like to post another version of the patch here. The origin patch made the assumption of the values of Vars from CTE must be unique, which could be very wrong. This patch examines variables for Vars inside CTE,

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-08-21 Thread Peter Smith
Oops - now with attachments On Mon, Aug 21, 2023 at 5:56 PM Peter Smith wrote: > Hi Melih, > > Last week we revisited your implementation of design#2. Vignesh rebased > it, and then made a few other changes. > > PSA v28* > > The patch changes include: > * changed the logic slightly by setting

Re: [PATCH] Reuse Workers and Replication Slots during Logical Replication

2023-08-21 Thread Peter Smith
Hi Melih, Last week we revisited your implementation of design#2. Vignesh rebased it, and then made a few other changes. PSA v28* The patch changes include: * changed the logic slightly by setting recv_immediately(new variable), if this variable is set the main apply worker loop will not wait

Re: Pgoutput not capturing the generated columns

2023-08-21 Thread Rajendra Kumar Dangwal
Thanks Euler, Greatly appreciate your inputs. > Should pgoutput provide a complete row? Probably. If it is an option that > defaults to false and doesn't impact performance. Yes, it would be great if this feature can be implemented. > The logical replication design decides to compute the

Re: dubious warning: FORMAT JSON has no effect for json and jsonb types

2023-08-21 Thread Amit Langote
On Fri, Aug 18, 2023 at 2:59 PM Peter Eisentraut wrote: > On 16.08.23 16:59, Merlin Moncure wrote: > > On Wed, Aug 16, 2023 at 8:55 AM Peter Eisentraut > > wrote: > > > > This warning comes from parse_expr.c transformJsonValueExpr() and is > > triggered for

Re: WIP: new system catalog pg_wait_event

2023-08-21 Thread Drouvot, Bertrand
Hi, On 8/20/23 10:07 AM, Michael Paquier wrote: On Sat, Aug 19, 2023 at 06:30:12PM +0200, Drouvot, Bertrand wrote: Thanks, fixed in v10. Okay. I have done an extra review of it, simplifying a few things in the function, the comments and the formatting, and applied the patch. Thanks!

Re: Remove distprep

2023-08-21 Thread Michael Paquier
On Fri, Aug 18, 2023 at 10:22:47AM +0200, Christoph Berg wrote: > Yes, mostly. Since autoconf had not seen a new release for so long, > everyone started to patch it, and one of the things that Debian and > others added was --runstatedir=DIR. The toolchain is also using it, > it's part of the

Re: [PoC] pg_upgrade: allow to upgrade publisher node

2023-08-21 Thread Peter Smith
Here are some review comments for v22-0002 == Commit Message 1. This commit allows nodes with logical replication slots to be upgraded. While reading information from the old cluster, a list of logical replication slots is newly extracted. At the later part of upgrading, pg_upgrade revisits

Re: Doc limitation update proposal: include out-of-line OID usage per TOAST-ed columns

2023-08-21 Thread Gurjeet Singh
On Wed, Apr 26, 2023 at 4:48 AM David Rowley wrote: > > On Sun, 23 Apr 2023, 3:42 am Gurjeet Singh, wrote: >> >> I anticipate that edits to Appendix K Postgres Limits will prompt >> improving the note in there about the maximum column limit, That note >> is too wordy, and sometimes confusing,