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 >

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

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

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: 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

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

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 --

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

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

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: [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

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: 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

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

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,

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!

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

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

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

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

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. +/* -- + *

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

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)

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 +- > >

Re: PostmasterIsAlive() in recovery (non-USE_POST_MASTER_DEATH_SIGNAL builds)

2021-03-22 Thread Fujii Masao
On 2021/03/02 10:10, Thomas Munro wrote: On Tue, Mar 2, 2021 at 12:00 AM Thomas Munro wrote: On Mon, Nov 16, 2020 at 8:56 PM Michael Paquier wrote: No objections with the two changes from pg_usleep() to WaitLatch() so they could be applied separately first. I thought about committing

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

2021-03-22 Thread Mahendra Singh Thalor
On Tue, 23 Mar 2021 at 02:43, Justin Pryzby wrote: > > 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 > >

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

2021-03-22 Thread Pavel Stehule
po 22. 3. 2021 v 22:07 odesílatel Thomas Munro napsal: > 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

Re: PostmasterIsAlive() in recovery (non-USE_POST_MASTER_DEATH_SIGNAL builds)

2021-03-22 Thread Fujii Masao
On 2021/03/23 10:52, Thomas Munro wrote: On Tue, Mar 23, 2021 at 2:44 PM Fujii Masao wrote: I found 0001 patch was committed in de829ddf23, and which added new wait event WalrcvExit. This name seems not consistent with other wait events. I'm thinking it's better to rename it to

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

2021-03-22 Thread Neha Sharma
On Tue, Mar 23, 2021 at 10:08 AM Amul Sul wrote: > On Mon, Mar 22, 2021 at 3:03 PM Amit Langote > wrote: > > > > 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 >

Re: replication cleanup code incorrect way to use of HTAB HASH_REMOVE ?

2021-03-22 Thread Amit Kapila
On Mon, Mar 22, 2021 at 7:57 AM Amit Kapila wrote: > > On Mon, Mar 22, 2021 at 3:20 AM Peter Smith wrote: > > > > On Sun, Mar 21, 2021 at 8:54 PM Amit Kapila wrote: > > > > > > On Sat, Mar 20, 2021 at 12:54 PM Peter Smith > > > wrote: > > > > > > > > PSA my patch to correct this by firstly

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

2021-03-22 Thread Michael Paquier
On Mon, Mar 22, 2021 at 07:17:26PM +, Jacob Champion wrote: > v8's test_access lost the in-order log search from v7; I've added it > back in v9. The increased resistance to entropy seems worth the few > extra lines. Thoughts? I am not really sure that we need to bother about the ordering of

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

Re: shared-memory based stats collector

2021-03-22 Thread Kyotaro Horiguchi
At Fri, 19 Mar 2021 14:27:38 -0700, Andres Freund wrote in > Hi, > > On 2021-03-10 20:26:56 -0800, Andres Freund wrote: > > > + * We expose this shared entry now. You might think that the > > > entry > > > + * can be removed by a concurrent backend, but since we are > > >

Re: shared memory stats: high level design decisions: consistency, dropping

2021-03-22 Thread Greg Stark
On Sun, 21 Mar 2021 at 18:16, Stephen Frost wrote: > > Greetings, > > * Tom Lane (t...@sss.pgh.pa.us) wrote: > > I also believe that the snapshotting behavior has advantages in terms > > of being able to perform multiple successive queries and get consistent > > results from them. Only the most

Re: New IndexAM API controlling index vacuum strategies

2021-03-22 Thread Peter Geoghegan
On Mon, Mar 22, 2021 at 6:41 PM Masahiko Sawada wrote: > But we're not sure when the next anti-wraparound vacuum will take > place. Since the table is already vacuumed by a non-aggressive vacuum > with disabling index cleanup, an autovacuum will process the table > when the table gets modified

Re: New IndexAM API controlling index vacuum strategies

2021-03-22 Thread Peter Geoghegan
On Mon, Mar 22, 2021 at 8:28 PM Peter Geoghegan wrote: > You seem to be concerned about a similar contradiction. In fact it's > *very* similar contradiction, because this new GUC is naturally a > "sibling GUC" of both vacuum_freeze_table_age and > autovacuum_vacuum_max_age (the "units" are the

Re: a verbose option for autovacuum

2021-03-22 Thread Michael Paquier
On Mon, Mar 22, 2021 at 12:17:37PM +0900, Masahiko Sawada wrote: > I've updated the patch. I saved the index names at the beginning of > heap_vacuum_rel() for autovacuum logging, and add indstats and > nindexes to LVRelStats. Some functions still have nindexes as a > function argument but it seems

Re: a verbose option for autovacuum

2021-03-22 Thread Masahiko Sawada
On Tue, Mar 23, 2021 at 1:31 PM Michael Paquier wrote: > > On Mon, Mar 22, 2021 at 12:17:37PM +0900, Masahiko Sawada wrote: > > I've updated the patch. I saved the index names at the beginning of > > heap_vacuum_rel() for autovacuum logging, and add indstats and > > nindexes to LVRelStats. Some

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

Re: Key management with tests

2021-03-22 Thread Bruce Momjian
On Mon, Mar 22, 2021 at 08:38:37PM -0400, Bruce Momjian wrote: > > This particular patch (introducing the RelationIsPermanent() macro) > > seems like it'd be a nice thing to commit independently of the rest, > > reducing the size of this patch set..? > > Committed as suggested. Also, I have

RE: Disable WAL logging to speed up data loading

2021-03-22 Thread tsunakawa.ta...@fujitsu.com
From: Stephen Frost > First- what are you expecting would actually happen during crash recovery in > this specific case with your proposed new WAL level? ... > I'm not suggesting it's somehow more crash safe- but it's at least very clear > what happens in such a case, to wit: the entire table is

Re: Disable WAL logging to speed up data loading

2021-03-22 Thread Laurenz Albe
On Mon, 2021-03-22 at 13:22 -0400, Stephen Frost wrote: > * 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

Re: Handling of opckeytype / CREATE OPERATOR CLASS (bug?)

2021-03-22 Thread Tomas Vondra
On 3/23/21 3:13 AM, Tom Lane wrote: > Tomas Vondra writes: >> 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. > > Hm. Both catalogs.sgml and pg_opclass.h say specifically that >

Re: Handling of opckeytype / CREATE OPERATOR CLASS (bug?)

2021-03-22 Thread Tom Lane
Tomas Vondra writes: > On 3/23/21 3:13 AM, Tom Lane wrote: >> Hm. Both catalogs.sgml and pg_opclass.h say specifically that >> opckeytype should be zero if it's to be the same as the input >> column type. I don't think just dropping the enforcement of that >> is the right answer. > Yeah,

Re: Change default of checkpoint_completion_target

2021-03-22 Thread Michael Paquier
On Mon, Mar 22, 2021 at 01:11:00PM -0400, Stephen Frost wrote: > Unless there's anything further on this, I'll plan to commit it tomorrow > or Wednesday. Cool, looks fine to me. This version of the patch has forgotten to update one spot: src/backend/postmaster/checkpointer.c:double

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

2021-03-22 Thread Pavel Stehule
út 23. 3. 2021 v 0:35 odesílatel Thomas Munro napsal: > 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,

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

2021-03-22 Thread Fujii Masao
On 2021/03/23 3:59, James Coleman wrote: Are you saying we should only change the message for a single case: the case where we'd otherwise allow connections but EnableHotStandby is false? No. Let me clarify my opinion. At PM_STARTUP, "the database system is starting up" should be logged

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/23 9:05, Masahiro Ikeda wrote: Yes. I attached the v5 patch based on v3 patch. I renamed SignalHandlerForUnsafeExit() and fixed the following comment. Thanks for updating the patch! When the startup process exits because of recovery_target_action=shutdown, reaper() calls

Re: New IndexAM API controlling index vacuum strategies

2021-03-22 Thread Peter Geoghegan
On Mon, Mar 22, 2021 at 8:33 PM Peter Geoghegan wrote: > More concretely, maybe the new GUC is forced to be 1.05 of > vacuum_freeze_table_age. Of course that scheme is a bit arbitrary -- > but so is the existing 0.95 scheme. I meant to write 1.05 of autovacuum_vacuum_max_age. So just as

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

2021-03-22 Thread Amul Sul
On Mon, Mar 22, 2021 at 3:03 PM Amit Langote wrote: > > 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

Re: Type of wait events WalReceiverWaitStart and WalSenderWaitForWAL

2021-03-22 Thread Kyotaro Horiguchi
(I finally get to catch up here..) At Mon, 22 Mar 2021 13:59:47 +0900, Fujii Masao wrote in > > > On 2021/03/22 12:01, Kyotaro Horiguchi wrote: > > Mmm. I agree that it waits for WAL in most cases, but still WAL-wait > > is activity for me because it is not waiting for being cued by > >

Re: PostmasterIsAlive() in recovery (non-USE_POST_MASTER_DEATH_SIGNAL builds)

2021-03-22 Thread Thomas Munro
On Tue, Mar 23, 2021 at 2:44 PM Fujii Masao wrote: > I found 0001 patch was committed in de829ddf23, and which added new > wait event WalrcvExit. This name seems not consistent with other wait > events. I'm thinking it's better to rename it to WalReceiverExit. Thought? > Patch attached. Agreed,

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

2021-03-22 Thread tsunakawa.ta...@fujitsu.com
From: Andrey Lepikhov > Macros _() at the postgresExecForeignCopy routine: > if (PQputCopyEnd(conn, OK ? NULL : _("canceled by server")) <= 0) > > uses gettext. Under linux it is compiled ok, because (as i understood) > uses standard implementation of gettext: > objdump -t

RE: [PATCH] Tracking statements entry timestamp in pg_stat_statements

2021-03-22 Thread kuroda.hay...@fujitsu.com
Dear Andrei, I think the idea is good because the pg_stat_statements_info view cannot distinguish whether the specific statement is deallocated or not. But multiple calling of GetCurrentTimestamp() may cause some performance issues. How about adding a configuration parameter for controlling this

Re: Handling of opckeytype / CREATE OPERATOR CLASS (bug?)

2021-03-22 Thread Tom Lane
Tomas Vondra writes: > 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. Hm. Both catalogs.sgml and pg_opclass.h say specifically that opckeytype should be zero if it's to be the same as

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

2021-03-22 Thread tsunakawa.ta...@fujitsu.com
From: Justin Pryzby > On Mon, Mar 22, 2021 at 08:18:56PM -0700, Zhihong Yu wrote: > > with data_dest_cb callback. It is used for send text representation of a > > tuple to a custom destination. > > > > send text -> sending text > > I would say "It is used to send the text representation ..." I

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

2021-03-22 Thread Michael Paquier
On Mon, Mar 22, 2021 at 06:22:52PM +0100, Magnus Hagander wrote: > The 0002/0001/whateveritisaftertherebase is tracked over at > https://www.postgresql.org/message-id/flat/92e70110-9273-d93c-5913-0bccb6562...@dunslane.net > isn't it? I've assumed the expectation is to have that one committed >

Re: New IndexAM API controlling index vacuum strategies

2021-03-22 Thread Masahiko Sawada
On Fri, Mar 19, 2021 at 3:36 AM Peter Geoghegan wrote: > > On Thu, Mar 18, 2021 at 3:32 AM Masahiko Sawada wrote: > > If we have the constant threshold of 1 billion transactions, a vacuum > > operation might not be an anti-wraparound vacuum and even not be an > > aggressive vacuum, depending on

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

2021-03-22 Thread Zhihong Yu
Hi, In the description: with data_dest_cb callback. It is used for send text representation of a tuple to a custom destination. send text -> sending text struct PgFdwModifyState *aux_fmstate; /* foreign-insert state, if * created */ +

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

2021-03-22 Thread Justin Pryzby
On Mon, Mar 22, 2021 at 08:18:56PM -0700, Zhihong Yu wrote: > with data_dest_cb callback. It is used for send text representation of a > tuple to a custom destination. > > send text -> sending text I would say "It is used to send the text representation ..." > struct PgFdwModifyState

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/23 11:40, Fujii Masao wrote: > > > On 2021/03/23 9:05, Masahiro Ikeda wrote: >> Yes. I attached the v5 patch based on v3 patch. >> I renamed SignalHandlerForUnsafeExit() and fixed the following comment. > > Thanks for updating the patch! > > When the startup process exits because

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

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

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

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

Re: Get memory contexts of an arbitrary backend process

2021-03-22 Thread torikoshia
On 2021-03-18 15:09, Fujii Masao wrote: Thanks for your comments! On 2021/03/17 22:24, torikoshia wrote: I remade the patch and introduced a function pg_print_backend_memory_contexts(PID) which prints the memory contexts of the specified PID to elog. Thanks for the patch!   =# SELECT

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

2021-03-22 Thread Greg Nancarrow
On Mon, Mar 22, 2021 at 2:30 PM houzj.f...@fujitsu.com wrote: > > 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 > *

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

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

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

2021-03-22 Thread Michael Paquier
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 come up with an even simpler solution that has resulted in

[CLOBBER_CACHE]Server crashed with segfault 11 while executing clusterdb

2021-03-22 Thread Neha Sharma
Hello, While executing the below test case server crashed with Segfault 11 on master branch. I have enabled the CLOBBER_CACHE_ALWAYS in src/include/pg_config_manual.h Issue is only reproducing on master branch. *Test Case:* CREATE TABLE sm_5_323_table (col1 numeric); CREATE INDEX sm_5_323_idx

Re: Replication slot stats misgivings

2021-03-22 Thread Masahiko Sawada
On Mon, Mar 22, 2021 at 1:25 PM Masahiko Sawada wrote: > > On Sat, Mar 20, 2021 at 3:52 AM Andres Freund wrote: > > > > - If max_replication_slots was lowered between a restart, > > pgstat_read_statfile() will happily write beyond the end of > > replSlotStats. > > I think we cannot restart

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

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

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

[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

Re: proposal: schema variables - doc

2021-03-22 Thread Pavel Stehule
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: [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

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

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: [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] 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

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"

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

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

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

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: 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

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

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

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

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

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

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

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

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

  1   2   >