Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)

2022-08-19 Thread Tom Lane
Amit Kapila writes: > Right, but as Tom pointed it is still better to change this. However, > I am not sure if we should backpatch this to PG15 as this won't lead > to any incorrect behavior. If that code only exists in HEAD and v15 then I'd backpatch. It's a very low-risk change and it might

Re: including pid's for `There are XX other sessions using the database`

2022-08-19 Thread Euler Taveira
On Fri, Aug 19, 2022, at 2:10 PM, Zhihong Yu wrote: > I want to poll the community on whether including proc->pid's in the error > message would be useful for troubleshooting. Such message is only useful for a parameter into a pg_stat_activity query. You don't need the PID list if you already

Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)

2022-08-19 Thread Amit Kapila
On Fri, Aug 19, 2022 at 7:45 PM Ranier Vilela wrote: > > Em sex., 19 de ago. de 2022 às 10:28, Tom Lane escreveu: >> >> Ranier Vilela writes: >> > At function parallel_vacuum_process_all_indexes there is >> > a typo with a logical connector. >> > I think that correct is &&, because both of the

sslinfo extension - add notbefore and notafter timestamps

2022-08-19 Thread Cary Huang
Hello I noticed that sslinfo extension does not have functions to return current client certificate's notbefore and notafter timestamps which are also quite important attributes in a X509 certificate. The attached patch adds 2 functions to get notbefore and notafter timestamps from the

Re: use ARM intrinsics in pg_lfind32() where available

