Re: lastOverflowedXid does not handle transaction ID wraparound

2021-11-07 Thread Kyotaro Horiguchi
At Sat, 6 Nov 2021 19:16:09 +0300, Alexander Korotkov wrote in > Pushed! Thanks! -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Allow escape in application_name

2021-11-07 Thread Kyotaro Horiguchi
At Sun, 7 Nov 2021 13:35:39 +0900, Fujii Masao wrote in > > > On 2021/11/05 12:17, Kyotaro Horiguchi wrote: > If possible, I'd like to see this change as a separate patch > and commt it first because this is the description for > the existing parameter postgres_fdw.

Re: Commitfest 2021-11 Patch Triage - Part 1

2021-11-07 Thread Kyotaro Horiguchi
he patch has support it will be marked as returned with feedback > during this CF unless revived. I'll soon repost a rebased version. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Make mesage at end-of-recovery less scary.

2021-11-07 Thread Kyotaro Horiguchi
At Fri, 22 Oct 2021 17:54:40 +, "Bossart, Nathan" wrote in > On 3/4/21, 10:50 PM, "Kyotaro Horiguchi" wrote: > > As the result, the following messages are emitted with the attached. > > I'd like to voice my support for this effort, and I intend to

Re: Commitfest 2021-11 Patch Triage - Part 1

2021-11-07 Thread Kyotaro Horiguchi
up the good pieces this seems > > like > > a contender to close for now. > > That's in my area, so I have signed up as reviewer. I noticed I'm one of the author^^; I'll also look into the comments and try to address them. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2021-11-08 Thread Kyotaro Horiguchi
x27;t seem actually used. 0003: The fix. I didn't touch this. 0004: Removed at all. I agree to Tom. (And I faintly remember that I said something like that.) regards. -- Kyotaro Horiguchi NTT Open Source Software Center >From aa6b0b94e42550f23c4cecfa23ea1face7d71bc6 Mon Sep 17 00:00:0

Re: Make mesage at end-of-recovery less scary.

2021-11-08 Thread Kyotaro Horiguchi
Thank you for the comments! At Tue, 9 Nov 2021 09:53:15 +0900, Michael Paquier wrote in > On Mon, Nov 08, 2021 at 02:59:46PM +0900, Kyotaro Horiguchi wrote: > > While checking the behavior for the case of missing-contrecord, I > > noticed that emode_for_corrupt_record()

Re: Improve error context after some failed XLogReadRecord()

2021-11-08 Thread Kyotaro Horiguchi
cord while sending logically-decoded data:". The same with above, I'm not strongly opposed to the current wording. Otherwise it looks good to me. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2021-11-09 Thread Kyotaro Horiguchi
At Tue, 9 Nov 2021 12:51:15 +0900, Michael Paquier wrote in > On Mon, Nov 08, 2021 at 05:55:16PM +0900, Kyotaro Horiguchi wrote: > > I have quickly looked at the patch set. > > > 0001: (I don't remember about this, though) I don't see how to make it > > work

Re: Frontend error logging style

2021-11-09 Thread Kyotaro Horiguchi
QerrorMessage(conn)); > pg_log_error_detail("query was: %s", sql.data); So pg_log_generic(_v) have an additional parameter, say, detailed bool. pg_log_generic(enum pg_log_level level, bool detailed, const char *pg_restrict fmt,...) Considering that the level is use

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2021-11-10 Thread Kyotaro Horiguchi
At Tue, 09 Nov 2021 17:05:49 +0900 (JST), Kyotaro Horiguchi wrote in > At Tue, 9 Nov 2021 12:51:15 +0900, Michael Paquier > wrote in > > Look at Utils.pm where we have dir_symlink, then. symlink() does not > > work on WIN32, so we have a wrapper that uses junction points.

Re: Frontend error logging style

2021-11-10 Thread Kyotaro Horiguchi
7;t DETAIL and HINT expected to be hidden at the targetted cutoff level? In other words, I suspect that people want to hide non-primary messages for a lower verbosity level. On the other hand I'm not sure it is a proper behavior that log_level = WARNING causes ERROR messages are accompanied by DETAIL/HINT submessages... regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2021-11-10 Thread Kyotaro Horiguchi
th a backup directory not using a symlink. One way would be taking a backup with tentative tablespace directory in the short-named temporary directory then move it into the backup direcotry. I'm going that way for now. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2021-11-11 Thread Kyotaro Horiguchi
At Thu, 11 Nov 2021 11:13:52 +0900 (JST), Kyotaro Horiguchi wrote in > At Wed, 10 Nov 2021 09:14:30 -0300, Alvaro Herrera > wrote in > > Can you use PostgreSQL::Test::Utils::tempdir_short() for those > > tablespaces? > > Thanks for the suggestion! > > It

Re: CREATE tab completion

2021-11-18 Thread Kyotaro Horiguchi
to do it? > > That looks fine per se. FWIW, I would be a bit perplexed to see type names suggested in upper-cases, even if it is acceptable by the parser. If you type-in the following phrase: =# type boo it is completed to "boolean" but, =# type BOO doesn't respond.

An obsolete comment of pg_stat_statements

