Re: logical decoding and replication of sequences

2022-02-24 Thread Peter Eisentraut
On 23.02.22 12:10, Amit Kapila wrote: Isn't it better to support this with a syntax as indicated by Tom in one of his earlier emails on this topic [1]? IIUC, it would be as follows: CREATE PUBLICATION p FOR ALL TABLES, ALL SEQUENCES; I don't think there is any point in supporting this. What F

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-24 Thread Amit Kapila
On Thu, Feb 24, 2022 at 2:24 PM Peter Smith wrote: > > 9. src/backend/postmaster/pgstat.c - pgstat_recv_subscription_purge > > static void > pgstat_recv_subscription_purge(PgStat_MsgSubscriptionPurge *msg, int len) > { > /* Return if we don't have replication subscription statistics */ > if (subsc

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-24 Thread Masahiko Sawada
On Thu, Feb 24, 2022 at 6:53 PM Peter Eisentraut wrote: > > On 24.02.22 02:32, Masahiko Sawada wrote: > > On Wed, Feb 23, 2022 at 12:08 PM Peter Smith wrote: > >> > >> Hi. Below are my review comments for the v1 patch. > > > > Thank you for the comments! I've attached the latest version patch > >

Re: Uniforms the errors msgs at tuplestore paths

2022-02-24 Thread Michael Paquier
On Thu, Feb 24, 2022 at 08:30:02AM -0300, Ranier Vilela wrote: > Thanks for the commit Michael. No problem. For the archives, this is e77216f. -- Michael signature.asc Description: PGP signature

Re: Typo in pgbench messages.

2022-02-24 Thread Michael Paquier
On Thu, Feb 24, 2022 at 06:38:57PM +0900, Tatsuo Ishii wrote: > >> I think you are right. In English there's should be no space between > >> number and "%". > >> AFAIK other parts of PostgreSQL follow the rule. > > I think it's better to back-patch this to stable branches if there's > no objectio

Re: [PATCH] Expose port->authn_id to extensions and triggers

2022-02-24 Thread Michael Paquier
On Thu, Feb 24, 2022 at 12:15:40AM +, Jacob Champion wrote: > Stephen pointed out [1] that the authenticated identity that's stored > in MyProcPort can't be retrieved by extensions or triggers. Attached is > a patch that provides both a C API and a SQL function for retrieving > it. > > GetAuth

Re: Uniforms the errors msgs at tuplestore paths

2022-02-24 Thread Ranier Vilela
Em dom., 20 de fev. de 2022 às 22:45, Ranier Vilela escreveu: > Em dom., 20 de fev. de 2022 às 22:08, Michael Paquier > escreveu: > >> On Sun, Feb 20, 2022 at 11:37:33AM -0300, Ranier Vilela wrote: >> > I can't see: >> > plperl.c >> > pl_exec.c >> > pttcl.c >> > >> > Only jsonfuncs.c, but the er

Re: make tuplestore helper function

2022-02-24 Thread Michael Paquier
On Mon, Feb 21, 2022 at 04:41:17PM +0900, Michael Paquier wrote: > So, I got my hands on this area, and found myself applying 07daca5 as > a first piece of the puzzle. Anyway, after more review today, I have > bumped into more pieces that could be consolidated, and finished with > the following pa

Re: Optionally automatically disable logical replication subscriptions on error

2022-02-24 Thread Amit Kapila
On Thu, Feb 24, 2022 at 1:20 PM Masahiko Sawada wrote: > > Here are some comments: > > Why do we need SyncTableStartWrapper() and ApplyLoopWrapper()? > I have given this comment to move the related code to separate functions to slightly simplify ApplyWorkerMain() code but if you don't like we can

Re: Readd use of TAP subtests

2022-02-24 Thread Peter Eisentraut
Now that we have switched everything to done_testing(), the subtests feature isn't that relevant anymore, but it might still be useful to get better output when running with PROVE_FLAGS=--verbose. Compare before: t/001_basic.pl .. 1..8 ok 1 - vacuumlo --help exit code 0 ok 2 - vacuumlo --help

Re: PATCH: add "--config-file=" option to pg_rewind

2022-02-24 Thread Aleksander Alekseev
Hi hackers, > It took me a while to understand the meaning of -c. Maybe > changing it to --restore-target-wal will make it easier to > understand. +1, I "stumbled" while reading this too at first. -- Best regards, Aleksander Alekseev

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-24 Thread Peter Eisentraut
On 24.02.22 02:32, Masahiko Sawada wrote: On Wed, Feb 23, 2022 at 12:08 PM Peter Smith wrote: Hi. Below are my review comments for the v1 patch. Thank you for the comments! I've attached the latest version patch that incorporated all comments I got so far. The primary change from the previou

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-24 Thread Peter Eisentraut
On 23.02.22 03:14, Andres Freund wrote: Why are the stats stored in the per-database stats file / as a second level below the database? While they're also associated with a database, it's a global catalog, so it seems to make more sense to have them "live" globally as well? pg_subscription bein

Re: Extract epoch from Interval weird behavior

2022-02-24 Thread Aleksander Alekseev
Hi Joseph, > > Is this truncation on purpose? It seems like > > EXTRACT is not accounting for leap years in > > it's calculation. Extracting an epoch from an interval is quite a strange case since intervals are not connected to any specific dates. For instance: select extract('epoch' from inter

Re: Typo in pgbench messages.

2022-02-24 Thread Tatsuo Ishii
>> I think you are right. In English there's should be no space between number >> and "%". >> AFAIK other parts of PostgreSQL follow the rule. I think it's better to back-patch this to stable branches if there's no objection. Thought? Best reagards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: h

Re: PATCH: add "--config-file=" option to pg_rewind

2022-02-24 Thread Alexander Kukushkin
Hello Gunnar, On Thu, 24 Feb 2022 at 10:03, Aleksander Alekseev wrote: > > wants to use the "-c" option on a typical Debian/Ubuntu installation > > (where the config resides below /etc/postgresql/), pg_rewind needs a way > > to be told where the postgresql.conf actually is. > > > > The attached

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-24 Thread Peter Eisentraut
On 21.02.22 17:17, Andres Freund wrote: Hi, On 2022-02-21 14:49:01 +0530, Amit Kapila wrote: On Mon, Feb 21, 2022 at 1:18 PM Andres Freund wrote: * stats_reset (Time at which these statistics were last reset) The view name could be pg_stat_subscription_lrep, pg_stat_logical_replication, or s

Re: Proposal: Support custom authentication methods using hooks

2022-02-24 Thread Aleksander Alekseev
Hi Samay, > I wanted to submit a patch to expose 2 new hooks (one for the authentication > check and another one for error reporting) in auth.c. These will allow users > to implement their own authentication methods for Postgres or add custom > logic around authentication. I like the idea - Po

Re: PATCH: add "--config-file=" option to pg_rewind

2022-02-24 Thread Aleksander Alekseev
Hi Gunnar, > During a Patroni PR discussion > (https://github.com/zalando/patroni/pull/2225), we realised that if one > wants to use the "-c" option on a typical Debian/Ubuntu installation > (where the config resides below /etc/postgresql/), pg_rewind needs a way > to be told where the postgresql.

Re: Support logical replication of DDLs

2022-02-24 Thread Aleksander Alekseev
Hi Zheng, > >Also, I suspect that implementing it may be a bit challenging. What if we > >focus on table-level replication for now? > > I think it is due to the fact that the current limitations in logical > replication are > holding it back in major version upgrade (MVU). Online / reduced downtim

Re: Design of pg_stat_subscription_workers vs pgstats

2022-02-24 Thread Peter Smith
Hi. Below are my review comments for the v2 patch. == 1. Commit message This patch changes the pg_stat_subscription_workers view (introduced by commit 8d74fc9) so that it stores only statistics counters: apply_error_count and sync_error_count, and has one entry for subscription. SUGGESTION

Re: [BUG] Panic due to incorrect missingContrecPtr after promotion

2022-02-24 Thread Kyotaro Horiguchi
At Thu, 24 Feb 2022 16:26:42 +0900 (JST), Kyotaro Horiguchi wrote in > So, actually WAL did not ended in an incomplete record. I think > FinishWalRecover is the last place to do that. (But it could be > earlier.) After some investigation, I finally concluded that we should reset abortedRecPtr

RE: Logical replication timeout problem

2022-02-24 Thread kuroda.hay...@fujitsu.com
Dear Wang, Thank you for teaching some backgrounds about the patch. > According to our discussion, we need to send keepalive messages to subscriber > when skipping changes. > One approach is that **for each skipped change**, we try to send keepalive > message by calculating whether a timeout will

<    1   2