2022-08-19 Thread Nathan Bossart
On Fri, Aug 19, 2022 at 02:26:02PM -0700, Andres Freund wrote: > Are you sure there's not an appropriate define for us to use here instead of a > configure test? E.g. > > echo|cc -dM -P -E -|grep -iE 'arm|aarch' > ... > #define __AARCH64_SIMD__ 1 > ... > #define __ARM_NEON 1 > #define

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-08-19 Thread David Zhang
Hi Ranier, Following the comment in commit 9fd45870c1436b477264c0c82eb195df52bc0919,     (The same could be done with appropriate memset() calls, but this     patch is part of an effort to phase out MemSet(), so it doesn't touch     memset() calls.) Should these obviously possible replacement

Re: use ARM intrinsics in pg_lfind32() where available

2022-08-19 Thread Andres Freund
Hi, On 2022-08-19 13:08:29 -0700, Nathan Bossart wrote: > I've tested the patch on a recent macOS (M1 Pro) and Amazon Linux > (Graviton2), and I've confirmed that the instructions aren't used on a > Linux/Intel machine. I did add a new configure check to see if the > relevant intrinsics are

FOR EACH ROW triggers, on partitioend tables, with indexes?

2022-08-19 Thread Justin Pryzby
On Wed, Aug 17, 2022 at 09:54:34AM -0500, Justin Pryzby wrote: > But an unfortunate consequence of not fixing the historic issues is that it > precludes the possibility that anyone could be expected to notice if they > introduce more instances of the same problem (as in the first half of these >

Re: Schema variables - new implementation for Postgres 15

2022-08-19 Thread Alvaro Herrera
> diff --git a/src/backend/parser/parse_relation.c > b/src/backend/parser/parse_relation.c > index f6b740df0a..b3bee39457 100644 > --- a/src/backend/parser/parse_relation.c > +++ b/src/backend/parser/parse_relation.c > @@ -3667,8 +3667,8 @@ errorMissingColumn(ParseState *pstate, >

Re: [PATCH] Optimize json_lex_string by batching character copying

2022-08-19 Thread Nathan Bossart
On Fri, Aug 19, 2022 at 03:11:36PM +0700, John Naylor wrote: > This is done. Also: > - a complete overhaul of the pg_lfind8* tests > - using a typedef for the vector type > - some refactoring, name changes and other cleanups (a few of these > could also be applied to the 32-byte element path, but

use ARM intrinsics in pg_lfind32() where available

2022-08-19 Thread Nathan Bossart
Hi hackers, This is a follow-up for recent changes that optimized [sub]xip lookups in XidInMVCCSnapshot() on Intel hardware [0] [1]. I've attached a patch that uses ARM Advanced SIMD (Neon) intrinsic functions where available to speed up the search. The approach is nearly identical to the SSE2

Re: Use array as object (src/fe_utils/parallel_slot.c)

2022-08-19 Thread Ranier Vilela
Em sex., 19 de ago. de 2022 às 16:22, Justin Pryzby escreveu: > On Fri, Aug 19, 2022 at 03:52:36PM -0300, Ranier Vilela wrote: > > Em qui., 11 de ago. de 2022 às 09:52, Ranier Vilela > escreveu: > > > > > Hi, > > > > > > One other case suspicious, which I think deserves a conference. > > > At

Re: Use array as object (src/fe_utils/parallel_slot.c)

2022-08-19 Thread Justin Pryzby
On Fri, Aug 19, 2022 at 03:52:36PM -0300, Ranier Vilela wrote: > Em qui., 11 de ago. de 2022 às 09:52, Ranier Vilela > escreveu: > > > Hi, > > > > One other case suspicious, which I think deserves a conference. > > At function wait_on_slots (src/fe_utils/parallel_slot.c) > > The variable

Re: Use array as object (src/fe_utils/parallel_slot.c)

2022-08-19 Thread Ranier Vilela
Em qui., 11 de ago. de 2022 às 09:52, Ranier Vilela escreveu: > Hi, > > One other case suspicious, which I think deserves a conference. > At function wait_on_slots (src/fe_utils/parallel_slot.c) > The variable "slots" are array, but at function call SetCancelConn, > "slots" are used as an

Re: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory

2022-08-19 Thread mahendrakar s
Changes look good to me. Thanks, Mahendrakar. On Fri, 19 Aug 2022 at 17:28, Bharath Rupireddy < bharath.rupireddyforpostg...@gmail.com> wrote: > On Fri, Aug 19, 2022 at 1:37 PM mahendrakar s > wrote: > > > > Hi Bharath, > > I reviewed your patch. Minor comments. > > Thanks. > > > 1. Why are we

including pid's for `There are XX other sessions using the database`

2022-08-19 Thread Zhihong Yu
Hi, Currently errdetail_busy_db() only shows the number of other sessions using the database but doesn't give any detail about them. For one of the customers,pg_stat_activity is showing lower number of connections compared to the number revealed in the error message. Looking at

Re: Doc patch

2022-08-19 Thread Bruce Momjian
On Fri, Oct 15, 2021 at 12:52:48PM -0400, rir wrote: > > In pgsql-docs, this patch has been recommended to you. > > Lacking consensus and so not included is the the deletion of > comments pointing between the ref/MOVE and FETCH files. These > were of the form: > > Sorry, I am just

Re: MultiXact\SLRU buffers configuration

2022-08-19 Thread i . lazarev
Andrey Borodin wrote 2022-08-18 06:35: I like the idea of one knob instead of one per each SLRU. Maybe we even could deduce sane value from NBuffers? That would effectively lead to 0 knobs :) Your patch have a prefix "v22-0006", does it mean there are 5 previous steps of the patchset? Thank

Re: Issue in postgresql installation - Target version Postgresql 14.

2022-08-19 Thread Bruce Momjian
First, this is not an appropriate question for hackers. Second, this is a question for the package manager where you got the pre-built software. --- On Fri, Aug 19, 2022 at 03:39:29AM +0530, kavya chandren wrote: > Dear

Issue in postgresql installation - Target version Postgresql 14.

2022-08-19 Thread kavya chandren
Dear team, We are facing issues during installation of postgresql at our environment. This command completed with no errors. dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm Then we ran this command dnf install

Re: Trivial doc patch

2022-08-19 Thread Bruce Momjian
On Sat, Oct 16, 2021 at 01:11:49PM -0400, rir wrote: > On Sat, Oct 16, 2021 at 11:14:46AM +0900, Michael Paquier wrote: > > On Fri, Oct 15, 2021 at 01:13:14PM -0400, rir wrote: > > > This removes the outer square brackets in the create_database.sgml > > > file's synopsis. In the command sysopses,

Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)

2022-08-19 Thread Ranier Vilela
Em sex., 19 de ago. de 2022 às 10:28, Tom Lane escreveu: > Ranier Vilela writes: > > At function parallel_vacuum_process_all_indexes there is > > a typo with a logical connector. > > I think that correct is &&, because both of the operators are > > bool types [1]. > > As a result, parallel

Re: SQL/JSON features for v15

2022-08-19 Thread Jonathan S. Katz
Hi, On 8/17/22 11:45 PM, Nikita Glukhov wrote: Hi, On 17.08.2022 04:45, Jonathan S. Katz wrote: On 8/15/22 10:14 PM, Andres Freund wrote: I pushed a few cleanups to https://github.com/anarazel/postgres/commits/json while I was hacking on this (ignore that it's based on the meson tree,

Re: Strip -mmacosx-version-min options from plperl build

2022-08-19 Thread Tom Lane
Peter Eisentraut writes: > After analyzing the source code of ExtUtils::Embed's ldopts, I think we > can also do this by subtracting $Config{ldflags}, since > my $linkage = "$ccdlflags $ldflags @archives $ld_or_bs"; > and we really just want the $ld_or_bs part. (@archives should be empty > for

Re: MERGE and parsing with prepared statements

2022-08-19 Thread Justin Pryzby
On Fri, Aug 12, 2022 at 01:53:25PM +0200, Alvaro Herrera wrote: > On 2022-Aug-12, Simon Riggs wrote: > > > Sorry, but I disagree with this chunk in the latest commit, > > specifically, changing the MATCHED from after to before the NOT > > MATCHED clause. 3d895bc84 also moved a semicolon into the

Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)

2022-08-19 Thread Tom Lane
Ranier Vilela writes: > At function parallel_vacuum_process_all_indexes there is > a typo with a logical connector. > I think that correct is &&, because both of the operators are > bool types [1]. > As a result, parallel vacuum workers can be incorrectly enabled. Since they're bools, the C spec

Re: Reducing planning time on tables with many indexes

2022-08-19 Thread David Geier
On 8/1/22 15:33, David Geier wrote: Hi Tom, On Wed, Jul 27, 2022 at 7:15 PM Tom Lane wrote: I wrote: > Unfortunately, as things stand today, the planner needs more than the > right to look at the indexes' schemas, because it makes physical accesses > to btree indexes

Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)