2021-11-21 Thread Kyotaro Horiguchi
posed to be a valid value, otherwise this function dosen't * calucate it by its own as before then returns immediately. regards. -- Kyotaro Horiguchi NTT Open Source Software Center diff --git a/contrib/pg_stat_statements/pg_stat_statements.c b/contrib/pg_stat_statements/pg_stat_statemen

Re: An obsolete comment of pg_stat_statements

2021-11-21 Thread Kyotaro Horiguchi
At Mon, 22 Nov 2021 15:38:23 +0900 (JST), Kyotaro Horiguchi wrote in > * queryId is supposed to be a valid value, otherwise this function dosen't > * calucate it by its own as before then returns immediately. Mmm. That's bad. This is the correted version. * queryId is

Re: Protect syscache from bloating with negative cache entries

2018-03-23 Thread Kyotaro HORIGUCHI
Hello. At Wed, 21 Mar 2018 15:28:07 -0400, David Steele wrote in <43095b16-14fc-e4d8-3310-2b86eaaab...@pgmasters.net> > On 3/15/18 1:12 AM, Kyotaro HORIGUCHI wrote: > > At Mon, 12 Mar 2018 17:34:08 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI > > wrote in > >

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-25 Thread Kyotaro HORIGUCHI
this is the value returned. > > > > Docs are updated with the new behavior of the functions. > > Updated patch attached with behavior of returning NULL for connections of > CONNECTION_BAD status. The patch does Assert() in PQhost. I suppose that Assert() in client library is usable only when no more (library's) operation cannot continue. It would be better to return a fallback value in this criteria. regards, -- Kyotaro Horiguchi NTT Open Source Software Center

Re: [bug fix] ECPG: freeing memory for pgtypes crashes on Windows

2018-03-25 Thread Kyotaro HORIGUCHI
250, utf8_and_cyrillic, utf8_and_iso8859 and utf8_and_sjis2004. regards, -- Kyotaro Horiguchi NTT Open Source Software Center diff --git a/doc/src/sgml/ecpg.sgml b/doc/src/sgml/ecpg.sgml index 98b6840520..3b8a7abaec 100644 --- a/doc/src/sgml/ecpg.sgml +++ b/doc/src/sgml/ecpg.sgml @@ -1951,9 +1951,1

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-26 Thread Kyotaro HORIGUCHI
Hello. At Mon, 26 Mar 2018 17:49:22 +1100, Haribabu Kommi wrote in > On Mon, Mar 26, 2018 at 4:17 PM, Michael Paquier > wrote: > > > On Mon, Mar 26, 2018 at 11:28:41AM +0900, Kyotaro HORIGUCHI wrote: > > > At Sun, 25 Mar 2018 22:27:09 +1100, Haribabu Kommi < &

Re: PostgreSQL crashes with SIGSEGV

2018-03-26 Thread Kyotaro HORIGUCHI
and actually fixes the problem. For 10+, copying is controlled by the caller side, but only tuplesort_getdatum() didn't make the copy in the caller context. It is just an overlook and the fix looks reasonable. I'm not appropriate for checking comment wording but it makes sense for me. If no one objects, I'll mark this as Ready for Commit in a couple of days. reagards, -- Kyotaro Horiguchi NTT Open Source Software Center

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-27 Thread Kyotaro HORIGUCHI
ctions return parameters values established at connection > and, except for the multi-valued fail-over accessors PQhost and PQport, as > well as PQpass, cannot change during the lifetime of the PGconn object. It is not directly related to fail-over (if the word menas reconnection to the next available server after an involuntary disconnection). Putting that aside, I'm not sure it makes any difference.. > PQpass is a bit odd here given its not multi-valued...not sure what if > anything to make of that. password can vary with host and port using .pgpass. regards, -- Kyotaro Horiguchi NTT Open Source Software Center

Re: PostgreSQL crashes with SIGSEGV

2018-03-27 Thread Kyotaro HORIGUCHI
At Mon, 26 Mar 2018 20:40:51 -0700, Peter Geoghegan wrote in > On Mon, Mar 26, 2018 at 5:14 AM, Kyotaro HORIGUCHI > wrote: > >> Attached patches do it that way. I'm happy with what I came up with, > >> which is a lot simpler than my first approach. The extra co

Re: Problem while setting the fpw with SIGHUP

2018-03-27 Thread Kyotaro HORIGUCHI
kPointerMain, which is just the same thing with InitPostgres, but before setting up signal handler to avoid processing SIGHUP before being ready to insert xlog. regards, -- Kyotaro Horiguchi NTT Open Source Software Center diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmas

Re: Problem while setting the fpw with SIGHUP

2018-03-27 Thread Kyotaro HORIGUCHI
At Tue, 27 Mar 2018 22:02:26 +0900, Michael Paquier wrote in <20180327130226.ga1...@paquier.xyz> > On Tue, Mar 27, 2018 at 09:01:20PM +0900, Kyotaro HORIGUCHI wrote: > > The current UpdateFullPageWrites is safe on standby and promotion > > so what we should consider is only

Re: Problem while setting the fpw with SIGHUP

2018-03-28 Thread Kyotaro HORIGUCHI
At Wed, 28 Mar 2018 15:59:48 +0900, Michael Paquier wrote in <20180328065948.gm1...@paquier.xyz> > On Wed, Mar 28, 2018 at 03:40:59PM +0900, Kyotaro HORIGUCHI wrote: > > The attached does that. I don't like that it uses ControlFileLock > > to exlucde concurren

Re: PQHost() undefined behavior if connecting string contains both host and hostaddr types

2018-03-28 Thread Kyotaro HORIGUCHI
>> > >> Committed after fixing up the documentation a bit as suggested by others. > > > > Thanks. > > +1. Thanks for working on this Hari, Peter for the commit and all > others for your input! Me too. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: [HACKERS] WAL logging problem in 9.4.3?

2018-03-29 Thread Kyotaro HORIGUCHI
Hello. I found that c203d6cf81 hit this and this is the rebased version on the current master. regards, -- Kyotaro Horiguchi NTT Open Source Software Center >From 3dac5baf787dc949cfb22a698a0d72b6eb48e75e Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Date: Tue, 12 Sep 2017 13:01:33 +0

Re: Protect syscache from bloating with negative cache entries

2018-03-29 Thread Kyotaro HORIGUCHI
At Thu, 29 Mar 2018 18:22:59 -0700, Andres Freund wrote in <20180330012259.7k3442yz7jigh...@alap3.anarazel.de> > On 2018-03-23 17:01:11 +0900, Kyotaro HORIGUCHI wrote: > > Hello. > > > > At Wed, 21 Mar 2018 15:28:07 -0400, David Steele > > wrote in &

Re: Speedup of relation deletes during recovery

2018-03-29 Thread Kyotaro HORIGUCHI
that FinishPreparedTransaction has the same loop over smgrdounlink. regards, -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Protect syscache from bloating with negative cache entries

2018-03-29 Thread Kyotaro HORIGUCHI
At Thu, 29 Mar 2018 18:51:45 -0700, Andres Freund wrote in <20180330015145.pvsr6kjtf6tw4...@alap3.anarazel.de> > Hi, > > On 2018-03-30 10:35:48 +0900, Kyotaro HORIGUCHI wrote: > > 0002-0004 is new, in response to the comment that caches other > > than the catcache ou

Re: Question about WalSndWriteData

2018-03-29 Thread Kyotaro HORIGUCHI
d_time| last_msg_receipt_time | 2018-03-30 14:18:55.270096+09 latest_end_lsn| 0/1C0FDA70 latest_end_time | 2018-03-30 14:18:48.268534+09 > Sorry, I have not received confirmation whether it is a bug or not and > is it going to be fixed. So, my diagnosis is that this is apparently a bug, which should be fixed as Konstantin is proposing. And it should be back-patched? regards, -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Commit 4dba331cb3 broke ATTACH PARTITION behaviour.

2018-03-30 Thread Kyotaro HORIGUCHI
ls the just added default partition to get_default_oid_from_partdesc too early. The revealed partition has immature constraint and it overrites the right constraint generated just above. ATExecAttachPartition checks for default partition oid twice but the second is just needless before the commit an

Re: Commit 4dba331cb3 broke ATTACH PARTITION behaviour.

2018-04-02 Thread Kyotaro HORIGUCHI
her to write a test for that. How is it broken? Every attaching partitions are checked for the specified partition bound and every partitions of the default partition are also checked against the new default part bound. We already hold required locks on all the participants. > Anyway, I'm just an onlooker fixing a CommandCounterIncrement change. It's reassuring. Thanks. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Problem while setting the fpw with SIGHUP

2018-04-04 Thread Kyotaro HORIGUCHI
At Sat, 31 Mar 2018 17:43:58 +0530, Amit Kapila wrote in > On Wed, Mar 28, 2018 at 12:10 PM, Kyotaro HORIGUCHI > wrote: > > At Tue, 27 Mar 2018 22:02:26 +0900, Michael Paquier > > wrote in <20180327130226.ga1...@paquier.xyz> > >> On Tue, Mar 27, 2018 at 09

Re: [HACKERS] GUC for cleanup indexes threshold.

2018-04-05 Thread Kyotaro HORIGUCHI
think it should be "Per-index". Attached a patch for fixing it. And > sorry for missing it at review. > > Regards, -- Kyotaro Horiguchi NTT Open Source Software Center diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index 505a67e6ed..b920d

Re: Problem while setting the fpw with SIGHUP

2018-04-06 Thread Kyotaro HORIGUCHI
Hello. At Wed, 04 Apr 2018 17:26:46 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180404.172646.238325981.horiguchi.kyot...@lab.ntt.co.jp> > > In general, I was wondering why in the first place this variable > > (full_page_writes) is a SIGHUP variable? I think

Re: [HACKERS] GUC for cleanup indexes threshold.

2018-04-06 Thread Kyotaro HORIGUCHI
At Fri, 6 Apr 2018 10:52:58 +0900, Masahiko Sawada wrote in > On Thu, Apr 5, 2018 at 7:23 PM, Teodor Sigaev wrote: > > Thanks to everyone, fixes are pushed except nodeMerge.c, I don't wish to > > increase entropy around MERGE patch :) No problem. Thanks! > Thank you!

Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least 9.5)?

