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

2021-03-22 Thread Peter Smith
On Sun, Mar 21, 2021 at 6:37 PM Amit Kapila wrote: > > I have further updated the patch to implement unique GID on the > subscriber-side as discussed in the nearby thread [1]. That requires > some changes in the test. Additionally, I have updated some comments > and docs. Let me know what do you t

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

2021-03-22 Thread houzj.f...@fujitsu.com
> > I noticed that some comments may need updated since we introduced > parallel insert in this patch. > > > > 1) src/backend/executor/execMain.c > > * Don't allow writes in parallel mode. Supporting UPDATE and > DELETE > > * would require (a) storing the combocid hash in shared

Re: Using COPY FREEZE in pgbench

2021-03-22 Thread Fabien COELHO
Hello Tatsuo-san, 13.2 pgbench + master branch server: done in 15.47 s (drop tables 0.19 s, create tables 0.01 s, client-side generate 9.07 s, vacuum 2.07 s, primary keys 4.13 s). With patch on master branch: done in 13.38 s (drop tables 0.19 s, create tables 0.01 s, client-side generate 9.

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-22 Thread Fujii Masao
On 2021/03/22 9:50, ikedamsh wrote: Agreed. I separated the patches. If only the former is committed, my trivial concern is that there may be a disadvantage, but no advantage for the standby server. It may lead to performance degradation to the wal receiver by calling INSTR_TIME_SET_CURRENT(),

Re: [HACKERS] Custom compression methods (mac+lz4.h)

2021-03-22 Thread Dilip Kumar
On Mon, Mar 22, 2021 at 5:22 AM Tom Lane wrote: > Actually, after reading that closer, the problem only affects the > case where the compressed-data-length passed to the function is > a lie. So it shouldn't be a problem for our usage. > > Also, after studying the documentation for LZ4_decompress_

Re: PG13 fails to startup even though the current transaction is equal to the target transaction

2021-03-22 Thread Kyotaro Horiguchi
At Thu, 18 Mar 2021 17:59:34 -0400, Sean Jezewski wrote in > We've noticed what may be a regression / bug in PG13. > > I work at Heroku on the Data team, where we manage a fleet of Postgres > services. This change has resulted in breaking the UX we offer to customers > to manage their PG servic

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-03-22 Thread Amul Sul
In heapam_relation_copy_for_cluster(), begin_heap_rewrite() sets rwstate->rs_new_rel->rd_smgr correctly but next line tuplesort_begin_cluster() get called which cause the system cache invalidation and due to CCA setting, wipe out rwstate->rs_new_rel->rd_smgr which wasn't restored for the subsequent

Re: problem with RETURNING and update row movement

2021-03-22 Thread Amit Langote
On Sat, Mar 6, 2021 at 12:52 AM David Steele wrote: > On 10/30/20 6:00 AM, Amit Langote wrote: > > The question > > I guess is whether that thread must conclude before the fix here can > > be committed. > > Indeed. But it seems like there is a candidate patch on [1] though that > thread has also s

Re: [PATCH] Identify LWLocks in tracepoints

2021-03-22 Thread Peter Eisentraut
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 set no longer applies: http://cfbot.cputube.org/patch_32_2927.log

Re: [PATCH] Bug fix in initdb output

2021-03-22 Thread Juan José Santamaría Flecha
On Sun, Mar 21, 2021 at 10:28 PM Andrew Dunstan wrote: > > Note that the pg_ctl path is quoted, and those quotes are passed through > to cmd.exe. That's what makes it work. It's possibly not worth changing > it now, but if anything that's the change that should have been made here. > > The OP cla

UPDATE ... SET (single_column) = row_constructor is a bit broken from V10 906bfcad7ba7c

2021-03-22 Thread Mahendra Singh Thalor
Hi Hackers, Commit 906bfcad7ba7c has improved handling for "UPDATE ... SET (column_list) = row_constructor", but it has broken in some cases where it was working prior to this commit. After this commit query “DO UPDATE SET (t1_col)” is giving an error which was working fine earlier. commit 906bfc

Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.

2021-03-22 Thread Kyotaro Horiguchi
At Mon, 22 Mar 2021 14:07:43 +0900, Fujii Masao wrote in > > > On 2021/03/22 14:03, shinya11.k...@nttdata.com wrote: > >> Barring any objection, I will commit this. > >I think it's good except for a typo "thoes four bits" > > Thanks for the review! Attached is the updated version of the patch

Re: [PATCH] Provide more information to filter_prepare

2021-03-22 Thread Markus Wanner
Hello Amit, On 21.03.21 11:53, Amit Kapila wrote: During a discussion of GID's in the nearby thread [1], it came up that the replication solutions might want to generate a different GID based on xid for two-phase transactions, so it seems this patch has a use-case. thank you for reconsidering

Re: [PATCH] Identify LWLocks in tracepoints

2021-03-22 Thread Peter Eisentraut
On 20.03.21 01:29, Craig Ringer wrote: There is already support for that.  See the documentation at the end of this page: https://www.postgresql.org/docs/devel/dynamic-trace.html#DEFINING-TRACE-POINTS

Re: Built-in connection pooler

2021-03-22 Thread Konstantin Knizhnik
Hi, Thank you for review! On 21.03.2021 23:59, Zhihong Yu wrote: Hi, +          With load-balancing policy postmaster choose proxy with lowest load average. +          Load average of proxy is estimated by number of clients connection assigned to this proxy with extra weight for SSL connectio

Re: [PATCH] pg_stat_statements dealloc field ignores manual deallocation

2021-03-22 Thread Andrei Zubkov
On Fri, 2021-03-19 at 22:15 +0800, Julien Rouhaud wrote: > I disagree. The point of that field is to help users configuring > pg_stat_statements.max, as evictions have a huge overhead in many > workloads. > > If users remove entries for some reasons, we don't have to give the > impression > that

[PATCH] Tracking statements entry timestamp in pg_stat_statements

2021-03-22 Thread Andrei Zubkov
This is a proposal for a new feature in pg_stat_statements extension. As a statistical extension providing counters pg_stat_statements extension is a target for various sampling solutions. All of them interested in calculation of statement statistics increments between two samples. But we face a p

Re: WIP: BRIN multi-range indexes

2021-03-22 Thread Tomas Vondra
On 3/22/21 6:27 AM, Tomas Vondra wrote: > > ... > > All the regression tests work fine, with the exception of minmax-multi > on a CIDR column. I don't know why, but the CREATE INDEX then fails like > this: > > ERROR: missing operator 1(650,650) in opfamily 16463 > > 650 is cidr, so this essen

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

2021-03-22 Thread Peter Smith
On Mon, Mar 22, 2021 at 6:27 PM Peter Smith wrote: > > On Sun, Mar 21, 2021 at 6:37 PM Amit Kapila wrote: > > > > I have further updated the patch to implement unique GID on the > > subscriber-side as discussed in the nearby thread [1]. That requires > > some changes in the test. Additionally, I

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

2021-03-22 Thread tanghy.f...@fujitsu.com
On Sunday, March 21, 2021 4:37 PM Amit Kapila wrote: >I have further updated the patch to implement unique GID on the >subscriber-side as discussed in the nearby thread [1]. I did some tests(cross version & synchronous) on the latest patch set v65*, all tests passed. Here is the detail, please t

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Dilip Kumar
On Mon, Mar 22, 2021 at 5:25 AM Justin Pryzby wrote: > > On Sat, Mar 20, 2021 at 06:20:39PM -0500, Justin Pryzby wrote: > > Rebased on HEAD. > > 0005 forgot to update compression_1.out. > > Included changes to ./configure.ac and some other patches, but not Tomas's, > > since it'll make CFBOT get m

Re: [CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-03-22 Thread Amit Langote
On Mon, Mar 22, 2021 at 5:26 PM Amul Sul wrote: > In heapam_relation_copy_for_cluster(), begin_heap_rewrite() sets > rwstate->rs_new_rel->rd_smgr correctly but next line tuplesort_begin_cluster() > get called which cause the system cache invalidation and due to CCA setting, > wipe out rwstate->rs_

RE: should INSERT SELECT use a BulkInsertState?

2021-03-22 Thread houzj.f...@fujitsu.com
Hi, About the 0002-patch [Check for volatile defaults]. I wonder if we can check the volatile default value by traversing "query->targetList" in planner. IMO, the column default expression was written into the targetList, and the current parallel-safety check travere the "query->targetList" to

Re: proposal: schema variables - doc

2021-03-22 Thread Pavel Stehule
VARIABLE page the example is: > > CREATE VARIABLE var1 AS integer; > SELECT var1; > > I suggest to make that > > CREATE VARIABLE var1 AS date; > LET var1 = (select current_date); > SELECT var1; > > So that the example immediately shows an application of functionality. > done Thank you for the documentation review. Updated patch attached Regards Pavel > > Thanks, > > Erik Rijkers > > > > > > > > > > > > > > > > > Pavel > schema-variables-20210322.patch.gz Description: application/gzip

Re: Columns correlation and adaptive query optimization

2021-03-22 Thread Yugo NAGATA
Hello Konstantin, I tested this patch as a statistics advisor using TPC-H queries. The used parameters are: auto_explain.add_statistics_suggest_only = on auto_explain.add_statistics_threshold = 0.1 auto_explain.log_analyze = on auto_explain.log_min_duration = 0 auto_explain suggested to cre

Re: About to add WAL write/fsync statistics to pg_stat_wal view

2021-03-22 Thread ikedamsh
On 2021/03/22 16:50, Fujii Masao wrote: > > > On 2021/03/22 9:50, ikedamsh wrote: >> Agreed. I separated the patches. >> >> If only the former is committed, my trivial concern is that there may be >> a disadvantage, but no advantage for the standby server. It may lead to >> performance degradat

Re: proposal - psql - use pager for \watch command

2021-03-22 Thread Thomas Munro
On Mon, Mar 22, 2021 at 5:10 PM Pavel Stehule wrote: > probably there will not be an issue inside ncurses - the most complex part of > get_event is polling of input sources - tty and some other. The pspg should > not to stop there on tty reading. The problem is that Apple's /dev/tty device is d

Re: PG13 fails to startup even though the current transaction is equal to the target transaction

2021-03-22 Thread Sean Jezewski
Hi Kyotaro - Thanks for the response. I think it boils down to your comment: > I'm not sure. The direct cause of the "issue" is a promotion trigger > that came before reaching recovery target. That won't happen if the > "someone" doesn't do that. I think the question is 'under what conditions

RE: Support tab completion for upper character inputs in psql

2021-03-22 Thread tanghy.f...@fujitsu.com
On Tuesday, March 16, 2021 5:20 AM, Peter Eisentraut wrote: >The cases that complete with a query >result are not case insensitive right now. This affects things like > >UPDATE T > >as well. I think your first patch was basically right. But we need to >understand that this affects all com

Re: [PATCH] Bug fix in initdb output

2021-03-22 Thread Andrew Dunstan
On 3/22/21 4:36 AM, Juan José Santamaría Flecha wrote: > > On Sun, Mar 21, 2021 at 10:28 PM Andrew Dunstan > wrote: > > > Note that the pg_ctl path is quoted, and those quotes are passed > through > to cmd.exe. That's what makes it work. It's possibly not

Re: default result formats setting

2021-03-22 Thread Peter Eisentraut
On 21.03.21 20:18, Emre Hasegeli wrote: Could you look into the log files in that test directory what is going on? Command 'test-result-format' not found in /Users/hasegeli/Developer/postgres/tmp_install/Users/hasegeli/.local/pgsql/bin, /Users/hasegeli/.local/bin, /opt/homebrew/bin, /usr/local/

Re: proposal - psql - use pager for \watch command

2021-03-22 Thread Pavel Stehule
po 22. 3. 2021 v 13:13 odesílatel Thomas Munro napsal: > On Mon, Mar 22, 2021 at 5:10 PM Pavel Stehule > wrote: > > probably there will not be an issue inside ncurses - the most complex > part of get_event is polling of input sources - tty and some other. The > pspg should not to stop there on t

Re: New IndexAM API controlling index vacuum strategies

2021-03-22 Thread Masahiko Sawada
On Sat, Mar 20, 2021 at 11:05 AM Peter Geoghegan wrote: > > On Wed, Mar 17, 2021 at 7:55 PM Peter Geoghegan wrote: > > Attached patch series splits everything up. There is now a large patch > > that removes the tupgone special case, and a second patch that > > actually adds code that dynamically

Re: Failed assertion on standby while shutdown

2021-03-22 Thread Fujii Masao
On 2021/03/20 2:25, Maxim Orlov wrote: Hi, haсkers! Recently, I was doing some experiments with primary/standby instances interaction. In certain conditions I’ve got and was able to reproduce crash on failed assertion. The scenario is the following: 1. start primary server 2. start standby

Re: pgbench - add pseudo-random permutation function

2021-03-22 Thread Dean Rasheed
On Sun, 14 Mar 2021 at 16:08, Fabien COELHO wrote: > > > My main question on this now is, do you have a scholar reference for > > this algorithm? > > Nope, otherwise I would have put a reference. I'm a scholar though, if > it helps:-) > > I could not find any algorithm that fitted the bill. The us

Re: Disable WAL logging to speed up data loading

2021-03-22 Thread Stephen Frost
Greetings, * tsunakawa.ta...@fujitsu.com (tsunakawa.ta...@fujitsu.com) wrote: > From: Stephen Frost > > The argument here seems to stem from the idea that issueing a 'TRUNCATE' > > inside the transaction before starting the 'COPY' command is 'too hard'. > > > I could be wrong and perhaps opinion

Re: New IndexAM API controlling index vacuum strategies

2021-03-22 Thread Robert Haas
On Thu, Mar 18, 2021 at 9:42 PM Peter Geoghegan wrote: > The fact that we can *continually* reevaluate if an ongoing VACUUM is > at risk of taking too long is entirely the point here. We can in > principle end index vacuuming dynamically, whenever we feel like it > and for whatever reasons occur t

Re: Minimal logical decoding on standbys

2021-03-22 Thread Fabrízio de Royes Mello
On Thu, Mar 18, 2021 at 5:34 AM Drouvot, Bertrand wrote: > > Thanks! > > Just made minor changes to make it compiling again on current master (mainly had to take care of ResolveRecoveryConflictWithSnapshotFullXid() that has been introduced in e5d8a99903). > > Please find enclosed the new patch ver

Re: PG13 fails to startup even though the current transaction is equal to the target transaction

2021-03-22 Thread Fujii Masao
On 2021/03/22 21:40, Sean Jezewski wrote: Hi Kyotaro - Thanks for the response. I think it boils down to your comment: > I'm not sure.  The direct cause of the "issue" is a promotion trigger > that came before reaching recovery target.  That won't happen if the > "someone" doesn't do tha

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Robert Haas
On Sun, Mar 21, 2021 at 7:55 PM Justin Pryzby wrote: > Rebased again. Thanks, Justin. I committed 0003 and 0004 together as 226e2be3876d0bda3dc33d16dfa0bed246b7b74f. I also committed 0001 and 0002 together as 24f0e395ac5892cd12e8914646fe921fac5ba23d, but with some revisions, because your text was

Re: [HACKERS] Custom compression methods (mac+lz4.h)

2021-03-22 Thread Tom Lane
Dilip Kumar writes: > On Mon, Mar 22, 2021 at 5:22 AM Tom Lane wrote: >> Also, after studying the documentation for LZ4_decompress_safe >> and LZ4_decompress_safe_partial, I realized that liblz4 is also >> counting on the *output* buffer size to not be a lie. So we >> cannot pass it a number lar

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Justin Pryzby
On Mon, Mar 22, 2021 at 10:41:33AM -0400, Robert Haas wrote: > On Sun, Mar 21, 2021 at 7:55 PM Justin Pryzby wrote: > > Rebased again. > > Thanks, Justin. I committed 0003 and 0004 together as > 226e2be3876d0bda3dc33d16dfa0bed246b7b74f. I also committed 0001 and > 0002 together as 24f0e395ac5892c

Re: Disable WAL logging to speed up data loading

2021-03-22 Thread Laurenz Albe
On Mon, 2021-03-22 at 09:46 -0400, Stephen Frost wrote: > * tsunakawa.ta...@fujitsu.com (tsunakawa.ta...@fujitsu.com) wrote: > > From: Stephen Frost > > > The argument here seems to stem from the idea that issueing a 'TRUNCATE' > > > inside the transaction before starting the 'COPY' command is 'to

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

2021-03-22 Thread Fujii Masao
On 2021/03/20 13:40, Masahiro Ikeda wrote: Sorry, there is no evidence we should call it. I thought that to call FreeWaitEventSet() is a manner after using CreateWaitEventSet() and the performance impact to call it seems to be too small. (Please let me know if my understanding is wrong.) The

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 10:44 AM Justin Pryzby wrote: > Thanks. I just realized that if you also push the GUC change, then the docs > should change from to > > doc/src/sgml/config.sgml: > default_toast_compression (string) I've now also committed your 0005. As for 0006, aside from the no

Re: Disable WAL logging to speed up data loading

2021-03-22 Thread Stephen Frost
Greetings, * Laurenz Albe (laurenz.a...@cybertec.at) wrote: > On Mon, 2021-03-22 at 09:46 -0400, Stephen Frost wrote: > > * tsunakawa.ta...@fujitsu.com (tsunakawa.ta...@fujitsu.com) wrote: > > > From: Stephen Frost > > > > The argument here seems to stem from the idea that issueing a 'TRUNCATE' >

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Justin Pryzby
On Mon, Mar 22, 2021 at 11:05:19AM -0400, Robert Haas wrote: > On Mon, Mar 22, 2021 at 10:44 AM Justin Pryzby wrote: > > Thanks. I just realized that if you also push the GUC change, then the docs > > should change from to > > > > doc/src/sgml/config.sgml: > > default_toast_compression (s

Re: [HACKERS] Custom compression methods (mac+lz4.h)

2021-03-22 Thread Dilip Kumar
On Mon, Mar 22, 2021 at 8:11 PM Tom Lane wrote: > > Dilip Kumar writes: > > On Mon, Mar 22, 2021 at 5:22 AM Tom Lane wrote: > >> Also, after studying the documentation for LZ4_decompress_safe > >> and LZ4_decompress_safe_partial, I realized that liblz4 is also > >> counting on the *output* buffe

Re: [HACKERS] Custom compression methods (mac+lz4.h)

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 10:41 AM Tom Lane wrote: > > Okay, the fix makes sense. In fact, IMHO, in general also this fix > > looks like an optimization, I mean when slicelength >= > > VARRAWSIZE_4B_C(value), then why do we need to allocate extra memory > > even in the case of pglz. So shall we pu

Re: [HACKERS] Custom compression methods (mac+lz4.h)

2021-03-22 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 22, 2021 at 10:41 AM Tom Lane wrote: >> Yeah, I thought about that too, but do we want to assume that >> VARRAWSIZE_4B_C is the correct way to get the decompressed size >> for all compression methods? > I think it's OK to assume this. OK, cool. >> (If so, I th

Re: [HACKERS] Custom compression methods (mac+lz4.h)

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 11:48 AM Tom Lane wrote: > > Anyway, this particular macro name was chosen, it seems, for symmetry > > with VARDATA_4B_C, but if you want to change it to something else, I'm > > OK with that, too. > > After looking at postgres.h for a bit, I'm thinking that what these > sho

Re: [HACKERS] Custom compression methods (mac+lz4.h)

2021-03-22 Thread Tom Lane
Robert Haas writes: > On Mon, Mar 22, 2021 at 11:48 AM Tom Lane wrote: >> Possibly the former names should survive and the latter become >> wrappers around them, not sure. But we shouldn't be using the "4B" >> terminology anyplace except this part of postgres.h. > I would argue that it shouldn'

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 11:13 AM Justin Pryzby wrote: > The first iteration was pretty rough, and there's still some question in my > mind about where default_toast_compression_options[] should be defined. If > it's in the header file, then I could use lengthof() - but then it probably > gets mul

Re: Add docs stub for recovery.conf

2021-03-22 Thread Stephen Frost
Greetings, * Craig Ringer (craig.rin...@enterprisedb.com) wrote: > Pretty good to me. Thanks so much for your help and support with this. Thanks for helping me move it forward! > Index entries render as e.g. > > pg_xlogdump, The pg_xlogdump command > (see also pg_waldump) > > whera

Re: Disable WAL logging to speed up data loading

2021-03-22 Thread Laurenz Albe
On Mon, 2021-03-22 at 11:05 -0400, Stephen Frost wrote: > > Perhaps allowing to set unlogged tables to logged ones without writing WAL > > is a more elegant way to do that, but I cannot see how that would be any > > more crash safe than this patch. Besides, the feature doesn't exist yet. > > I'm

Re: Change default of checkpoint_completion_target

2021-03-22 Thread Stephen Frost
Greetings, * David Steele (da...@pgmasters.net) wrote: > I had a look at the patch and the change and new documentation seem sensible > to me. Thanks! > I think this phrase may be a bit too idiomatic: > > +consistent I/O load while also leaving some slop for checkpoint > > Perhaps just

Re: Protect syscache from bloating with negative cache entries

2021-03-22 Thread Bruce Momjian
On Thu, Jan 28, 2021 at 05:16:52PM +0900, Kyotaro Horiguchi wrote: > At Thu, 28 Jan 2021 16:50:44 +0900 (JST), Kyotaro Horiguchi > wrote in > > I was going to write in the doc something like "you can inspect memory > > consumption by catalog caches using pg_backend_memory_contexts", but > > all

Re: Disable WAL logging to speed up data loading

2021-03-22 Thread Stephen Frost
Greetings, * Laurenz Albe (laurenz.a...@cybertec.at) wrote: > On Mon, 2021-03-22 at 11:05 -0400, Stephen Frost wrote: > > > Perhaps allowing to set unlogged tables to logged ones without writing WAL > > > is a more elegant way to do that, but I cannot see how that would be any > > > more crash saf

Re: Proposal: Save user's original authenticated identity for logging

2021-03-22 Thread Magnus Hagander
On Mon, Mar 22, 2021 at 7:16 AM Michael Paquier wrote: > > On Fri, Mar 19, 2021 at 06:37:05PM +, Jacob Champion wrote: > > The same effect can be had by moving the log rotation to the top of the > > test that needs it, so I've done it that way in v7. > > After thinking more about 0001, I have

Re: Wired if-statement in gen_partprune_steps_internal

2021-03-22 Thread Ryan Lambert
Should the status of this patch be updated to ready for comitter to get in line for Pg 14 deadline? *Ryan Lambert* On Sun, Mar 7, 2021 at 11:38 PM Amit Langote wrote: > On Fri, Mar 5, 2021 at 7:50 AM Ryan Lambert > wrote: > > On Wed, Mar 3, 2021 at 11:03 PM Amit Langote > wrote: > >> > >> Sor

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 12:16 PM Robert Haas wrote: > But, what about giving the default_toast_compression_method GUC an > assign hook that sets a global variable of type "char" to the > appropriate value? Then GetDefaultToastCompression() goes away > entirely. That might be worth exploring. Actu

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

2021-03-22 Thread Stephen Frost
Greetings, * Thomas Munro (thomas.mu...@gmail.com) wrote: > On Fri, Dec 11, 2020 at 7:57 AM Stephen Frost wrote: > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > > > The if-we're-going-to-delay-anyway path in vacuum_delay_point seems > > > OK to add a touch more overhead to, though. > > > > Alright,

Re: Nicer error when connecting to standby with hot_standby=off

2021-03-22 Thread Fujii Masao
On 2021/03/19 23:35, James Coleman wrote: Here's an updated patch; I think I've gotten what Alvaro suggested. Thanks for updating the patch! But I was thinking that our consensus is something like the attached patch. Could you check this patch? Regards, -- Fujii Masao Advanced Computing Tec

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Justin Pryzby
On Mon, Mar 22, 2021 at 01:38:36PM -0400, Robert Haas wrote: > On Mon, Mar 22, 2021 at 12:16 PM Robert Haas wrote: > > But, what about giving the default_toast_compression_method GUC an > > assign hook that sets a global variable of type "char" to the > > appropriate value? Then GetDefaultToastCom

Re: Fix pg_upgrade to preserve datdba

2021-03-22 Thread Jan Wieck
On 3/21/21 3:56 PM, Tom Lane wrote: Jan Wieck writes: So let's focus on the actual problem of running out of XIDs and memory while doing the upgrade involving millions of small large objects. Right. So as far as --single-transaction vs. --create goes, that's mostly a definitional problem. A

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Tom Lane
Robert Haas writes: > I think this is significantly cleaner than what we have now, and I > also prefer it to your proposal. +1 in general. However, I suspect that you did not try to compile this without --with-lz4, because if you had you'd have noticed the other uses of NO_LZ4_SUPPORT() that you

Re: Nicer error when connecting to standby with hot_standby=off

2021-03-22 Thread James Coleman
On Mon, Mar 22, 2021 at 1:49 PM Fujii Masao wrote: > > > > On 2021/03/19 23:35, James Coleman wrote: > > Here's an updated patch; I think I've gotten what Alvaro suggested. > > Thanks for updating the patch! But I was thinking that our consensus is > something like the attached patch. Could you ch

Re: New IndexAM API controlling index vacuum strategies

2021-03-22 Thread Peter Geoghegan
On Mon, Mar 22, 2021 at 7:05 AM Robert Haas wrote: > I agree. I was having trouble before understanding exactly what you > are proposing, but this makes sense to me and I agree it's a good > idea. Our ambition is for this to be one big multi-release umbrella project, with several individual enhan

Re: [POC] Fast COPY FROM command for the table with foreign partitions

2021-03-22 Thread Andrey Lepikhov
On 5/3/21 21:54, tsunakawa.ta...@fujitsu.com wrote: I've managed to rebased it, although it took unexpectedly long. The patch is attached. It passes make check against core and postgres_fdw. I'll turn the CF status back to ready for committer shortly. Macros _() at the postgresExecForeignC

Re: Proposal: Save user's original authenticated identity for logging

2021-03-22 Thread Jacob Champion
On Mon, 2021-03-22 at 18:22 +0100, Magnus Hagander wrote: > On Mon, Mar 22, 2021 at 7:16 AM Michael Paquier wrote: > > > > I have briefly looked at 0002 (0001 in the attached set), and it seems > > sane to me. I still need to look at 0003 (well, now 0002) in details, > > which is very sensible a

Re: Nicer error when connecting to standby with hot_standby=off

2021-03-22 Thread Fujii Masao
On 2021/03/23 3:25, James Coleman wrote: On Mon, Mar 22, 2021 at 1:49 PM Fujii Masao wrote: On 2021/03/19 23:35, James Coleman wrote: Here's an updated patch; I think I've gotten what Alvaro suggested. Thanks for updating the patch! But I was thinking that our consensus is something li

Re: Nicer error when connecting to standby with hot_standby=off

2021-03-22 Thread James Coleman
On Mon, Mar 22, 2021 at 2:52 PM Fujii Masao wrote: > > > > On 2021/03/23 3:25, James Coleman wrote: > > On Mon, Mar 22, 2021 at 1:49 PM Fujii Masao > > wrote: > >> > >> > >> > >> On 2021/03/19 23:35, James Coleman wrote: > >>> Here's an updated patch; I think I've gotten what Alvaro suggested. >

Re: Proposal: Save user's original authenticated identity for logging

2021-03-22 Thread Jacob Champion
On Mon, 2021-03-22 at 15:16 +0900, Michael Paquier wrote: > On Fri, Mar 19, 2021 at 06:37:05PM +, Jacob Champion wrote: > > The same effect can be had by moving the log rotation to the top of the > > test that needs it, so I've done it that way in v7. > > After thinking more about 0001, I have

Re: shared-memory based stats collector

2021-03-22 Thread Andres Freund
Hi, On 2021-03-19 14:27:38 -0700, Andres Freund wrote: > Yep, it's not even particularly hard to hit: > > S0: CREATE TABLE a_table(); > S0: INSERT INTO a_table(); > S0: disconnect > S1: set a breakpoint to just after the dshash_release_lock(), with an > if objid == a_table_oid > S1: SELECT pg_sta

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 2:10 PM Tom Lane wrote: > Robert Haas writes: > > I think this is significantly cleaner than what we have now, and I > > also prefer it to your proposal. > > +1 in general. However, I suspect that you did not try to compile > this without --with-lz4, because if you had yo

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

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 1:48 PM Stephen Frost wrote: > Thanks for that. Attached is just a rebased version with a commit > message added. If there aren't any other concerns, I'll commit this in > the next few days and back-patch it. When it comes to 12 and older, > does anyone want to opine abo

Re: postgres_fdw: IMPORT FOREIGN SCHEMA ... LIMIT TO (partition)

2021-03-22 Thread Bernd Helmle
Am Donnerstag, dem 21.01.2021 um 15:56 +0100 schrieb Matthias van de Meent: > Hi, > > Recently I was trying to copy some of the data of one database to > another through postgres_fdw, and found that it wouldn't import that > partition through IMPORT FOREIGN SCHEMA, even when I explicitly > specifi

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 1:58 PM Justin Pryzby wrote: > guc.c should not longer define this as extern: > default_toast_compression_options Fixed. > I think you should comment that default_toast_compression is an int as far as > guc.c is concerned, but storing one of the char value of TOAST_*_COMP

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Robert Haas
On Mon, Mar 22, 2021 at 4:33 PM Robert Haas wrote: > On Mon, Mar 22, 2021 at 1:58 PM Justin Pryzby wrote: > > guc.c should not longer define this as extern: > > default_toast_compression_options > > Fixed. Fixed some more. -- Robert Haas EDB: http://www.enterprisedb.com v3-0001-Tidy-up-more-

Re: Since '2001-09-09 01:46:40'::timestamp microseconds are lost when extracting epoch

2021-03-22 Thread Peter Eisentraut
On 19.03.21 21:06, Tom Lane wrote: I guess the immediate question is how much of a performance gap there is now between the float and numeric implementations. Attached are my test script and the full output. To summarize, for cases that don't do any interesting computation and where the over

Re: proposal - psql - use pager for \watch command

2021-03-22 Thread Thomas Munro
On Tue, Mar 23, 2021 at 1:53 AM Pavel Stehule wrote: > po 22. 3. 2021 v 13:13 odesílatel Thomas Munro > napsal: >> The problem is that Apple's /dev/tty device is defective, and doesn't >> work in poll(). It always returns immediately with revents=POLLNVAL, >> but pspg assumes that data is ready

Re: UPDATE ... SET (single_column) = row_constructor is a bit broken from V10 906bfcad7ba7c

2021-03-22 Thread Justin Pryzby
On Mon, Mar 22, 2021 at 02:10:49PM +0530, Mahendra Singh Thalor wrote: > Hi Hackers, > > Commit 906bfcad7ba7c has improved handling for "UPDATE ... SET > (column_list) = row_constructor", but it has broken in some cases where it > was working prior to this commit. > After this commit query “DO UPD

Re: pg_upgrade failing for 200+ million Large Objects

2021-03-22 Thread Zhihong Yu
> > Hi, > w.r.t. pg_upgrade_improvements.v2.diff. + blobBatchCount = 0; + blobInXact = false; The count and bool flag are always reset in tandem. It seems variable blobInXact is not needed. Cheers

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2021-03-22 Thread Bruce Momjian
On Sat, Mar 20, 2021 at 02:12:34PM +0800, Julien Rouhaud wrote: > On Fri, Mar 19, 2021 at 12:53:18PM -0400, Bruce Momjian wrote: > > > > Well, given we don't really want to support multiple query id types > > being generated or displayed, the "error out" above should fix it. > > > > Let's do thi

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Justin Pryzby
On Mon, Mar 22, 2021 at 03:47:58PM -0400, Robert Haas wrote: > On Mon, Mar 22, 2021 at 2:10 PM Tom Lane wrote: > > Robert Haas writes: > > > I think this is significantly cleaner than what we have now, and I > > > also prefer it to your proposal. > > > > +1 in general. However, I suspect that yo

Re: shared-memory based stats collector

2021-03-22 Thread Andres Freund
Hi, On 2021-03-22 12:02:39 +0900, Kyotaro Horiguchi wrote: > At Mon, 22 Mar 2021 09:55:59 +0900 (JST), Kyotaro Horiguchi > wrote in > > At Thu, 18 Mar 2021 01:47:20 -0700, Andres Freund > > wrote in > > > Hi, > > > > > > On 2021-03-18 16:56:02 +0900, Kyotaro Horiguchi wrote: > > > > At Tue, 16

Re: Allow an alias to be attached directly to a JOIN ... USING

2021-03-22 Thread Tom Lane
Peter Eisentraut writes: > I think Tom's input on the guts of this patch would be most valuable, > since it intersects a lot with the parse namespace refactoring he did. I really didn't like the way you'd done that :-(. My primary complaint is that any one ParseNamespaceItem can describe only o

Re: pg_upgrade failing for 200+ million Large Objects

2021-03-22 Thread Jan Wieck
On 3/22/21 5:36 PM, Zhihong Yu wrote: Hi, w.r.t. pg_upgrade_improvements.v2.diff. +       blobBatchCount = 0; +       blobInXact = false; The count and bool flag are always reset in tandem. It seems variable blobInXact is not needed. You are right. I will fix that. Thanks, Jan -- Jan

Re: proposal - psql - use pager for \watch command

2021-03-22 Thread Thomas Munro
On Sun, Mar 21, 2021 at 11:43 PM Pavel Stehule wrote: > so 20. 3. 2021 v 23:45 odesílatel Thomas Munro > napsal: >> Thoughts? I put my changes into a separate patch for clarity, but >> they need some more tidying up. > > yes, your solution is much better. Hmm, there was a problem with it thoug

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

2021-03-22 Thread Peter Smith
On Mon, Mar 22, 2021 at 11:51 PM Amit Kapila wrote: > > I have incorporated all your changes and additionally made few more > changes (a) got rid of LogicalRepBeginPrepareData and instead used > LogicalRepPreparedTxnData, (b) made a number of changes in comments > and docs, (c) ran pgindent, (d) m

Re: [HACKERS] Custom compression methods

2021-03-22 Thread Tom Lane
Justin Pryzby writes: > On Mon, Mar 22, 2021 at 03:47:58PM -0400, Robert Haas wrote: >> Are you sure you're looking at the patch I sent, >> toast-compression-guc-rmh.patch? I can't help wondering if you applied >> it to a dirty source tree or got the wrong file or something, because >> otherwise I

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

2021-03-22 Thread Masahiro Ikeda
On 2021/03/22 23:59, Fujii Masao wrote: > > > On 2021/03/20 13:40, Masahiro Ikeda wrote: >> Sorry, there is no evidence we should call it. >> I thought that to call FreeWaitEventSet() is a manner after using >> CreateWaitEventSet() and the performance impact to call it seems to be too >> small.

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2021-03-22 Thread Zhihong Yu
Hi, For queryjumble.c : + * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group The year should be updated. Same with queryjumble.h Cheers On Mon, Mar 22, 2021 at 2:56 PM Bruce Momjian wrote: > On Sat, Mar 20, 2021 at 02:12:34PM +0800, Julien Rouhaud wrote: > > On Fri, Mar 1

Re: shared-memory based stats collector

2021-03-22 Thread Andres Freund
Hi, On 2021-03-22 16:17:37 -0700, Andres Freund wrote: > and to reduce unnecessary diff noise This patch has just tons of stuff like: -/* - * Calculate function call usage and update stat counters. - * Called by the executor after invoking a function. +/* -- + * pgstat_end_function_usage

Re: Key management with tests

2021-03-22 Thread Bruce Momjian
On Thu, Mar 18, 2021 at 11:31:34AM -0400, Stephen Frost wrote: > > src/backend/access/gist/gistutil.c | 2 +- > > src/backend/access/heap/heapam_handler.c | 2 +- > > src/backend/catalog/pg_publication.c | 2 +- > > src/backend/commands/tablecmds.c | 10 +- > > src/bac

Re: create table like: ACCESS METHOD

2021-03-22 Thread Justin Pryzby
On Tue, Jan 19, 2021 at 03:03:31PM -0600, Justin Pryzby wrote: > On Wed, Dec 30, 2020 at 12:33:56PM +, Simon Riggs wrote: > > There are no tests for the new functionality, please could you add some? > > Did you look at the most recent patch? > > +CREATE ACCESS METHOD heapdup TYPE TABLE HANDLE

Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?

2021-03-22 Thread Bruce Momjian
On Mon, Mar 22, 2021 at 05:17:15PM -0700, Zhihong Yu wrote: > Hi, > For queryjumble.c : > > + * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group > > The year should be updated. > Same with queryjumble.h Thanks, fixed. -- Bruce Momjian https://momjian.us EDB

Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.

2021-03-22 Thread Fujii Masao
On 2021/03/22 17:49, Kyotaro Horiguchi wrote: At Mon, 22 Mar 2021 14:07:43 +0900, Fujii Masao wrote in On 2021/03/22 14:03, shinya11.k...@nttdata.com wrote: Barring any objection, I will commit this. I think it's good except for a typo "thoes four bits" Thanks for the review! Attached

Re: Type of wait events WalReceiverWaitStart and WalSenderWaitForWAL

2021-03-22 Thread Fujii Masao
On 2021/03/22 13:59, Fujii Masao wrote: Ok, so barring any objection, I will commit the patch that I posted upthread. Pushed! I'm waiting for other two patches to be reviewed :) Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CO

Handling of opckeytype / CREATE OPERATOR CLASS (bug?)

2021-03-22 Thread Tomas Vondra
Hi, while working on the new BRIN opclasses in [1], I stumbled on something I think is actually a bug in how CREATE OPERATOR CLASS handles the storage type. If you look at built-in opclasses, there's a bunch of cases where (opcintype == opckeytype), for example the BRIN opclasses for inet data typ

  1   2   >