2022-08-19 Thread Amit Kapila
On Fri, Aug 19, 2022 at 5:40 PM Bharath Rupireddy wrote: > > On Fri, Aug 19, 2022 at 5:35 PM Ranier Vilela wrote: > > > > Hi, > > > > At function parallel_vacuum_process_all_indexes there is > > a typo with a logical connector. > > > > I think that correct is &&, because both of the operators

Fix a comment in WalSnd structure

2022-08-19 Thread Bharath Rupireddy
Hi, WalSnd structure mutex is being used to protect all the variables of that structure, not just 'variables shown above' [1]. A tiny patch attached to fix the comment. Thoughts? [1] diff --git a/src/include/replication/walsender_private.h b/src/include/replication/walsender_private.h index

Re: Fix typo with logical connector (src/backend/commands/vacuumparallel.c)

2022-08-19 Thread Bharath Rupireddy
On Fri, Aug 19, 2022 at 5:35 PM Ranier Vilela wrote: > > Hi, > > At function parallel_vacuum_process_all_indexes there is > a typo with a logical connector. > > I think that correct is &&, because both of the operators are > bool types [1]. > > As a result, parallel vacuum workers can be

Re: pg_receivewal and SIGTERM

2022-08-19 Thread Bharath Rupireddy
On Fri, Aug 19, 2022 at 4:24 PM Christoph Berg wrote: > > Re: Bharath Rupireddy > > pg_receivewal will exit with status 0 when > > - terminated by the SIGINT signal. (That is the > > + terminated by the SIGINT or > > + SIGTERM signal. (That is the > > normal way to end it. Hence

Fix typo with logical connector (src/backend/commands/vacuumparallel.c)

2022-08-19 Thread Ranier Vilela
Hi, At function parallel_vacuum_process_all_indexes there is a typo with a logical connector. I think that correct is &&, because both of the operators are bool types [1]. As a result, parallel vacuum workers can be incorrectly enabled. Attached a trivial fix. regards, Ranier Vilela [1]

Re: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory

2022-08-19 Thread Bharath Rupireddy
On Fri, Aug 19, 2022 at 1:37 PM mahendrakar s wrote: > > Hi Bharath, > I reviewed your patch. Minor comments. Thanks. > 1. Why are we not using durable_unlink instead of unlink to remove the > partial tmp files? durable_unlink() issues fsync on the parent directory, if used, those fsync()

Re: logical decoding and replication of sequences, take 2

2022-08-19 Thread Tomas Vondra
I've been thinking about the two optimizations mentioned at the end a bit more, so let me share my thoughts before I forget that: On 8/18/22 23:10, Tomas Vondra wrote: > > ... > > And maybe we could then use the LSN to read the increment from the WAL > during decoding, instead of having to read

Re: pg_receivewal and SIGTERM

2022-08-19 Thread Christoph Berg
Re: Bharath Rupireddy > pg_receivewal will exit with status 0 when > - terminated by the SIGINT signal. (That is the > + terminated by the SIGINT or > + SIGTERM signal. (That is the > normal way to end it. Hence it is not an error.) For fatal errors or > other signals, the

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

2022-08-19 Thread Amit Kapila
On Fri, Aug 19, 2022 at 3:05 PM Peter Smith wrote: > > On Fri, Aug 19, 2022 at 7:10 PM Amit Kapila wrote: > > > > On Fri, Aug 19, 2022 at 2:36 PM Peter Smith wrote: > > > > > > Here are my review comments for the v23-0005 patch: > > > > > > == > > > > > > Commit Message says: > > >

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

2022-08-19 Thread Peter Smith
On Fri, Aug 19, 2022 at 7:10 PM Amit Kapila wrote: > > On Fri, Aug 19, 2022 at 2:36 PM Peter Smith wrote: > > > > Here are my review comments for the v23-0005 patch: > > > > == > > > > Commit Message says: > > main_worker_pid is Process ID of the main apply worker, if this process is a > >

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

2022-08-19 Thread Amit Kapila
On Fri, Aug 19, 2022 at 2:36 PM Peter Smith wrote: > > Here are my review comments for the v23-0005 patch: > > == > > Commit Message says: > main_worker_pid is Process ID of the main apply worker, if this process is a > apply background worker. NULL if this process is a main apply worker or a

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

2022-08-19 Thread Peter Smith
Here are my review comments for the v23-0005 patch: == Commit Message says: main_worker_pid is Process ID of the main apply worker, if this process is a apply background worker. NULL if this process is a main apply worker or a synchronization worker. The new column can make it easier to

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

2022-08-19 Thread Amit Kapila
On Thu, Aug 18, 2022 at 5:14 PM Amit Kapila wrote: > > On Wed, Aug 17, 2022 at 11:58 AM wangw.f...@fujitsu.com > wrote: > > > > Attach the new patches. > > > > Few comments on v23-0001 > === > Some more comments on v23-0001 1. static bool

Re: [PATCH] Optimize json_lex_string by batching character copying

2022-08-19 Thread John Naylor
On Tue, Aug 16, 2022 at 4:23 AM Nathan Bossart wrote: > > On Mon, Aug 15, 2022 at 08:33:21PM +0700, John Naylor wrote: > > +#ifdef USE_SSE2 > > + chunk = _mm_loadu_si128((const __m128i *) [i]); > > +#else > > + memcpy(, [i], sizeof(chunk)); > > +#endif

Re: pg_receivewal fail to streams when the partial file to write is not fully initialized present in the wal receiver directory

2022-08-19 Thread mahendrakar s
Hi Bharath, I reviewed your patch. Minor comments. 1. Why are we not using durable_unlink instead of unlink to remove the partial tmp files? 2. Below could be a simple if(shouldcreatetempfile){} else{} as in error case we need to return NULL. + if (errno != ENOENT || !shouldcreatetempfile) + { +

Re: [PATCH] Compression dictionaries for JSONB

2022-08-19 Thread Nikita Malakhov
Hi hackers! I've got a partly question, partly proposal for the future development of this feature: What if we use pg_dict table not to store dictionaries but to store dictionaries' meta, and actual dictionaries to be stored in separate tables like it is done with TOAST tables (i.e. pg_dict. -->

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

2022-08-19 Thread Peter Smith
Here are some review comments for the patch v23-0004: == 4.1 src/test/subscription/t/032_streaming_apply.pl This test file was introduced in patch 0003, but I think there are a few changes in this 0004 patch which are really have nothing to do with 0004 and should have been included in the

Re: Strip -mmacosx-version-min options from plperl build

2022-08-19 Thread Peter Eisentraut
On 18.08.22 15:53, Tom Lane wrote: Agreed on rejecting -mmacosx-version-min, but I wonder if we should think about adopting a whitelist-instead-of-blacklist approach to adopting stuff from perl_embed_ldflags. ISTR that in pltcl we already use the approach of accepting only -L and -l, and

Re: shared-memory based stats collector - v70

2022-08-19 Thread Drouvot, Bertrand
Hi, On 8/18/22 9:51 PM, Andres Freund wrote: Hi, On 2022-08-18 15:26:31 -0400, Greg Stark wrote: And indexes of course. It's a bit frustrating since without the catalog you won't know what table the index actually is for... But they're pretty important stats. FWIW, I think we should split