2018-04-08 Thread Kyotaro HORIGUCHI
Hello, I added this as Older Bugs in Open items. (I believe it's legit.) The latest patch still applies on the HEAD with some offsets. At Tue, 23 Jan 2018 18:50:00 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180123.185000.232069302.horiguchi.kyot...@lab.ntt.co.jp> &

Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least 9.5)?

2018-04-08 Thread Kyotaro HORIGUCHI
At Mon, 9 Apr 2018 13:59:45 +0900, Michael Paquier wrote in <20180409045945.gb1...@paquier.xyz> > On Mon, Apr 09, 2018 at 01:26:54PM +0900, Kyotaro HORIGUCHI wrote: > > Hello, I added this as Older Bugs in Open items. (I believe it's > > legit.) > > Yes, I think

Re: Problem while setting the fpw with SIGHUP

2018-04-09 Thread Kyotaro HORIGUCHI
At Fri, 6 Apr 2018 17:59:58 +0530, Amit Kapila wrote in > On Fri, Apr 6, 2018 at 1:50 PM, Kyotaro HORIGUCHI > wrote: > > Hello. > > > > At Wed, 04 Apr 2018 17:26:46 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI > > wrote in > > <20180404.172646.23

Re: Optimizing nested ConvertRowtypeExpr execution

2018-04-09 Thread Kyotaro HORIGUCHI
bose select (a, b, c)::t1p1p1::t1p1::t1 from (select i, i * 2, > i * 3 from generate_series(0, 10) i) x(a, b, c); > QUERY PLAN > ----- ... >Output: (ROW(i.i, (i.i * 2), (i.i * 3))::t1p1p1)::t1 Conversions between scalar values cannot be assumed safely composed each other for general inputs but it is known to be safe for the ConvertRowtypeExpr case.. I think. regards, -- Kyotaro Horiguchi NTT Open Source Software Center

Fixing a trivial typo in comment in rewriteManip.c

2018-04-09 Thread Kyotaro HORIGUCHI
While I was looking on some patch, I happened to notice that there's a trivial typo in rewriteManip.c > a ConvertRowTypeExpr to map back to the rowtype expected by the expression. The correct name for "ConvertRowTypeExpr" is "ConvertRowtypeExpr" regards, -- Kyota

Re: Optimizing nested ConvertRowtypeExpr execution

2018-04-09 Thread Kyotaro HORIGUCHI
At Mon, 9 Apr 2018 15:53:04 +0530, Ashutosh Bapat wrote in > On Mon, Apr 9, 2018 at 3:49 PM, Kyotaro HORIGUCHI > wrote: > > > > I don't think it is not only on constatns. With the patch, > > non-constants are .. getting a rather strange conversion. > > &g

Re: Optimizing nested ConvertRowtypeExpr execution

2018-04-09 Thread Kyotaro HORIGUCHI
At Mon, 9 Apr 2018 16:07:33 +0530, Ashutosh Bapat wrote in > On Mon, Apr 9, 2018 at 3:53 PM, Ashutosh Bapat > wrote: > > On Mon, Apr 9, 2018 at 3:49 PM, Kyotaro HORIGUCHI > > wrote: > >> > >> I don't think it is not only on constatns. With the p

Re: Optimizing nested ConvertRowtypeExpr execution

2018-04-09 Thread Kyotaro HORIGUCHI
At Mon, 9 Apr 2018 16:43:22 +0530, Ashutosh Bapat wrote in > On Mon, Apr 9, 2018 at 4:29 PM, Kyotaro HORIGUCHI > wrote: > > At Mon, 9 Apr 2018 16:07:33 +0530, Ashutosh Bapat > > wrote in > > > >> On Mon, Apr 9, 2018 at 3:53 PM, Ashutosh Bapat > >&g

Re: Fixing a trivial typo in comment in rewriteManip.c

2018-04-09 Thread Kyotaro HORIGUCHI
At Mon, 9 Apr 2018 14:22:33 +0300, Heikki Linnakangas wrote in <4ee784f4-a7c6-dced-0d4c-0a2ac5b87...@iki.fi> > On 09/04/18 13:26, Kyotaro HORIGUCHI wrote: > > While I was looking on some patch, I happened to notice that > > there's a trivial typo in rewriteManip.c >

Re: Boolean partitions syntax

2018-04-09 Thread Kyotaro HORIGUCHI
rval '1 da... The attached patch is adding lines for error checking in some functions like transformWindowFuncCall. They are basically useless as they are to be rejected by parser but it seems to be needed for consistency. regards. -- Kyotaro Horiguchi NTT Open Source Software Cen

Re: Boolean partitions syntax

2018-04-10 Thread Kyotaro HORIGUCHI
Hello. Note: This is not intended to be committed this time but just for information. At Tue, 10 Apr 2018 10:34:27 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180410.103427.244142052.horiguchi.kyot...@lab.ntt.co.jp> > Just adding negation would work as a_expr

Re: Boolean partitions syntax

2018-04-10 Thread Kyotaro HORIGUCHI
fference until dumping definition. create view vconstdate as select * from sales where sold_date = 'today'; create view vvardate as select * from sales where sold_date = now()::date; Maybe we could explicitly control that by having pseudo functions like eval(). ... where sold_date = eval_on_parse('today'); ... where sold_date = eval_on_exec('today'); regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Boolean partitions syntax

2018-04-10 Thread Kyotaro HORIGUCHI
At Wed, 11 Apr 2018 11:27:17 +0900, Amit Langote wrote in <1810b14f-3cd7-aff5-8358-c225c0231...@lab.ntt.co.jp> > On 2018/04/11 10:44, Tom Lane wrote: > > Kyotaro HORIGUCHI writes: > >> At least partition bound *must* be a constant. Any expression > >> that can

Re: Boolean partitions syntax

2018-04-10 Thread Kyotaro HORIGUCHI
erstanding is that it is not back-patchable since it introduces different behavior explicitly mentioned in documentation. https://www.postgresql.org/docs/10/static/sql-createtable.html | and partition_bound_spec is: | | IN ( { numeric_literal | string_literal | NULL } [, ...] ) | | FROM ( { numeric_literal | string_literal | MINVALUE | MAXVALUE } [, ...] ) | TO ( { numeric_literal | string_literal | MINVALUE | MAXVALUE } [, ...] ) Boolean literals are explicitly excluded. If we back-port only the boolean literal stuff, documentation will need updated. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Boolean partitions syntax

2018-04-11 Thread Kyotaro HORIGUCHI
Thank you for the comments. At Wed, 11 Apr 2018 13:51:55 +0900, Amit Langote wrote in <3d0fda29-986c-d970-a22c-b4bd44f56...@lab.ntt.co.jp> > Horiguchi-san, > > Thanks for working on this. > > On 2018/04/11 13:20, Kyotaro HORIGUCHI wrote: > > At Wed, 11 Apr 2018 1

Re: Problem while setting the fpw with SIGHUP

2018-04-11 Thread Kyotaro HORIGUCHI
the flag - can update shared FPW simultaneously. Thus no lock is | * required here. Both shared and local fullPageWrites do not change | * before the next reading below. regards. -- Kyotaro Horiguchi NTT Open Source Software Center >From f6d4857356508fa16dc5d54b92d0177dbeaae3e2 Mon Sep 17 0

Re: Boolean partitions syntax

2018-04-11 Thread Kyotaro HORIGUCHI
escribed above. > > Attached is the patch with the fix for the build. This is the first time I’m > attaching > a patch for the core server, so apologizes if I missed up the formatting. Thank you for verification and the revised patch. The format is fine and the fix is correct but

Re: Problem while setting the fpw with SIGHUP

2018-04-12 Thread Kyotaro HORIGUCHI
Hello. At Thu, 12 Apr 2018 14:07:53 +0900, Michael Paquier wrote in <20180412050753.ga19...@paquier.xyz> > On Thu, Apr 12, 2018 at 10:34:30AM +0900, Kyotaro HORIGUCHI wrote: > > Checkpointer never calls CreateCheckPoint while > > RecoveryInProgress() == true. In other words

Re: Problem while setting the fpw with SIGHUP

2018-04-12 Thread Kyotaro HORIGUCHI
rack the next checkpoint which isn't too bad, but won't > be convenient either. Looking checkpiont record is enough to know wheter the checkpoint is protected by FPW eough, but I agree that such strictness is not crutial. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: MinIndexTupleSize seems slightly wrong

2018-04-12 Thread Kyotaro HORIGUCHI
y, all types of index have opaque area with at least 8 bytes long and it prevent pages from having extra tuples. But it doesn't seem to me stable enough. reagards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Problem while setting the fpw with SIGHUP

2018-04-13 Thread Kyotaro HORIGUCHI
At Fri, 13 Apr 2018 13:47:51 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180413.134751.76149471.horiguchi.kyot...@lab.ntt.co.jp> > At Fri, 13 Apr 2018 08:31:02 +0530, Amit Kapila > wrote in > > On Fri, Apr 13, 2018 at 6:59 AM, Michael Paquier > > wro

Re: Problem while setting the fpw with SIGHUP

2018-04-13 Thread Kyotaro HORIGUCHI
Sorry, the patch attached to the previous main is slightly old. The attached is the correct one. # They differ only in some phrase in a comment. At Fri, 13 Apr 2018 17:28:40 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180413.172840.228724367.horiguchi.kyot...@lab.ntt.co

Re: Reopen logfile on SIGHUP

2018-04-15 Thread Kyotaro HORIGUCHI
hod doesn't work. I'm not sure how to make this work reliably. The loss is unavoidable by any means since logrotate works that way by design. It doesn't care whether its peer did the work as expected. Someone wants to avoid the loss can use copytruncate for another kind of small l

Re: Boolean partitions syntax

2018-04-16 Thread Kyotaro HORIGUCHI
Hello. Thank you for the comment. the attached v6 patch differs only in gram.y since v5. At Fri, 13 Apr 2018 18:55:30 +0900, Amit Langote wrote in > Horiguchi-san, > > Thanks for the latest patch. > > On 2018/04/12 13:12, Kyotaro HORIGUCHI wrote: > > Thank you for

Re: Boolean partitions syntax

2018-04-16 Thread Kyotaro HORIGUCHI
Sorry for a silly typo. At Mon, 16 Apr 2018 16:17:40 +0900 (Tokyo Standard Time), Kyotaro HORIGUCHI wrote in <20180416.161740.51264437.horiguchi.kyot...@lab.ntt.co.jp> > Hello. Thank you for the comment. > > the attached v6 patch differs only in gram.y since v5. > > At F

Re: Oddity in tuple routing for foreign partitions

2018-04-16 Thread Kyotaro HORIGUCHI
ist with the RT index set to 1 against the RETURNING > > expressions would produce attrs_used to be NULL, leading to postgres_fdw > > not retrieving actually inserted data from the remote, even if remote > > triggers might change those data. So, I fixed this as well, by setting &g

Re: Problem while updating a foreign table pointing to a partitioned table on foreign server

2018-04-17 Thread Kyotaro HORIGUCHI
eoid via a side channel but we get wrong value if the scan is not consists of only one foreign relation. I don't think adding remote_tableoid in HeapTupleData is acceptable. Explicity defining remote_tableoid column in foreign relation might work but it makes things combersome.. regards, -- Kyo

Re: Postgres 10 problem with UNION ALL of null value in "subselect"

2018-04-18 Thread Kyotaro HORIGUCHI
^ > > SQL state: 42804 > > Character: 66 > > ``` > > > > The error disappears if we go one commit before > 1e7c4bb0049732ece651d993d03bb6772e5d281a, the error disappears. But > that's I think expected with that commit. > > We can work around th

Re: Problem while updating a foreign table pointing to a partitioned table on foreign server

2018-04-18 Thread Kyotaro HORIGUCHI
At Wed, 18 Apr 2018 13:23:06 +0530, Ashutosh Bapat wrote in > On Wed, Apr 18, 2018 at 9:43 AM, Kyotaro HORIGUCHI > wrote: > > > > Anyway I think we should warn or error out if one nondirect > > update touches two nor more tuples in the first place. > > > &g

Re: Oddity in tuple routing for foreign partitions

2018-04-19 Thread Kyotaro HORIGUCHI
At Tue, 17 Apr 2018 16:41:31 +0900, Etsuro Fujita wrote in <5ad5a52b.7050...@lab.ntt.co.jp> > (2018/04/17 16:10), Amit Langote wrote: > > On 2018/04/17 11:13, Kyotaro HORIGUCHI wrote: > >> If I'm reading this correctly, ExecInitParititionInfo calls > >

Re: Boolean partitions syntax

2018-04-19 Thread Kyotaro HORIGUCHI
Thanks for reviewing. At Wed, 18 Apr 2018 19:27:16 +0900, Amit Langote wrote in <7ac6b44e-4638-3320-1512-f6c03a28d...@lab.ntt.co.jp> > Horiguchi-san, > > Thank you for updating the patch. > > On 2018/04/16 16:17, Kyotaro HORIGUCHI wrote: > > the attached v6 patch d

Re: Problem while setting the fpw with SIGHUP

2018-04-19 Thread Kyotaro HORIGUCHI
t; * assumption that the RedoRecPtr and doPageWrites values were up-to-date. And the patch fixes one comment typo of XLogInsertRecord. regards. -- Kyotaro Horiguchi NTT Open Source Software Center >From 40ce98bba0496b1eb0a982134eae9cec01d532a8 Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Da

Re: Problem while setting the fpw with SIGHUP

2018-04-20 Thread Kyotaro HORIGUCHI
he behavior can lead to FPW flood for those who are accostomed to the current behavior. The attached first patch is the bugfix proposed in this thread. The second fixes the cocurrent update problem only. The third changes the behavior so that turning-on happenes only on checkpoints and turning-

Re: Problem while setting the fpw with SIGHUP

2018-04-23 Thread Kyotaro HORIGUCHI
on't work before the next checkpoint. If we keep the current behavior, the documentation might need an additional phrase something like "FPW ensures that data is protected from partial writes after the next chackpoint starts". On the other hand honestly I don't have confidence that

Re: Boolean partitions syntax

2018-04-23 Thread Kyotaro HORIGUCHI
that slightly > > reduces the astonishment factor if somebody writes TRUE for, say, a > > text column's partbound. I'd still prefer that we throw an error for > > such a case, but that'll have to wait for v12. > > Thanks for making that change and committing. +1, and thank you for discussing. I'll add this item to the next CF. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Reopen logfile on SIGHUP

2018-04-23 Thread Kyotaro HORIGUCHI
At Fri, 20 Apr 2018 21:51:49 +0300, Alexander Kuzmenkov wrote in > On 04/16/2018 05:54 AM, Kyotaro HORIGUCHI wrote: > > We can provide a new command "pg_ctl logrotate" to hide the > > details. (It cannot be executed by root, though.) > > I like this approach. T

Re: using expression syntax for partition bounds

2018-04-24 Thread Kyotaro HORIGUCHI
ERROR: cannot use column referencees in bound value > ERROR: column "b" does not exist I personally think that such similarity between DEFALUT and partition bound (v3-2) is not required. But inserting the hook (v3) doesn't look good for me. regards. -- Kyotaro Horiguchi NTT Op

Re: [HACKERS] [BUGS] Bug in Physical Replication Slots (at least 9.5)?

2018-04-24 Thread Kyotaro HORIGUCHI
Thank you very much for looking this! At Mon, 23 Apr 2018 03:41:47 -0400, Heikki Linnakangas wrote in <89e33d4f-5c75-0738-3dcb-44c4df59e...@iki.fi> > On 18/01/18 20:54, Kyotaro HORIGUCHI wrote: > > At Thu, 18 Jan 2018 11:52:52 -0800, Andres Freund > > wrote in <2018

Re: Oddity in tuple routing for foreign partitions

2018-04-24 Thread Kyotaro HORIGUCHI
ed in [1]. If it looks too complex for the gain, we can always create an RTE for deparsing as Fujita-san's first patch in this thread did. Anyway the condition for "dostuff" + "is update" might be a bit too arbitrary. [1] https://www.postgresql.org/message-id/f970d875-9711-b8cb-f270-965fa3e40...@lab.ntt.co.jp regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Oddity in tuple routing for foreign partitions

2018-04-24 Thread Kyotaro HORIGUCHI
g rid of the PlannerInfo argument of the many functions in > that code. I have long wondered if we couldn't rid of it and especially > thought of it when reviewing this patch. +1 from me. Thanks for making things simpler and easy to understand. I feel the same as Amit:p regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Oddity in tuple routing for foreign partitions

2018-04-25 Thread Kyotaro HORIGUCHI
elInfo > > 2. v5 of the patch to fix the bug of foreign partitions > > Thoughts? Maybe, one reason that I feel uneasy is how the patch accesses desired resultRelInfo. + Index firstVarno = mtstate->resultRelInfo[0].ri_RangeTableIndex; Looking ExecInitModifyTable, just one resultRelInfo has been passed to BeginForeignModify so it should not access as an array. I will feel at easy if the line were in the following shape. Does it make sense? +IndexfirstVarno = mtstate->resultRelInfo->ri_RangeTableIndex; regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Standby corruption after master is restarted

2018-04-26 Thread Kyotaro HORIGUCHI
83C17B70 too long > LOG: record length 1298694144 at 0/83C17B70 too long > LOG: received promote request > LOG: redo done at 0/83C17B38 > LOG: last completed transaction was at log time 2018-04-26 19:10:12.360253+09 > LOG: selected new timeline ID: 2 > LOG: archive recovery comp

Re: Oddity in tuple routing for foreign partitions

2018-04-26 Thread Kyotaro HORIGUCHI
hich could be any partition with arbitrarily different > > attribute > > numbers. > > > >> Anyway, I think that > >> the former is more like an improvement rather than a fix, so it would > >> be > >> better to leave that for another patch for PG12? > > > > I agree, so I'm dropping the patch for 1. > > OK, let's focus on #2! > > > See attached an updated version with changes as described above. > > Looks good to me. Thanks for the updated version! Agreed on all points above. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Remove page-read callback from XLogReaderState.

2019-09-06 Thread Kyotaro Horiguchi
At Thu, 22 Aug 2019 10:43:52 +0900 (Tokyo Standard Time), Kyotaro Horiguchi wrote in <20190822.104352.26342272.horikyota@gmail.com> > I think you diff is intelligible enough for me. I'll take this if > you haven't done. Anyway I'm staring on this. - Reducin

Re: Remove page-read callback from XLogReaderState.

2019-09-10 Thread Kyotaro Horiguchi
ead-buffer-allocation.patch Separate patch to move page buffer allocation from XLogReaderAllocation from allers of XLogReadRecord. regards. -- Kyotaro Horiguchi NTT Open Source Software Center >From 81d3e58a1f017f34bb654cc4f66a4b9646469349 Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Date: Thu, 5 S

Re: SIGQUIT on archiver child processes maybe not such a hot idea?

2019-09-10 Thread Kyotaro Horiguchi
he grandchildren, > just in case they are slow to respond to or ignore SIGINT/SIGTERM? That > matches the idea of pg_ctl's immediate shutdown. Perhaps +1.. immediate -> SIGKILL fast -> SIGTERM? > (Windows cannot stop grandchildren because kill() in src/port/kill.c doe

Re: SIGQUIT on archiver child processes maybe not such a hot idea?

2019-09-10 Thread Kyotaro Horiguchi
At Wed, 11 Sep 2019 11:01:24 +0900 (Tokyo Standard Time), Kyotaro Horiguchi wrote in <20190911.110124.96874741.horikyota@gmail.com> > At Wed, 11 Sep 2019 01:36:15 +, "Tsunakawa, Takayuki" > wrote in > <0A3221C70F24FB45833433255569204D1FD33579@G01JP

Re: base backup client as auxiliary backend process

2019-09-11 Thread Kyotaro Horiguchi
esign/outline.'. So I wanted to see what the past reviewers comment on the revised shape before I would stir up the discussion by maybe-pointless comment. (Then forgotten..) I'll re-look on this. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: standby recovery fails (tablespace related) (tentative patch and discussion)

2019-09-12 Thread Kyotaro Horiguchi
s in > previous solution, so I cannot tell whether concerns upthread are > justified.  Still, I enjoy latest design more, since it is clear and > similar with the code of checking unexpected uninitialized pages. In > principle it works. And the issue, I described in previous review can > be easily fixed by several additional checks of InHotStandby macro. Generally we shouldn't trigger useless restart point for uncertain reasons. If standby crashes, it starts the next recovery from the latest *restart point*. Even in that case what we should do is the same. Of course, for testing, we *should* establish a restartpoint manually in order to establish the prerequisite state. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: let's kill AtSubStart_Notify

2019-09-12 Thread Kyotaro Horiguchi
xt) lcons(0, p1); lcons(0, p2); } to the place where AtSubStart_Notify was called and respective list_delete_first's just after the call to AtSubCommit_Notfiy. At least around 20% of the gain seems to be the result of removing palloc/pfree's. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Efficient output for integer types

2019-09-18 Thread Kyotaro Horiguchi
7483648", 11); + return str + 11; > } + *str++ = '-'; + return pg_ltostr_zeropad(str, -value, minwidth - 1); If then block of the if statement were (values < 0), we won't need to reenter the functaion. + len = pg_ltoa_n(value, str); + if (minwidth <= len) + return str + len; + + memmove(str + minwidth - len, str, len); If the function had the parameters str with the room only for two digits and a NUL, 2 as minwidth but 1000 as value, the function would overrun the buffer. The original function just ignores overflowing digits. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Proposal: Add more compile-time asserts to expose inconsistencies.

2019-09-18 Thread Kyotaro Horiguchi
At Thu, 19 Sep 2019 10:07:40 +0900, Michael Paquier wrote in <20190919010740.gc22...@paquier.xyz> > On Wed, Sep 18, 2019 at 04:46:30PM +0100, Dagfinn Ilmari Mannsåker wrote: > > Postgres doesn't seem to have it, but it would be possible to define a > > StaticAssertDecl macro that can be used at t

Re: allow online change primary_conninfo

2019-09-19 Thread Kyotaro Horiguchi
ioning code, the movement of the code block makes the surrounding swtich almost useless and the structure and the result looks somewhat strange. Couldn't we do the same thing by just skipping the wait and setting lastSourceFailed to true in the case of intentional walreceiver restart? The attach

Re: Psql patch to show access methods info

2019-09-19 Thread Kyotaro Horiguchi
two-letter commands is almost filled, my poor memory rejects to remember the commands that is used infrequently.. ctrl-I suggests many two-or-three letter meta commands but I can't tell what is the command I'm searching for. \? shows too many commands as you mentioned. If something like "\? | grep index" works, it would be helpful. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: PATCH: standby crashed when replay block which truncated in standby but failed to truncate in master node

2019-09-23 Thread Kyotaro Horiguchi
t; before the WAL record is written and release after the physical > truncate), so as truncation avoids failures possible to avoid. > > Do others have thoughts to share on the matter? Agreed for the concept, but does the patch work as described? It seems that query cancel doesn't fire during the holded-off section since no CHECK_FOR_INTERRUPTS() there. regares. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: PATCH: standby crashed when replay block which truncated in standby but failed to truncate in master node

2019-09-23 Thread Kyotaro Horiguchi
At Tue, 24 Sep 2019 12:46:19 +0900 (Tokyo Standard Time), Kyotaro Horiguchi wrote in <20190924.124619.248088532.horikyota@gmail.com> > > clear about that. In short, as a matter of safety I'd like to think > > that what you are suggesting is rather acceptable (aka hol

Re: Cache lookup errors with functions manipulation object addresses

2019-09-23 Thread Kyotaro Horiguchi
string and NULL are not digtinguishable in psql text output. It'd be better that the regression test checks that the return is actually NULL using "is NULL" or "\pset null ''" or something like. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Index Skip Scan

2019-09-24 Thread Kyotaro Horiguchi
metic operator, which cannot be used if the operands is guaranteed to be 0 or 1 (in integer). In a-kind-of-standard, but hacky way, "(!a != !b)" works as desired since ! is a logical operator. Wouldn't we use (a && !b) || (!a && b)? Compiler will optimize it some good way. regards. -- Kyotaro Horiguchi NTT Open Source Software Center

Re: Index Skip Scan

2019-09-24 Thread Kyotaro Horiguchi
At Tue, 24 Sep 2019 17:35:47 +0900 (Tokyo Standard Time), Kyotaro Horiguchi wrote in <20190924.173547.226622711.horikyota@gmail.com> > At Sun, 22 Sep 2019 23:02:04 -0300, Alvaro Herrera > wrote in <20190923020204.GA2781@alvherre.pgsql> > > On 2019-Sep

Re: Index Skip Scan

2019-09-24 Thread Kyotaro Horiguchi
At Tue, 24 Sep 2019 09:06:27 -0300, Alvaro Herrera wrote in <20190924120627.GA12454@alvherre.pgsql> > On 2019-Sep-24, Kyotaro Horiguchi wrote: > > > Sorry, it's not a boolean. A tristate value. From the definition > > (Back, NoMove, Forward) = (-1, 0, 1), (dir1 ==

Re: allow online change primary_conninfo

2019-09-24 Thread Kyotaro Horiguchi
Hello. At Sat, 21 Sep 2019 13:06:25 +0300, Sergei Kornilov wrote in <41171569060...@myt5-b646bde4b8f3.qloud-c.yandex.net> > Hello > > Thank you for review! Can you please also check v4 version? v5 implements > design suggested by Kyotaro Horiguchi-san, while v4 has ano

<    2   3   4   5   6   7   8   9   10   11   >