Re: Logical replication support for generic wal record

2022-08-21 Thread Bharath Rupireddy
On Mon, Aug 22, 2022 at 11:59 AM Natarajan R wrote: > > Hi All, > > I am writing a postgres extension which writes only generic wal record, but > this wal is not recognized by logical replication decoder. I have a basic > understanding of how logical replication(COPY command for initial sync, wa

Logical replication support for generic wal record

2022-08-21 Thread Natarajan R
Hi All, I am writing a postgres extension which writes only generic wal record, but this wal is not recognized by logical replication decoder. I have a basic understanding of how logical replication(COPY command for initial sync, wal replica for final sync) works, can you please tell us a way to s

Re: use ARM intrinsics in pg_lfind32() where available

2022-08-21 Thread John Naylor
On Sat, Aug 20, 2022 at 5:28 AM Nathan Bossart wrote: > > 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' > > ... > > #de

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

2022-08-21 Thread Amit Kapila
On Sat, Aug 20, 2022 at 10:04 AM Tom Lane wrote: > > 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 t

RE: Handle infinite recursion in logical replication setup

2022-08-21 Thread houzj.f...@fujitsu.com
On Thursday, August 18, 2022 11:13 AM Amit Kapila wrote: > > On Wed, Aug 17, 2022 at 12:34 PM Peter Smith > wrote: > > > > On Wed, Aug 17, 2022 at 4:33 PM Amit Kapila > wrote: > > > > > > On Wed, Aug 17, 2022 at 8:48 AM houzj.f...@fujitsu.com > > > wrote: > > > > > > > > On Tuesday, August 2,

Re: cataloguing NOT NULL constraints

2022-08-21 Thread Amit Langote
On Thu, Aug 18, 2022 at 6:04 PM Alvaro Herrera wrote: > On 2022-Aug-18, Laurenz Albe wrote: > > On Wed, 2022-08-17 at 20:12 +0200, Alvaro Herrera wrote: > > > 2. If a table has a primary key, and a table is created that inherits > > >from it, then the child has its column(s) marked attnotnull

Re: [PATCH] Optimize json_lex_string by batching character copying

2022-08-21 Thread John Naylor
On Sun, Aug 21, 2022 at 12:47 PM Nathan Bossart wrote: > > I spent some more time looking at this one, and I had a few ideas that I > thought I'd share. 0001 is your v6 patch with a few additional changes, > including simplying the assertions for readability, splitting out the > Vector type into

Re: shared-memory based stats collector - v70

2022-08-21 Thread Kyotaro Horiguchi
At Wed, 10 Aug 2022 14:02:34 +0200, "Drouvot, Bertrand" wrote in > what about? > > +   /* > +    * Acquire the LWLock directly instead of using > pg_stat_lock_entry_shared() > +    * which requires a reference. > +    */ > > > I think that's mor

Re: pg_receivewal and SIGTERM

2022-08-21 Thread Michael Paquier
On Fri, Aug 19, 2022 at 05:34:56PM +0530, Bharath Rupireddy wrote: > +1 to add "some" info in the docs (I'm not sure about the better > wording though), we can try to be more specific of the use case if > required. Yes, the amount of extra docs provided by the patch proposed by Christoph looks fin

Re: Supporting TAP tests with MSVC and Windows

2022-08-21 Thread Noah Misch
This (commit 13d856e of 2015-07-29) added the following: --- a/src/test/perl/TestLib.pm +++ b/src/test/perl/TestLib.pm @@ -242,7 +288,17 @@ sub command_exit_is print("# Running: " . join(" ", @{$cmd}) ."\n"); my $h = start $cmd; $h->finish(); - is($h->result(0), $expe

Re: Fix a comment in WalSnd structure

2022-08-21 Thread Michael Paquier
On Fri, Aug 19, 2022 at 05:40:40PM +0530, Bharath Rupireddy wrote: > 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. Yep, walsender.c tells the same story, aka that replyTime an

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

2022-08-21 Thread Michael Paquier
On Fri, Aug 19, 2022 at 02:22:32PM -0500, Justin Pryzby wrote: > If you trace the history back to a17923204, you'll see a comment about the > "zeroth slot", which makes it clear that the first slot it what's intended. > > I agree that it would be clearer if this were written as slots[0].connection

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

2022-08-21 Thread Peter Smith
On Fri, Aug 19, 2022 at 7:55 PM Amit Kapila wrote: > > 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:

num_sa_scans in genericcostestimate

2022-08-21 Thread Jeff Janes
When costing a btree index scan, num_sa_scans gets computed twice, once in btcostestmeate and once in genericcostestimate. But the computations are different. It looks like the generic one includes all =ANY in any column in the index, while the bt one includes only =ANY which or on columns for wh

Re: Proposal: CREATE/ALTER DOMAIN ... STORAGE/COMPRESSION = ...

2022-08-21 Thread Nikita Malakhov
Hi! I agree, domains are supposed to define data types only and are not meant to impact how these types are stored. Storage and compression strategy differ for one given type from table to table and must be defined explicitly, except for default. Also, such implicit-like storage and compression def

Re: [BUG] Logical replica crash if there was an error in a function.

2022-08-21 Thread Anton A. Melnikov
Hello! On 21.08.2022 17:33, Anton A. Melnikov wrote: Hello! Here is a fix for the bug first described in: https://www.postgresql.org/message-id/flat/adf0452f-8c6b-7def-d35e-ab516c80088e%40inbox.ru Sorry, there was a wrong patch in the first letter. Here is a right version. With best regard

[BUG] Logical replica crash if there was an error in a function.

2022-08-21 Thread Anton A. Melnikov
Hello! Here is a fix for the bug first described in: https://www.postgresql.org/message-id/flat/adf0452f-8c6b-7def-d35e-ab516c80088e%40inbox.ru Reproduction: 1) On master with 'wal_level = logical' execute mascmd.sql attached. 2) On replica substitute the correct port in repcmd.sql and execute

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

2022-08-21 Thread Zhihong Yu
On Sun, Aug 21, 2022 at 6:39 AM Julien Rouhaud wrote: > Hi, > > On Sat, Aug 20, 2022 at 02:52:29AM -0700, Zhihong Yu wrote: > > On Fri, Aug 19, 2022 at 9:31 PM Euler Taveira wrote: > > > > > > > Thanks for responding. > > > > Since pg_stat_activity shows fewer number of connections compared to t

Re: timing information for switching database

2022-08-21 Thread Junwang Zhao
*\timing* set the pset.timing flag of the global psql options, and use it in the client side to indicate whether to print the query time or not. There are two places using it, *SendQuery* and *PSQLexecWatch*, you may check these functions and add the *timing* logic in function *exec_command_connec

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

2022-08-21 Thread Julien Rouhaud
Hi, On Sat, Aug 20, 2022 at 02:52:29AM -0700, Zhihong Yu wrote: > On Fri, Aug 19, 2022 at 9:31 PM Euler Taveira wrote: > > > > Thanks for responding. > > Since pg_stat_activity shows fewer number of connections compared to the > number revealed in the error message, > I am not sure the above quer

Re: timing information for switching database

2022-08-21 Thread Pavel Stehule
Hi ne 21. 8. 2022 v 14:41 odesílatel Zhihong Yu napsal: > Hi, > In sqlsh, I issued `\timing on`. > > I don't see timing information displayed for `\c database`. > > Does someone know how I can obtain such information ? > you cannot do it in psql you can write custom application and you can me

timing information for switching database

2022-08-21 Thread Zhihong Yu
Hi, In sqlsh, I issued `\timing on`. I don't see timing information displayed for `\c database`. Does someone know how I can obtain such information ? Thanks

Re: Schema variables - new implementation for Postgres 15

2022-08-21 Thread Erik Rijkers
Op 21-08-2022 om 09:54 schreef Pavel Stehule: ne 21. 8. 2022 v 6:36 odesílatel Julien Rouhaud napsal: On Sat, Aug 20, 2022 at 08:44:49PM +0200, Erik Rijkers wrote: Op 20-08-2022 om 20:09 schreef Pavel Stehule: should be fixed now> Yep, all tests OK now. Thanks! Erik