Re: Re: parallel distinct union and aggregate support patch

2020-10-29 Thread bu...@sohu.com
> 1) It's better to always include the whole patch series - including the > parts that have not changed. Otherwise people have to scavenge the > thread and search for all the pieces, which may be a source of issues. > Also, it confuses the patch tester [1] which tries to apply patches from > a sing

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-10-29 Thread Masahiro Ikeda
Hi, Thanks for your comments and advice. I updated the patch. On 2020-10-21 18:03, Kyotaro Horiguchi wrote: At Tue, 20 Oct 2020 16:11:29 +0900, Masahiro Ikeda wrote in On 2020-10-20 12:46, Amit Kapila wrote: > I see that we also need to add extra code to capture these stats (some > of which i

Re: Deduplicate aggregates and transition functions in planner

2020-10-29 Thread Heikki Linnakangas
On 28/10/2020 21:59, Andres Freund wrote: On 2020-10-28 21:10:41 +0200, Heikki Linnakangas wrote: Currently, ExecInitAgg() performs quite a lot of work, to deduplicate identical Aggrefs, as well as Aggrefs that can share the same transition state. That doesn't really belong in the executor, we s

Re: Parallel copy

2020-10-29 Thread Heikki Linnakangas
On 27/10/2020 15:36, vignesh C wrote: Attached v9 patches have the fixes for the above comments. I did some testing: /tmp/longdata.pl: #!/usr/bin/perl # # Generate three rows: # foo # longdatalongdatalongdata... # bar # # The length of the middle row is given as command line arg. # m

Re: Parallel copy

2020-10-29 Thread Daniel Westermann (DWE)
On 27/10/2020 15:36, vignesh C wrote: >> Attached v9 patches have the fixes for the above comments. >I did some testing: I did some testing as well and have a cosmetic remark: postgres=# copy t1 from '/var/tmp/aa.txt' with (parallel 10); ERROR: value 10 out of bounds for option

RE: extension patch of CREATE OR REPLACE TRIGGER

2020-10-29 Thread osumi.takami...@fujitsu.com
Hi, From: Tsunakawa, Takayuki < tsunakawa.ta...@fujitsu.com> > From: osumi.takami...@fujitsu.com > > > > * I don't think that you've fully thought through the implications > > > > of replacing a trigger for a table that the current transaction > > > > has already modified. Is it really sufficie

Re: Parallel copy

2020-10-29 Thread Amit Kapila
On Thu, Oct 29, 2020 at 11:45 AM Amit Kapila wrote: > > On Tue, Oct 27, 2020 at 7:06 PM vignesh C wrote: > > > [latest version] > > I think the parallel-safety checks in this patch > (v9-0002-Allow-copy-from-command-to-process-data-from-file) are > incomplete and wrong. > One more point, I have

Re: Track statistics for streaming of in-progress transactions

2020-10-29 Thread Amit Kapila
On Thu, Oct 29, 2020 at 5:16 AM Tomas Vondra wrote: > > On Wed, Oct 28, 2020 at 08:54:53AM +0530, Amit Kapila wrote: > >On Fri, Oct 23, 2020 at 10:24 AM Amit Kapila wrote: > >> > >> On Thu, Oct 22, 2020 at 2:09 PM Amit Kapila > >> wrote: > >> > > >> > >> I have fixed the above comment and rebas

Re: libpq compression

2020-10-29 Thread Daniil Zakhlystov
Hi, > On Oct 29, 2020, at 12:27 AM, Andres Freund wrote: > > The protocol sounds to me like there's no way to enable/disable > compression in an existing connection. To me it seems better to have an > explicit, client initiated, request to use a specific method of > compression (including none).

Re: Disable WAL logging to speed up data loading

2020-10-29 Thread Laurenz Albe
On Thu, 2020-10-29 at 11:42 +0900, Fujii Masao wrote: > > But what if someone sets wal_level=none, performs some data modifications, > > sets wal_level=archive and after dome more processing decides to restore > > from > > a backup that was taken before the cluster was set to wal_level=none? > > T

Re: Disable WAL logging to speed up data loading

2020-10-29 Thread Laurenz Albe
On Thu, 2020-10-29 at 00:07 +, osumi.takami...@fujitsu.com wrote: > > Sorry for the noise, and I am beginning to think that this is actually a > > useful > > feature. > > No problem at all. > Probably, for some developers, was the name "none" confusing ? No, I think that "none" is quite accu

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

2020-10-29 Thread Amit Kapila
On Tue, Oct 27, 2020 at 3:25 PM Ajin Cherian wrote: > [v13 patch set] Few comments on v13-0001-Support-2PC-txn-base. I haven't checked v14 version of patches so if you have fixed anything then ignore it. 1. --- a/src/include/replication/reorderbuffer.h +++ b/src/include/replication/reorderbuffer.

Re: document pg_settings view doesn't display custom options

2020-10-29 Thread John Naylor
On Wed, Oct 28, 2020 at 11:38 PM Fujii Masao wrote: > > > On 2020/10/29 3:45, John Naylor wrote: > > On Wed, Oct 28, 2020 at 2:15 PM John Naylor < > john.nay...@enterprisedb.com > wrote: > > > > Starting separate threads to keep from cluttering the TODO li

Re: partition routing layering in nodeModifyTable.c

2020-10-29 Thread Amit Langote
On Wed, Oct 28, 2020 at 12:02 PM Amit Langote wrote: > On Tue, Oct 27, 2020 at 10:23 PM Heikki Linnakangas wrote: > > But since this applies on top of the "overhaul update/delete processing" > > patch, let's tackle that patch set next. Could you rebase that, please? > > > Anyway, I will post the

Re: libpq compression

2020-10-29 Thread Konstantin Knizhnik
Hi, Thank for review. On 28.10.2020 22:27, Andres Freund wrote: I don't see a corresponding configure.ac change? Shame on me - I completely forgot that configure is actually generate from configure.ac. Fixed. + + compression + + +Request compression of libpq tr

Re: MultiXact\SLRU buffers configuration

2020-10-29 Thread Tomas Vondra
On Thu, Oct 29, 2020 at 12:08:21PM +0500, Andrey Borodin wrote: 29 окт. 2020 г., в 04:32, Tomas Vondra написал(а): It's not my intention to be mean or anything like that, but to me this means we don't really understand the problem we're trying to solve. Had we understood it, we should be ab

Re: Log message for GSS connection is missing once connection authorization is successful.

2020-10-29 Thread Stephen Frost
Greetings, * vignesh C (vignes...@gmail.com) wrote: > I have made a v2 patch based on the changes you have suggested. The > patch for the same is attached. > From b067cf823750f200102be0a0cad9a26a08e29a92 Mon Sep 17 00:00:00 2001 > From: Vignesh C > Date: Wed, 28 Oct 2020 08:19:06 +0530 > Subject

Re: New default role- 'pg_read_all_data'

2020-10-29 Thread Stephen Frost
Greetings, * Georgios Kokolatos (gkokola...@protonmail.com) wrote: > this patch is in "Ready for committer" state and the Cfbot is happy. Glad that's still the case. :) > Is there any committer that is available for taking a look at it? If there aren't any objections or further comments, I'll t

-O switch

2020-10-29 Thread Magnus Hagander
postgres --help: -o OPTIONS pass "OPTIONS" to each server process (obsolete) This was marked obsolete in 2006 (86c23a6eb28). Is it perhaps time to get rid of it? -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/

Re: libpq compression

2020-10-29 Thread Konstantin Knizhnik
New version of the patch with fixed is attached. On 28.10.2020 22:27, Andres Freund wrote: Hi, On 2020-10-26 19:20:46 +0300, Konstantin Knizhnik wrote: diff --git a/configure b/configure index ace4ed5..deba608 100755 --- a/configure +++ b/configure @@ -700,6 +700,7 @@ LD LDFLAGS_SL LDFLAG

Re: POC: GROUP BY optimization

2020-10-29 Thread Dmitry Dolgov
> On Tue, Oct 27, 2020 at 09:19:51PM +0100, Tomas Vondra wrote: > On Mon, Oct 26, 2020 at 11:40:40AM +0100, Dmitry Dolgov wrote: > > > On Mon, Oct 26, 2020 at 01:28:59PM +0400, Pavel Borisov wrote: > > > > Thanks for your interest! FYI there is a new thread about this topic [1] > > > > with the nex

Re: libpq compression

2020-10-29 Thread Konstantin Knizhnik
On 28.10.2020 22:58, Alvaro Herrera wrote: On 2020-Oct-26, Konstantin Knizhnik wrote: + while (bufptr < bufend || zpq_buffered(PqStream) != 0) /* has more data to flush or unsent data in internal compression buffer */ { - int r; - -

Re: POC: GROUP BY optimization

2020-10-29 Thread Pavel Borisov
> > In case if I'm missing something and Pavel's proposal is significantly > different from the original patch (if I understand correctly, at the > moment the latest patch posted here is a rebase and adjusting the old > patch to work with the latest changes in master, right?), then indeed > they co

Re: New default role- 'pg_read_all_data'

2020-10-29 Thread Georgios Kokolatos
Hi, this patch is in "Ready for committer" state and the Cfbot is happy. Is there any committer that is available for taking a look at it? Cheers, //Georgios - CFM 2020-11

Re: -O switch

2020-10-29 Thread Tom Lane
Magnus Hagander writes: > postgres --help: > -o OPTIONS pass "OPTIONS" to each server process (obsolete) > This was marked obsolete in 2006 (86c23a6eb28). I don't think it's really obsolete ... don't we use that to pass PGOPTIONS through from the client? regard

Re: -O switch

2020-10-29 Thread Magnus Hagander
On Thu, Oct 29, 2020 at 4:45 PM Tom Lane wrote: > > Magnus Hagander writes: > > postgres --help: > > -o OPTIONS pass "OPTIONS" to each server process (obsolete) > > > This was marked obsolete in 2006 (86c23a6eb28). > > I don't think it's really obsolete ... don't we use that to pass > P

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Victor Yegorov writes: > > ср, 28 окт. 2020 г. в 19:44, Alexander Kukushkin : > >> I know, nobody in their mind should do that, but, if the postmaster > >> process is killed with SIGKILL signal, most backend processes > >> correctly notice the f

Re: -O switch

2020-10-29 Thread Tom Lane
Magnus Hagander writes: > On Thu, Oct 29, 2020 at 4:45 PM Tom Lane wrote: >> I don't think it's really obsolete ... don't we use that to pass >> PGOPTIONS through from the client? > That said, I don't think we do, or I'm misunderstanding what you mean. > The startup packet which holds the client

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Tom Lane
Stephen Frost writes: > I agree that 'constantly' wouldn't be great, but with some periodicity > that's more frequent than 'not until a few hours later when we finally > finish vacuuming this relation' would be nice. At least with autovauum > we may be periodically sleeping anyway so it doesn't s

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Alvaro Herrera
On 2020-Oct-29, Stephen Frost wrote: > > It's hard to do better than that, because on most platforms there's > > no way to get a signal on parent-process death, so the only way to > > notice would be to poll the postmaster-death pipe constantly; which > > would be hugely expensive in comparison to

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Alvaro Herrera
On 2020-Oct-28, Alexander Kukushkin wrote: > Hello, > > I know, nobody in their mind should do that, but, if the postmaster > process is killed with SIGKILL signal, most backend processes > correctly notice the fact of the postmaster process absence and exit. > There is one exception though, when

Re: pg_dump, ATTACH, and independently restorable child partitions

2020-10-29 Thread Justin Pryzby
On Sat, Oct 24, 2020 at 02:59:49PM -0500, Justin Pryzby wrote: > On Fri, Oct 23, 2020 at 12:29:40AM -0500, Justin Pryzby wrote: > > Since this commit, pg_dump CREATEs tables and then ATTACHes them: > > > > |commit 33a53130a89447e171a8268ae0b221bb48af6468 > > |Author: Alvaro Herrera > > |Date: M

Re: duplicate function oid symbols

2020-10-29 Thread Tom Lane
John Naylor writes: > Here is a quick patch implementing this much. Pushed with a couple cosmetic tweaks. regards, tom lane

Re: Deduplicate aggregates and transition functions in planner

2020-10-29 Thread Andres Freund
Hi, On 2020-10-29 10:17:20 +0200, Heikki Linnakangas wrote: > On 28/10/2020 21:59, Andres Freund wrote: > > It wouldn't surprise me to see a small execution time speedup here - > > I've seen the load of the aggno show up in profiles. > > I think you'd be hard-pressed to find a real-life query whe

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Andres Freund
Hi, On 2020-10-29 12:27:53 -0400, Tom Lane wrote: > Maybe put a check into vacuum_delay_point, and poll the pipe when we're > about to sleep anyway? Perhaps we should just replace the pg_usleep() with a latch wait? Greetings, Andres Freund

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Stephen Frost
Greetings, * Andres Freund (and...@anarazel.de) wrote: > On 2020-10-29 12:27:53 -0400, Tom Lane wrote: > > Maybe put a check into vacuum_delay_point, and poll the pipe when we're > > about to sleep anyway? > > Perhaps we should just replace the pg_usleep() with a latch wait? I'm not sure why, bu

Re: Online checksums verification in the backend

2020-10-29 Thread Andres Freund
Hi, On 2020-10-28 14:08:52 +0900, Michael Paquier wrote: > Thanks for confirming. I have gone through the whole set today, > splitted the thing into two commits and applied them. We had > buildfarm member florican complain about a mistake in one of the > GetDatum() calls that I took care of alre

Re: Online checksums verification in the backend

2020-10-29 Thread Andres Freund
Hi, On 2020-10-29 11:17:29 -0700, Andres Freund wrote: > LWLockAcquire(BufferDescriptorGetIOLock(bufdesc), LW_SHARED); > buf_state = LockBufHdr(bufdesc); > UnlockBufHdr(bufdesc, buf_state); > > /* If the page is dirty or invalid, skip it */

Re: Online checksums verification in the backend

2020-10-29 Thread Andres Freund
Hi, On 2020-10-29 11:17:29 -0700, Andres Freund wrote: > The code does IO while holding the buffer mapping lock. That seems > *entirely* unacceptable to me. That basically locks 1/128 of shared > buffers against concurrent mapping changes, while reading data that is > likely not to be on disk? Se

Re: [PATCH] remove pg_archivecleanup and pg_standby

2020-10-29 Thread Michael Banck
Hi, Am Mittwoch, den 28.10.2020, 21:44 -0500 schrieb Justin Pryzby: > Forking this thread: > https://www.postgresql.org/message-id/fd93f1c5-7818-a02c-01e5-1075ac0d4...@iki.fi Glancing over this in the context of pg_standby/pg_archivecleanup, I am not sure Heikki's "Ditto" is about "remove pg_arch

Re: Disable WAL logging to speed up data loading

2020-10-29 Thread Fujii Masao
On 2020/10/29 19:21, Laurenz Albe wrote: On Thu, 2020-10-29 at 11:42 +0900, Fujii Masao wrote: But what if someone sets wal_level=none, performs some data modifications, sets wal_level=archive and after dome more processing decides to restore from a backup that was taken before the cluster wa

Consistent error reporting for encryption/decryption in pgcrypto

2020-10-29 Thread Daniel Gustafsson
Commit b918bf86c65 added the errorcode PXE_DECRYPT_FAILED to the existing set of PXE_ error codes. When pgcrypto was changed to the EVP APIs in 5ff4a67f63, no new error codes were added in favour of existing ones. This results in encryption failures returning PXE_ERR_GENERIC, which seems a bit in

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Alvaro Herrera
On 2020-Oct-29, Stephen Frost wrote: > I do think it'd be good to find a way to check every once in a while > even when we aren't going to delay though. Not sure what the best > answer there is. Maybe instead of thinking specifically in terms of vacuum, we could count buffer accesses (read from

-Wformat-signedness

2020-10-29 Thread Thomas Munro
Hi hackers, There're probably mostly harmless, being mostly error and debug messages and the like, and considering that eg OID parsing tolerates negative numbers when reading them back in, but for what it's worth: GCC complains about many %d vs %u type mixups if you build with $SUBJECT.

Re: Autovacuum worker doesn't immediately exit on postmaster death

2020-10-29 Thread Tom Lane
Alvaro Herrera writes: > On 2020-Oct-29, Stephen Frost wrote: >> I do think it'd be good to find a way to check every once in a while >> even when we aren't going to delay though. Not sure what the best >> answer there is. > Maybe instead of thinking specifically in terms of vacuum, we could > c

Re: Deleting older versions in unique indexes to avoid page splits

2020-10-29 Thread Victor Yegorov
пн, 26 окт. 2020 г. в 22:15, Peter Geoghegan : > Attached is v5, which has changes that are focused on two important > high level goals: > And some more comments after another round of reading the patch. 1. Looks like UNIQUE_CHECK_NO_WITH_UNCHANGED is used for HOT updates, should we use UNIQU

Re: enable_incremental_sort changes query behavior

2020-10-29 Thread Tomas Vondra
On Tue, Oct 06, 2020 at 09:37:31AM -0400, James Coleman wrote: On Tue, Oct 6, 2020 at 9:28 AM Jaime Casanova wrote: Can you please create an entry in the commitfest for this one so we don't lose track of it? We're not too far from the next minor release, so I've been looking at this fix aga

contrib/sslinfo cleanup and OpenSSL errorhandling

2020-10-29 Thread Daniel Gustafsson
While hacking on the NSS patch I realized that sslinfo was passing the ->ssl Port member directly to OpenSSL in order to extract information regarding the connection. This breaks the API provided by the backend, as well as duplicates code for no real benefit. The attached 0001 patch rewrites ssli

EXPLAIN vs track_io_timing=on vs tests

2020-10-29 Thread Andres Freund
Hi I run my development instances with track_io_timing=on, as I've found that to be really useful. Unfortunately that causes tests to fail whenever I forget to turn that off to run installcheck. The diffs are caused by the additional data shown in the explain tests: ... - "Temp Written Bloc

Re: Deleting older versions in unique indexes to avoid page splits

2020-10-29 Thread Peter Geoghegan
On Wed, Oct 28, 2020 at 4:05 PM Victor Yegorov wrote: > I've reviewed v5 of the patch and did some testing. Thanks! > I now see what you mean by saying that this patch is a natural and logical > extension of the deduplication v13 work. I agree with this. I tried the patch out with a long runnin

Re: contrib/sslinfo cleanup and OpenSSL errorhandling

2020-10-29 Thread Andres Freund
Hi, Thanks for extracting these. On 2020-10-29 23:48:57 +0100, Daniel Gustafsson wrote:> > /* > @@ -54,9 +53,16 @@ PG_FUNCTION_INFO_V1(ssl_version); > Datum > ssl_version(PG_FUNCTION_ARGS) > { > - if (MyProcPort->ssl == NULL) > + const char *version; > + > + if (!MyProcPort->ssl

Re: Deleting older versions in unique indexes to avoid page splits

2020-10-29 Thread Peter Geoghegan
On Thu, Oct 29, 2020 at 3:05 PM Victor Yegorov wrote: > And some more comments after another round of reading the patch. > > 1. Looks like UNIQUE_CHECK_NO_WITH_UNCHANGED is used for HOT updates, >should we use UNIQUE_CHECK_NO_HOT here? It is better understood like this. This would probably ge

Re: Consistent error reporting for encryption/decryption in pgcrypto

2020-10-29 Thread Michael Paquier
On Thu, Oct 29, 2020 at 10:26:54PM +0100, Daniel Gustafsson wrote: > The attached introduce PXE_ENCRYPT_FAILED and use that for EVP_EncryptUpdate > to > ideally be slightly clearer in case of errors. Any reason not to do that > instead of using ERR_GENERIC? +1. While looking at that, I was wond

Re: Deleting older versions in unique indexes to avoid page splits

2020-10-29 Thread Peter Geoghegan
On Thu, Oct 29, 2020 at 4:30 PM Peter Geoghegan wrote: > I found that the "fiver" and "tenner" indexes in particular took a > very long time to have even one page split with a long running > transaction. Another interesting effect was that all page splits > suddenly stopped when my one hour 30 mi

Re: psql \df choose functions by their arguments

2020-10-29 Thread Greg Sabino Mullane
Thank you for looking this over. > This isn't working for arrays: > ... > postgres=# \df aa aa int[] > Arrays should work as expected, I think you have one too many "aa" in there? > I think it should use the same syntax as \sf and \ef, which require > parenthesis > and commas, not spaces. > H

Re: Parallel INSERT (INTO ... SELECT ...)

2020-10-29 Thread Greg Nancarrow
On Tue, Oct 27, 2020 at 8:56 PM Amit Kapila wrote: > > IIUC, below is code for this workaround: > > +MaxRelParallelHazardForModify(Oid relid, > + CmdType commandType, > + max_parallel_hazard_context *context) > +{ > + Relationrel; > + TupleDesc tupdesc; > + int attnum; > + > + LOCKMODE loc

Re: COPY FREEZE and setting PD_ALL_VISIBLE/visibility map bits

2020-10-29 Thread Tomas Vondra
Hi, I might be somewhat late to the party, but I've done a bit of benchmarking too ;-) I used TPC-H data from a 100GB test, and tried different combinations of COPY [FREEZE] and VACUUM [FREEZE], both on current master and with the patch. The results look like this (the columns say what combinati

MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Ashutosh Sharma
Hi All, Today while working on some other task related to database encoding, I noticed that the MINUS SIGN (with byte sequence a1-dd) in EUC-JP is mapped to FULLWIDTH HYPHEN-MINUS (with byte sequence ef-bc-8d) in UTF-8. See below: postgres=# select convert('\xa1dd', 'euc_jp', 'utf8'); convert --

Re: Add Information during standby recovery conflicts

2020-10-29 Thread Masahiko Sawada
, On Thu, 29 Oct 2020 at 00:16, Fujii Masao wrote: > > > > On 2020/10/27 9:41, Masahiko Sawada wrote: > > On Tue, 20 Oct 2020 at 22:02, Drouvot, Bertrand wrote: > >> > >> Hi, > >> > >> On 10/15/20 9:15 AM, Masahiko Sawada wrote: > >>> CAUTION: This email originated from outside of the organizati

Re: Boundary value check in lazy_tid_reaped()

2020-10-29 Thread Masahiko Sawada
On Tue, 1 Sep 2020 at 05:56, Peter Geoghegan wrote: > > On Mon, Aug 31, 2020 at 12:22 PM Thomas Munro wrote: > > On Sun, Aug 30, 2020 at 11:08 PM Masahiko Sawada > > wrote: > > > So my proposal is to add boundary value check in lazy_tid_reaped() > > > before executing bsearch(3). This will help

Re: Online checksums verification in the backend

2020-10-29 Thread Julien Rouhaud
Hi, On Fri, Oct 30, 2020 at 2:17 AM Andres Freund wrote: > The code does IO while holding the buffer mapping lock. That seems > *entirely* unacceptable to me. That basically locks 1/128 of shared > buffers against concurrent mapping changes, while reading data that is > likely not to be on disk?

Re: Online verification of checksums

2020-10-29 Thread Michael Paquier
On Thu, Oct 22, 2020 at 10:41:53AM +0900, Michael Paquier wrote: > We cannot trust the fields fields of the page header because these may > have been messed up with some random corruption, so what really > matters is that the checksums don't match, and that we can just rely > on that. The zero-onl

Re: [patch] Fix checksum verification in base backups for zero page headers

2020-10-29 Thread Michael Paquier
On Wed, Oct 28, 2020 at 04:43:44PM +0900, Michael Paquier wrote: > On Wed, Oct 28, 2020 at 04:11:56PM +0900, Michael Paquier wrote: >> Thanks. The patch for v13 cannot use a macro, but one of the versions >> of upthread would do just fine. For the note, I have posted a set of patches to address a

Re: contrib/sslinfo cleanup and OpenSSL errorhandling

2020-10-29 Thread Michael Paquier
On Thu, Oct 29, 2020 at 04:40:32PM -0700, Andres Freund wrote: > There's quite a few copies of this code that look exactly the same, > except for the be_tls_get_* call. Do you see a way to have fewer copies > of the same code? Each one of those code paths is working on a different sub-API aiming a

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-10-29 Thread Fujii Masao
On 2020/10/29 17:03, Masahiro Ikeda wrote: Hi, Thanks for your comments and advice. I updated the patch. On 2020-10-21 18:03, Kyotaro Horiguchi wrote: At Tue, 20 Oct 2020 16:11:29 +0900, Masahiro Ikeda wrote in On 2020-10-20 12:46, Amit Kapila wrote: > I see that we also need to add extra

Re: Online checksums verification in the backend

2020-10-29 Thread Andres Freund
Hi, On 2020-10-30 10:01:08 +0800, Julien Rouhaud wrote: > On Fri, Oct 30, 2020 at 2:17 AM Andres Freund wrote: > > The code does IO while holding the buffer mapping lock. That seems > > *entirely* unacceptable to me. That basically locks 1/128 of shared > > buffers against concurrent mapping chan

Re: Add statistics to pg_stat_wal view for wal related parameter tuning

2020-10-29 Thread Fujii Masao
On 2020/10/20 11:31, Masahiro Ikeda wrote: Hi, I think we need to add some statistics to pg_stat_wal view. Although there are some parameter related WAL, there are few statistics for tuning them. I think it's better to provide the following statistics. Please let me know your comments. ```

Re: MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Amit Langote
On Fri, Oct 30, 2020 at 9:44 AM Ashutosh Sharma wrote: > > Hi All, > > Today while working on some other task related to database encoding, I > noticed that the MINUS SIGN (with byte sequence a1-dd) in EUC-JP is > mapped to FULLWIDTH HYPHEN-MINUS (with byte sequence ef-bc-8d) in > UTF-8. See below

Re: MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Kyotaro Horiguchi
Hello. At Fri, 30 Oct 2020 06:13:53 +0530, Ashutosh Sharma wrote in > Hi All, > > Today while working on some other task related to database encoding, I > noticed that the MINUS SIGN (with byte sequence a1-dd) in EUC-JP is > mapped to FULLWIDTH HYPHEN-MINUS (with byte sequence ef-bc-8d) in > U

Re: MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Tom Lane
Amit Langote writes: > On Fri, Oct 30, 2020 at 9:44 AM Ashutosh Sharma wrote: >> Today while working on some other task related to database encoding, I >> noticed that the MINUS SIGN (with byte sequence a1-dd) in EUC-JP is >> mapped to FULLWIDTH HYPHEN-MINUS (with byte sequence ef-bc-8d) in >> UT

Re: Add Information during standby recovery conflicts

2020-10-29 Thread Fujii Masao
On 2020/10/30 10:29, Masahiko Sawada wrote: , On Thu, 29 Oct 2020 at 00:16, Fujii Masao wrote: On 2020/10/27 9:41, Masahiko Sawada wrote: On Tue, 20 Oct 2020 at 22:02, Drouvot, Bertrand wrote: Hi, On 10/15/20 9:15 AM, Masahiko Sawada wrote: CAUTION: This email originated from outsi

Re: MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Kyotaro Horiguchi
At Fri, 30 Oct 2020 12:08:51 +0900, Amit Langote wrote in > I noticed that the commit a8bd7e1c6e02 from ages ago removed > conversions from and to utf-8's e28892, in favor of efbc8d, and that > change has stuck. (Note though that these maps looked pretty > different back then.) > > --- a/src/b

Re: Enumize logical replication message actions

2020-10-29 Thread Amit Kapila
On Fri, Oct 23, 2020 at 6:26 PM Ashutosh Bapat wrote: > > > > On Fri, 23 Oct 2020 at 18:23, Amit Kapila wrote: >> >> On Fri, Oct 23, 2020 at 11:50 AM Kyotaro Horiguchi >> wrote: >> > >> > At Thu, 22 Oct 2020 22:31:41 -0300, Alvaro Herrera >> > wrote in >> > > On 2020-Oct-22, Ashutosh Bapat wro

Re: document pg_settings view doesn't display custom options

2020-10-29 Thread Fujii Masao
On 2020/10/29 21:54, John Naylor wrote: On Wed, Oct 28, 2020 at 11:38 PM Fujii Masao mailto:masao.fu...@oss.nttdata.com>> wrote: On 2020/10/29 3:45, John Naylor wrote: > On Wed, Oct 28, 2020 at 2:15 PM John Naylor mailto:john.nay...@enterprisedb.com>

Re: Online checksums verification in the backend

2020-10-29 Thread Julien Rouhaud
On Fri, Oct 30, 2020 at 10:58 AM Andres Freund wrote: > > Hi, > > On 2020-10-30 10:01:08 +0800, Julien Rouhaud wrote: > > On Fri, Oct 30, 2020 at 2:17 AM Andres Freund wrote: > > > The code does IO while holding the buffer mapping lock. That seems > > > *entirely* unacceptable to me. That basical

Re: MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Tatsuo Ishii
> Hi All, > > Today while working on some other task related to database encoding, I > noticed that the MINUS SIGN (with byte sequence a1-dd) in EUC-JP is > mapped to FULLWIDTH HYPHEN-MINUS (with byte sequence ef-bc-8d) in > UTF-8. See below: > > postgres=# select convert('\xa1dd', 'euc_jp', 'utf

Re: MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Tatsuo Ishii
> The mapping is generated from CP932.TXT and JIS0212.TXT by > UCS_to_UEC_JP.pl. I still don't understand why this change has been made. Originally the conversion was based on JIS0208.txt, JIS0212.txt and JIS0201.txt, which is the exact definition of EUC-JP. CP932.txt is defined by Microsoft for t

empty table blocks hash antijoin

2020-10-29 Thread Pavel Stehule
Hi I am checking one customer query where there are some empty tables in a nontrivial query. The fixed estimation on empty tables in Postgres are working very well, but I found another issue. create table test_a(id int); create table test_b(id int); insert into test_a select generate_series(1,100

Re: Disable WAL logging to speed up data loading

2020-10-29 Thread Masahiko Sawada
On Fri, 30 Oct 2020 at 05:00, Fujii Masao wrote: > > > > On 2020/10/29 19:21, Laurenz Albe wrote: > > On Thu, 2020-10-29 at 11:42 +0900, Fujii Masao wrote: > >>> But what if someone sets wal_level=none, performs some data modifications, > >>> sets wal_level=archive and after dome more processing d

Re: MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Ashutosh Sharma
On Fri, Oct 30, 2020 at 8:49 AM Kyotaro Horiguchi wrote: > > Hello. > > At Fri, 30 Oct 2020 06:13:53 +0530, Ashutosh Sharma > wrote in > > Hi All, > > > > Today while working on some other task related to database encoding, I > > noticed that the MINUS SIGN (with byte sequence a1-dd) in EUC-JP i

Re: MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Kyotaro Horiguchi
At Fri, 30 Oct 2020 13:17:08 +0900 (JST), Tatsuo Ishii wrote in > > The mapping is generated from CP932.TXT and JIS0212.TXT by > > UCS_to_UEC_JP.pl. > > I still don't understand why this change has been made. Originally the > conversion was based on JIS0208.txt, JIS0212.txt and JIS0201.txt, > w

Re: should INSERT SELECT use a BulkInsertState?

2020-10-29 Thread Justin Pryzby
On Thu, Oct 22, 2020 at 01:29:53PM +0100, Simon Riggs wrote: > On Fri, 16 Oct 2020 at 22:05, Justin Pryzby wrote: > > > > > I made this conditional on BEGIN BULK/SET bulk, so I'll solicit > > > > comments on that. > > I think it would be better if this was self-tuning. So that we don't > alloca

Re: Enumize logical replication message actions

2020-10-29 Thread Peter Smith
On Fri, Oct 30, 2020 at 2:46 PM Amit Kapila wrote: Hi Amit > You mentioned in the beginning that you prefer to use Enum instead of > define so that switch cases can detect any remaining items but I have > tried adding extra enum value at the end and didn't handle that in > switch case but I didn

Re: Online checksums verification in the backend

2020-10-29 Thread Andres Freund
On 2020-10-30 11:58:13 +0800, Julien Rouhaud wrote: > So I'm assuming that the previous optimization to avoid almost every > time doing an IO while holding a buffer mapping lock isn't an option? > In that case, I don't see any other option than reverting the patch > and discussing a new approach.

Re: MINUS SIGN (U+2212) in EUC-JP encoding is mapped to FULLWIDTH HYPHEN-MINUS (U+FF0D) in UTF-8

2020-10-29 Thread Amit Langote
On Fri, Oct 30, 2020 at 12:20 PM Kyotaro Horiguchi wrote: > At Fri, 30 Oct 2020 06:13:53 +0530, Ashutosh Sharma > wrote in > > However, when the same MINUS SIGN in UTF-8 is converted to SJIS > > encoding, the convert function returns the correct result. See below: > > > > postgres=# select conve

Re: [PoC] Non-volatile WAL buffer

2020-10-29 Thread Takashi Menjo
Hi Heikki, > I had a new look at this thread today, trying to figure out where we are. I'm a bit confused. > > One thing we have established: mmap()ing WAL files performs worse than the current method, if pg_wal is not on > a persistent memory device. This is because the kernel faults in existing

Re: Parallel INSERT (INTO ... SELECT ...)

2020-10-29 Thread Amit Kapila
On Fri, Oct 30, 2020 at 6:09 AM Greg Nancarrow wrote: > > On Tue, Oct 27, 2020 at 8:56 PM Amit Kapila wrote: > > > > IIUC, below is code for this workaround: > > > > +MaxRelParallelHazardForModify(Oid relid, > > + CmdType commandType, > > + max_parallel_hazard_context *context) > > +{ > > + Relat

Re: partition routing layering in nodeModifyTable.c

2020-10-29 Thread Amit Langote
On Wed, Oct 28, 2020 at 4:46 PM Amit Langote wrote: > > On Tue, Oct 27, 2020 at 10:23 PM Heikki Linnakangas wrote: > > This patch looks reasonable to me at a quick glance. I'm a bit worried > > or unhappy about the impact on FDWs, though. It doesn't seem nice that > > the ResultRelInfo is not ava

Re: ModifyTable overheads in generic plans

2020-10-29 Thread Amit Langote
Attached updated patches based on recent the discussion at: * Re: partition routing layering in nodeModifyTable.c * https://www.postgresql.org/message-id/CA%2BHiwqHpmMjenQqNpMHrhg3DRhqqQfby2RCT1HWVwMin3_5vMA%40mail.gmail.com 0001 adjusts how ForeignScanState.resultRelInfo is initialized for use b

Re: Enumize logical replication message actions

2020-10-29 Thread Amit Kapila
On Fri, Oct 30, 2020 at 10:37 AM Peter Smith wrote: > > On Fri, Oct 30, 2020 at 2:46 PM Amit Kapila wrote: > > Hi Amit > > > You mentioned in the beginning that you prefer to use Enum instead of > > define so that switch cases can detect any remaining items but I have > > tried adding extra enum

Re: Add important info about ANALYZE after create Functional Index

2020-10-29 Thread Michael Paquier
On Thu, Oct 29, 2020 at 10:59:52AM +0900, Michael Paquier wrote: > REINDEX CONCURRENTLY is by design wanted to provide an experience > transparent to the user similar to what a plain REINDEX would do, at > least that's the idea behind it, so.. This qualifies as a bug to me, > in spirit. And in sp