RE: libpq debug log

2021-03-17 Thread tsunakawa.ta...@fujitsu.com
From: Alvaro Herrera > In pqTraceOutputString(), you can use the return value from fprintf to > move the cursor -- no need to count chars. Yes, precisely, 2 bytes for the double quotes needs to be subtracted as follows: len = fprintf(...); *cursor += (len - 2); > I still think

Re: PITR promote bug: Checkpointer writes to older timeline

2021-03-17 Thread Michael Paquier
On Wed, Mar 17, 2021 at 05:09:50PM +0900, Michael Paquier wrote: > Currently with HEAD and back branches, nothing would be broken as > logical contexts cannot exist in recovery. Still it would be easy > to miss the new behavior for anybody attempting to work more on this > feature in the future if

Re: pg_amcheck contrib application

2021-03-17 Thread Mark Dilger
> On Mar 16, 2021, at 12:52 PM, Robert Haas wrote: > > On Mon, Mar 15, 2021 at 10:10 PM Mark Dilger > wrote: >> It is unfortunate that the failing test only runs pg_amcheck after creating >> numerous corruptions, as we can't know if pg_amcheck would have complained >> about pg_statistic befo

Re: pl/pgsql feature request: shorthand for argument and local variable references

2021-03-17 Thread Pavel Stehule
st 17. 3. 2021 v 23:32 odesílatel Michael Paquier napsal: > On Wed, Mar 17, 2021 at 05:04:48PM +0100, Pavel Stehule wrote: > > This tree has a different direction than is usual, and then replacing the > > root node is not simple. > > Yeah, it is not like we should redesign this whole part just fo

Re: pg_amcheck contrib application

2021-03-17 Thread Tom Lane
Mark Dilger writes: >> On Mar 16, 2021, at 12:52 PM, Robert Haas wrote: >> Since we now know that shutting autovacuum off makes the problem go >> away, I don't see a reason to commit 0001. We should fix pg_amcheck >> instead, if, as presently seems to be the case, that's where the >> problem is.

Re: pl/pgsql feature request: shorthand for argument and local variable references

2021-03-17 Thread Pavel Stehule
st 17. 3. 2021 v 23:16 odesílatel Hannu Krosing napsal: > why are you using yet another special syntax for this ? > > would it not be better to do something like this: > CREATE FUNCTION a_reall_long_and_winding_function_name(i int, out o int) > LANGUAGE plpgsql AS $plpgsql$ > DECLARE >args fu

Re: make the stats collector shutdown without writing the statsfiles if the immediate shutdown is requested.

2021-03-17 Thread Fujii Masao
On 2021/03/18 11:59, kuroda.hay...@fujitsu.com wrote: Dear Ikeda-san, I confirmed new patch and no problem was found. Thanks. (I'm not a native English speaker, so I cannot check your comments correctly, sorry) One user-visible side-effect by this change is; with the patch, the stats is cl

Re: [HACKERS] logical decoding of two-phase transactions

2021-03-17 Thread Amit Kapila
On Wed, Mar 17, 2021 at 11:27 AM Amit Kapila wrote: > > 5. I have modified the comments atop worker.c to explain the design > and some of the problems clearly. See attached. If you are fine with > this, please include it in the next version of the patch. > I have further expanded these comments t

Re: Get memory contexts of an arbitrary backend process

2021-03-17 Thread Fujii Masao
On 2021/03/17 22:24, torikoshia wrote: I remade the patch and introduced a function pg_print_backend_memory_contexts(PID) which prints the memory contexts of the specified PID to elog. Thanks for the patch!   =# SELECT pg_print_backend_memory_contexts(450855);   ** log output **   202

Re: fdatasync performance problem with large number of DB files

2021-03-17 Thread Fujii Masao
On 2021/03/17 12:02, Thomas Munro wrote: On Tue, Mar 16, 2021 at 9:10 PM Fujii Masao wrote: Thanks for the patch! +When set to fsync, which is the default, +PostgreSQL will recursively open and fsync +all files in the data directory before crash recovery begins. Isn

Re: Detecting File Damage & Inconsistencies

2021-03-17 Thread Craig Ringer
On Mon, 15 Mar 2021 at 21:01, David Steele wrote: > On 11/18/20 5:23 AM, Simon Riggs wrote: > > On Wed, 18 Nov 2020 at 06:42, Craig Ringer > > wrote: > >> > >> On Fri, Nov 13, 2020 at 7:24 PM Simon Riggs > wrote: > >>> > >>> > >>> What I'm proposing is an option to add 16 bytes onto each COMMIT

Re: New IndexAM API controlling index vacuum strategies

2021-03-17 Thread Masahiko Sawada
On Thu, Mar 18, 2021 at 12:23 PM Peter Geoghegan wrote: > > On Wed, Mar 17, 2021 at 7:16 PM Masahiko Sawada wrote: > > Since I was thinking that always skipping index vacuuming on > > anti-wraparound autovacuum is legitimate, skipping index vacuuming > > only when we're really close to the point

Re: [PATCH] Identify LWLocks in tracepoints

2021-03-17 Thread Craig Ringer
On Thu, 11 Mar 2021 at 15:57, Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 10.03.21 06:38, Craig Ringer wrote: > > On Wed, 3 Mar 2021 at 20:50, David Steele > > wrote: > > > > On 1/22/21 6:02 AM, Peter Eisentraut wrote: > > > > This patch s

Re: New IndexAM API controlling index vacuum strategies

2021-03-17 Thread Peter Geoghegan
On Wed, Mar 17, 2021 at 11:23 PM Masahiko Sawada wrote: > Attached the updated patch that can be applied on top of your v3 patches. Some feedback on this: * I think that we can afford to be very aggressive here, because we're checking dynamically. And we're concerned about extremes only. So an a

Re: a verbose option for autovacuum

2021-03-17 Thread Michael Paquier
On Wed, Mar 17, 2021 at 08:50:26AM -0300, Euler Taveira wrote: > Since commit 5f8727f5a6, this patch doesn't apply anymore. Fortunately, it is > just a small hunk. I reviewed this patch and it looks good to me. There is > just > a small issue (double space after 'if') that I fixed in the attached

Re: fdatasync performance problem with large number of DB files

2021-03-17 Thread Fujii Masao
On 2021/03/17 12:45, Thomas Munro wrote: On Tue, Mar 16, 2021 at 9:29 PM Fujii Masao wrote: On 2021/03/16 8:15, Thomas Munro wrote: I don't want to add a hypothetical sync_after_crash=none, because it seems like generally a bad idea. We already have a running-with-scissors mode you could u

psql tab completion for \h with IMPORT FOREIGN SCHEMA

2021-03-17 Thread Michael Paquier
Hi all, Well, as $subject tells, I just found confusing that \h does not complete the so-said command, the only one using IMPORT as keyword, so I'd like to do the following: --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1493,7 +1493,7 @@ psql_completion(const char *text,

<    1   2