Re: Narrow the scope of the variable outputstr in logicalrep_write_tuple

2021-01-18 Thread Bharath Rupireddy
On Mon, Jan 18, 2021 at 1:16 PM japin wrote: > > > Hi, > > I find that the outputstr variable in logicalrep_write_tuple() only use in > `else` branch, I think we can narrow the scope, just like variable outputbytes > in `if` branch (for more readable). > > /* > * Send in binary if

[PATCH] ProcessInterrupts_hook

2021-01-18 Thread Craig Ringer
Hi folks A few times lately I've been doing things in extensions that've made me want to be able to run my own code whenever InterruptPending is true and CHECK_FOR_INTERRUPTS() calls ProcessInterrupts() So here's a simple patch to add ProcessInterrupts_hook. It follows the usual pattern like Proc

Re: Narrow the scope of the variable outputstr in logicalrep_write_tuple

2021-01-18 Thread japin
On Mon, 18 Jan 2021 at 15:59, Bharath Rupireddy wrote: > On Mon, Jan 18, 2021 at 1:16 PM japin wrote: >> >> >> Hi, >> >> I find that the outputstr variable in logicalrep_write_tuple() only use in >> `else` branch, I think we can narrow the scope, just like variable >> outputbytes >> in `if` br

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

2021-01-18 Thread tsunakawa.ta...@fujitsu.com
From: Tang, Haiying > (does this patch make some optimizes in serial insert? I'm a little confused > here, Because the patched execution time is less than unpatched, but I didn't > find information in commit messages about it. If I missed something, please > kindly let me know.) I haven't thought

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

2021-01-18 Thread Amit Kapila
On Mon, Jan 18, 2021 at 1:02 PM Tang, Haiying wrote: > > > From: Amit Kapila > > > Can we test cases when we have few rows in the Select table (say > > > 1000) and there 500 or 1000 partitions. In that case, we won't > > > select parallelism but we have to pay the price of checking > > > parallel

Re: Wrong usage of RelationNeedsWAL

2021-01-18 Thread Kyotaro Horiguchi
At Sun, 17 Jan 2021 23:02:18 -0800, Noah Misch wrote in > On Sun, Jan 17, 2021 at 10:36:31PM -0800, Noah Misch wrote: > > I wrote the above based on the "PageGetLSN(page) > (snapshot)->lsn" check in > > TestForOldSnapshot(). If the LSN isn't important, what else explains > > RelationAllowsEarlyP

Re: Determine parallel-safety of partition relations for Inserts

2021-01-18 Thread Amit Kapila
On Mon, Jan 18, 2021 at 10:27 AM tsunakawa.ta...@fujitsu.com wrote: > > From: Amit Kapila > > We already allow users to specify the degree of parallelism for all > > the parallel operations via guc's max_parallel_maintenance_workers, > > max_parallel_workers_per_gather, then we have a reloption >

Re: Improve handling of parameter differences in physical replication

2021-01-18 Thread Peter Eisentraut
On 2021-01-15 12:28, Sergei Kornilov wrote: The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:tested, passed Hello Look good for

RE: Determine parallel-safety of partition relations for Inserts

2021-01-18 Thread tsunakawa.ta...@fujitsu.com
From: Amit Kapila > Good question. I think if we choose to have a separate parameter for > DML, it can probably a boolean to just indicate whether to enable > parallel DML for a specified table and use the parallel_workers > specified in the table used in SELECT. Agreed. Regards Takayuki Tsunak

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2021-01-18 Thread Justin Pryzby
On Mon, Jan 18, 2021 at 02:18:44PM +0900, Michael Paquier wrote: > On Sat, Dec 12, 2020 at 01:45:26PM -0600, Justin Pryzby wrote: > > It's a lot like what I wrote as [PATCH v31 1/5] ExecReindex and > > ReindexParams > > In my v31 patch, I moved ReindexOptions to a private structure in > > indexcm

Re: evtfoid and evtowner missing in findoidjoins/README

2021-01-18 Thread Joel Jacobson
On Sun, Jan 17, 2021, at 21:32, Tom Lane wrote: >Well, SGML is actually plenty easy to parse as long as you've got xml >tooling at hand. We'd never want to introduce such a dependency in the >normal build process, but making something like findoidjoins depend on >such tools seems within reason. I

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

2021-01-18 Thread Amit Kapila
On Mon, Jan 18, 2021 at 10:45 AM Greg Nancarrow wrote: > > On Fri, Jan 15, 2021 at 7:39 PM Amit Kapila wrote: > > > > Here is an additional review of > > v11-0001-Enable-parallel-SELECT-for-INSERT-INTO-.-SELECT. There are > > quite a few comments raised on the V11-0001* patch. I suggest first > >

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

2021-01-18 Thread Tang, Haiying
Hi Tsunakawa-san > From: Tang, Haiying > > (does this patch make some optimizes in serial insert? I'm a little > > confused here, Because the patched execution time is less than > > unpatched, but I didn't find information in commit messages about it. > > If I missed something, please kindly le

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

2021-01-18 Thread Tang, Haiying
Hi Amit > I don't think the patch should have any impact on the serial case. I > think you can try to repeat each test 3 times both with and without a > patch and take the median of the three. Actually, I repeated about 10 times, the execution time is always less than unpatched. Regards, Tang

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

2021-01-18 Thread Amit Kapila
On Mon, Jan 18, 2021 at 2:40 PM Tang, Haiying wrote: > > Hi Tsunakawa-san > > > From: Tang, Haiying > > > (does this patch make some optimizes in serial insert? I'm a little > > > confused here, Because the patched execution time is less than > > > unpatched, but I didn't find information in comm

Re: popcount

2021-01-18 Thread Peter Eisentraut
On 2021-01-11 17:13, David Fetter wrote: On Mon, Jan 11, 2021 at 03:50:54PM +0100, Peter Eisentraut wrote: On 2020-12-30 17:41, David Fetter wrote: The input may have more than 2 billion bits set to 1. The biggest possible result should be 8 billion for bytea (1 GB with all bits set to 1). So s

Re: proposal: schema variables

2021-01-18 Thread Pavel Stehule
čt 14. 1. 2021 v 10:24 odesílatel Erik Rijkers napsal: > On 2021-01-14 07:35, Pavel Stehule wrote: > > [schema-variables-20210114.patch.gz] > > > Build is fine. My (small) list of tests run OK. > > I did notice a few more documentation peculiarities: > > > 'The PostgreSQL has schema variables' s

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

2021-01-18 Thread Amit Kapila
On Mon, Jan 18, 2021 at 2:42 PM Amit Kapila wrote: > > On Mon, Jan 18, 2021 at 10:45 AM Greg Nancarrow wrote: > > > > On Fri, Jan 15, 2021 at 7:39 PM Amit Kapila wrote: > > > > > > Here is an additional review of > > > v11-0001-Enable-parallel-SELECT-for-INSERT-INTO-.-SELECT. There are > > > qui

Re: proposal: schema variables

2021-01-18 Thread Pavel Stehule
Hi čt 14. 1. 2021 v 11:31 odesílatel Josef Šimánek napsal: > I did some testing locally. All runs smoothly, compiled without warning. > > Later on (once merged) it would be nice to write down a documentation > page for the whole feature as a set next to documented individual > commands. > It too

Re: proposal: schema variables

2021-01-18 Thread Pavel Stehule
po 18. 1. 2021 v 10:50 odesílatel Pavel Stehule napsal: > > > čt 14. 1. 2021 v 10:24 odesílatel Erik Rijkers napsal: > >> On 2021-01-14 07:35, Pavel Stehule wrote: >> > [schema-variables-20210114.patch.gz] >> >> >> Build is fine. My (small) list of tests run OK. >> >> I did notice a few more doc

Re: Proposal: Global Index

2021-01-18 Thread 曾文旌
> 2021年1月12日 02:37,Robert Haas 写道: > > On Mon, Jan 11, 2021 at 12:46 PM Bruce Momjian wrote: >>> For 1) The DETACH old child table can be finished immediately, global index >>> can be kept valid after DETACH is completed, and the cleanup of garbage >>> data in global index can be deferred to

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

2021-01-18 Thread Greg Nancarrow
On Mon, Jan 18, 2021 at 8:10 PM Amit Kapila wrote: > > > 1) > > > > >Here, it seems we are accessing the relation descriptor without any > > >lock on the table which is dangerous considering the table can be > > >modified in a parallel session. Is there a reason why you think this > > >is safe? Di

Re: Allow matching whole DN from a client certificate

2021-01-18 Thread Daniel Gustafsson
I've circled back to this and tested/read it more, and I'm still of the opinion that it's a good feature addition. A few small comments on the patch: + is the default, the username is matched against the certificate's In the docs we use "user name" instead of "username" in descriptive text.

search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault

2021-01-18 Thread David Geier
Hi hackers, While working with cursors that reference plans with CustomScanStates nodes, I encountered a segfault which originates from search_plan_tree(). The query plan is the result of a simple SELECT statement into which I inject a Custom Scan node at the root to do some post-processing b

Re: Single transaction in the tablesync worker?

2021-01-18 Thread Peter Smith
Hi Amit. PSA the v16 patch for the Tablesync Solution1. Main differences from v15: + Tablesync cleanups of DropSubscription/AlterSubscription_refresh are re-implemented as as ProcessInterrupts function Features: * The tablesync slot is now permanent instead of temporary. * The tablesync

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

2021-01-18 Thread Victor Yegorov
пн, 18 янв. 2021 г. в 07:44, Amit Kapila : > The summary of the above is that with Case-1 (clean-up based on hint > received with the last item on the page) it takes fewer operations to > cause a page split as compared to Case-2 (clean-up based on hint > received with at least of the items on the

Re: search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault

2021-01-18 Thread Ashutosh Bapat
On Mon, Jan 18, 2021 at 4:13 PM David Geier wrote: > > Hi hackers, > > While working with cursors that reference plans with CustomScanStates > nodes, I encountered a segfault which originates from > search_plan_tree(). The query plan is the result of a simple SELECT > statement into which I inject

Re: [PATCH] Add extra statistics to explain for Nested Loop

2021-01-18 Thread Michael Christofides
> New version of this patch prints extra statistics for all cases of > multiple loops, not only for Nested Loop. Also I fixed the example by > adding VERBOSE. > > Please don't hesitate to share any thoughts on this topic! Thanks a lot for working on this! I really like the extra details, and inclu

Re: Narrow the scope of the variable outputstr in logicalrep_write_tuple

2021-01-18 Thread Bharath Rupireddy
On Mon, Jan 18, 2021 at 1:39 PM japin wrote: > > > On Mon, 18 Jan 2021 at 15:59, Bharath Rupireddy > wrote: > > On Mon, Jan 18, 2021 at 1:16 PM japin wrote: > >> > >> > >> Hi, > >> > >> I find that the outputstr variable in logicalrep_write_tuple() only use in > >> `else` branch, I think we can

Re: ResourceOwner refactoring

2021-01-18 Thread Heikki Linnakangas
On 18/01/2021 09:49, kuroda.hay...@fujitsu.com wrote: Dear Heikki, I apologize for sending again. I will check another ResourceOwnerEnlarge() if I have a time. I checked all ResourceOwnerEnlarge() types after applying patch 0001. (searched by "grep -rI ResourceOwnerEnlarge") No problem was f

Re: Yet another fast GiST build

2021-01-18 Thread Heikki Linnakangas
On 18/01/2021 01:10, Peter Geoghegan wrote: On Sun, Jan 17, 2021 at 3:04 PM Peter Geoghegan wrote: I personally agree with you - it's not like there aren't other ways for superusers to crash the server (most of which seem very similar to this gist_page_items() issue, in fact). I just think that

simplifying foreign key/RI checks

2021-01-18 Thread Amit Langote
While discussing the topic of foreign key performance off-list with Robert and Corey (also came up briefly on the list recently [1], [2]), a few ideas were thrown around to simplify our current system of RI checks to enforce foreign keys with the aim of reducing some of its overheads. The two main

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

2021-01-18 Thread Amit Kapila
On Mon, Jan 18, 2021 at 5:11 PM Victor Yegorov wrote: > > пн, 18 янв. 2021 г. в 07:44, Amit Kapila : >> >> The summary of the above is that with Case-1 (clean-up based on hint >> received with the last item on the page) it takes fewer operations to >> cause a page split as compared to Case-2 (clea

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2021-01-18 Thread Fujii Masao
On 2021/01/18 15:37, Bharath Rupireddy wrote: On Mon, Jan 18, 2021 at 11:58 AM Fujii Masao wrote: On 2021/01/18 15:02, Hou, Zhijie wrote: We need to create the loopback3 with user mapping public, otherwise the test might become unstable as shown below. Note that loopback and loopback2 ar

回复:BEFORE ROW triggers for partitioned tables

2021-01-18 Thread 李杰(慎追)
Hi commiter, Many of our customers expect to use BR triggers in partitioned tables. After I followed your discussion, I also checked your patch. Here are two questions confusing me: 1. Your modification removes the check BR triggers against partitioned table, and a more friendly error message i

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2021-01-18 Thread Bharath Rupireddy
On Mon, Jan 18, 2021 at 6:17 PM Fujii Masao wrote: > > +1 to add it after "dropped (Note )", how about as follows > > with slight changes? > > > > dropped (Note that server name of an invalid connection can be NULL if > > the server is dropped), and then such . > > Yes, I like this one

Re: POC: Cleaning up orphaned files using undo logs

2021-01-18 Thread Antonin Houska
Dmitry Dolgov <9erthali...@gmail.com> wrote: > Thanks for the updated patch. As I've mentioned off the list I'm slowly > looking through it with the intent to concentrate on undo progress > tracking. But before I will post anything I want to mention couple of > strange issues I see, otherwise I wi

Re: list of extended statistics on psql

2021-01-18 Thread Tomas Vondra
On 1/18/21 8:31 AM, Tatsuro Yamada wrote: Hi Tomas and Shinoda-san, On 2021/01/17 23:31, Tomas Vondra wrote: On 1/17/21 3:01 AM, Tomas Vondra wrote: On 1/17/21 2:41 AM, Shinoda, Noriyoshi (PN Japan FSIP) wrote: Hi, hackers. I tested this committed feature. It doesn't seem to be availabl

Re: Added schema level support for publication.

2021-01-18 Thread vignesh C
On Sat, Jan 9, 2021 at 5:21 PM vignesh C wrote: > > On Fri, Jan 8, 2021 at 4:32 PM Amit Kapila wrote: > > > > On Thu, Jan 7, 2021 at 10:03 PM vignesh C wrote: > > > > > > This feature adds schema option while creating publication. Users will > > > be able to specify one or more schemas while cre

Re: [PATCH] ProcessInterrupts_hook

2021-01-18 Thread Robert Haas
On Mon, Jan 18, 2021 at 3:00 AM Craig Ringer wrote: > A few times lately I've been doing things in extensions that've made me want > to be able to run my own code whenever InterruptPending is true and > CHECK_FOR_INTERRUPTS() calls ProcessInterrupts() I've wanted this in the past, too, so +1 fr

Re: recovering from "found xmin ... from before relfrozenxid ..."

2021-01-18 Thread Robert Haas
On Sat, Jan 16, 2021 at 10:41 AM Andrey Borodin wrote: > Does anyone maintain opensource pg_surgery analogs for released versions of > PG? > It seems to me I'll have to use something like this and I just though that I > should consider pg_surgery in favour of our pg_dirty_hands. I do not. I'm s

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

2021-01-18 Thread Victor Yegorov
пн, 18 янв. 2021 г. в 13:42, Amit Kapila : > I don't think any of these can happen in what I am actually saying. Do > you still have the same feeling after reading this email? Off-hand, I > don't see any downsides as compared to the current approach and it > will have fewer splits in some other wo

Re: Transactions involving multiple postgres foreign servers, take 2

2021-01-18 Thread Zhihong Yu
Hi, Masahiko-san: bq. How about FdwXactRequestToLaunchResolver()? Sounds good to me. bq. But there is already a function named FdwXactExists() Then we can leave the function name as it is. Cheers On Sun, Jan 17, 2021 at 9:55 PM Masahiko Sawada wrote: > On Fri, Jan 15, 2021 at 7:45 AM Zhihon

Re: Additional Chapter for Tutorial - arch-dev.sgml

2021-01-18 Thread Heikki Linnakangas
On 20/11/2020 23:52, Erik Rijkers wrote: (smallish) Changes to arch-dev.sgml This looks good to me. One little complaint: @@ -125,7 +122,7 @@ use a supervisor process (also master process) that spawns a new server process every time a connection is requested. This supervisor -

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2021-01-18 Thread Bharath Rupireddy
On Mon, Jan 18, 2021 at 11:44 AM Fujii Masao wrote: > > I will post patches for the other function postgres_fdw_disconnect, > > GUC and server level option later. > > Thanks! Attaching v12 patch set. 0001 is for postgres_fdw_disconnect() function, 0002 is for keep_connections GUC and 0003 is for

TOAST condition for column size

2021-01-18 Thread torikoshia
Hi, When I created a table consisting of 400 VARCHAR columns and tried to INSERT a record which rows were all the same size, there were cases where I got an error due to exceeding the size limit per row. =# -- create a table consisting of 400 VARCHAR columns =# CREATE TABLE t1 (c1 VARCHAR(10

Re: proposal: schema variables

2021-01-18 Thread Erik Rijkers
On 2021-01-18 10:59, Pavel Stehule wrote: and here is the patch [schema-variables-20200118.patch.gz ] One small thing: The drop variable synopsis is: DROP VARIABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ] In that text following it, 'RESTRICT' is not documented. When used it does

Re: recovering from "found xmin ... from before relfrozenxid ..."

2021-01-18 Thread Michael Banck
On Mon, Jan 18, 2021 at 08:54:10AM -0500, Robert Haas wrote: > On Sat, Jan 16, 2021 at 10:41 AM Andrey Borodin wrote: > > Does anyone maintain opensource pg_surgery analogs for released > > versions of PG? It seems to me I'll have to use something like this > > and I just though that I should con

Re: ResourceOwner refactoring

2021-01-18 Thread Alvaro Herrera
On 2021-Jan-18, Heikki Linnakangas wrote: > +static ResourceOwnerFuncs jit_funcs = > +{ > + /* relcache references */ > + .name = "LLVM JIT context", > + .phase = RESOURCE_RELEASE_BEFORE_LOCKS, > + .ReleaseResource = ResOwnerReleaseJitContext, > + .PrintLeakWarning = ResOwnerPr

回复:BEFORE ROW triggers for partitioned tables

2021-01-18 Thread 李杰(慎追)
Hi commiter, Many of our customers expect to use BR triggers in partitioned tables. After I followed your discussion, I also checked your patch. Here are two questions confusing me: 1. Your modification removes the check BR triggers against partitioned table, and a more friendly error message i

Re: recovering from "found xmin ... from before relfrozenxid ..."

2021-01-18 Thread Robert Haas
On Mon, Jan 18, 2021 at 9:25 AM Michael Banck wrote: > One other possiblity would be to push a version of pg_surgery that is > compatible with the back-branches somewhere external (e.g. either > git.postgresql.org and/or Github), so that it can be picked up by > distributions and/or individual use

Re: New IndexAM API controlling index vacuum strategies

2021-01-18 Thread Zhihong Yu
Hi, Masahiko-san: For v2-0001-Introduce-IndexAM-API-for-choosing-index-vacuum-s.patch : For blvacuumstrategy(): + if (params->index_cleanup == VACOPT_TERNARY_DISABLED) + return INDEX_VACUUM_STRATEGY_NONE; + else + return INDEX_VACUUM_STRATEGY_BULKDELETE; The 'else' can be omitte

Re: ResourceOwner refactoring

2021-01-18 Thread Heikki Linnakangas
On 18/01/2021 16:34, Alvaro Herrera wrote: So according to your performance benchmark, we're willing to accept a 30% performance loss on an allegedly common operation -- numkeep=0 numsnaps=10 becomes 49.8ns from 37.6ns. That seems a bit shocking. Maybe you can claim that these operations aren't

Re: support for MERGE

2021-01-18 Thread Alvaro Herrera
Jaime Casanova just reported that this patch causes a crash on the regression database with this query: MERGE INTO public.pagg_tab_ml_p3 as target_0 USING public.prt2_l_p3_p2 as ref_0 ON target_0.a = ref_0.a WHEN MATCHED AND cast(null as tid) <= cast(null as tid)THEN DELETE; The reason

Re: POC: postgres_fdw insert batching

2021-01-18 Thread Zhihong Yu
Hi, Takayuki-san: + if (batch_size <= 0) + ereport(ERROR, + (errcode(ERRCODE_SYNTAX_ERROR), +errmsg("%s requires a non-negative integer value", It seems the message doesn't match the check w.r.t. the batch size of 0. + int

Re: popcount

2021-01-18 Thread Tom Lane
Peter Eisentraut writes: > [ assorted nits ] At the level of bikeshedding ... I quite dislike using the name "popcount" for these functions. I'm aware that some C compilers provide primitives of that name, but I wouldn't expect a SQL programmer to know that; without that context the name seems p

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2021-01-18 Thread Fujii Masao
On 2021/01/18 23:14, Bharath Rupireddy wrote: On Mon, Jan 18, 2021 at 11:44 AM Fujii Masao wrote: I will post patches for the other function postgres_fdw_disconnect, GUC and server level option later. Thanks! Attaching v12 patch set. 0001 is for postgres_fdw_disconnect() function, 0002 i

Re: Key management with tests

2021-01-18 Thread Bruce Momjian
On Sun, Jan 17, 2021 at 07:50:13PM -0500, Robert Haas wrote: > On Fri, Jan 15, 2021 at 7:56 PM Andres Freund wrote: > > I think that's not at all acceptable. I don't mind hashing out details > > on calls / off-list, but the design needs to be public, documented, and > > reviewable. And if it's so

Re: PoC/WIP: Extended statistics on expressions

2021-01-18 Thread Dean Rasheed
Looking through extended_stats.c, I found a corner case that can lead to a seg-fault: CREATE TABLE foo(); CREATE STATISTICS s ON (1) FROM foo; ANALYSE foo; This crashes in lookup_var_attr_stats(), because it isn't expecting nvacatts to be 0. I can't think of any case where building stats on a tab

Re: Key management with tests

2021-01-18 Thread Bruce Momjian
On Sun, Jan 17, 2021 at 11:54:57AM +0530, Amit Kapila wrote: > > Is there a design document for a Postgres feature of this size and > > scope that people feel would serve as a good example? Alternatively, > > is there a design document template that has been successfully used in > > the past? > >

Re: Key management with tests

2021-01-18 Thread Bruce Momjian
On Sat, Jan 16, 2021 at 10:58:47PM -0800, Andres Freund wrote: > Hi, > > On 2021-01-17 11:54:57 +0530, Amit Kapila wrote: > > On Sun, Jan 17, 2021 at 5:38 AM Tom Kincaid > > wrote: > > > Admittedly I am a novice on this topic, and the majority of the > > > PostgreSQL source code, however I am ho

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2021-01-18 Thread Zhihong Yu
Hi, For 0001-Allow-REINDEX-to-change-tablespace.patch : + * InvalidOid, use the tablespace in-use instead. 'in-use' seems a bit redundant in the sentence. How about : InvalidOid, use the tablespace of the index instead. Cheers On Mon, Jan 18, 2021 at 12:38 AM Justin Pryzby wrote: > On Mon, Ja

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2021-01-18 Thread Fujii Masao
On 2021/01/18 22:03, Bharath Rupireddy wrote: On Mon, Jan 18, 2021 at 6:17 PM Fujii Masao wrote: +1 to add it after "dropped (Note )", how about as follows with slight changes? dropped (Note that server name of an invalid connection can be NULL if the server is dropped), and then suc

Re: recovering from "found xmin ... from before relfrozenxid ..."

2021-01-18 Thread Andrey Borodin
> 18 янв. 2021 г., в 18:54, Robert Haas написал(а): > > On Sat, Jan 16, 2021 at 10:41 AM Andrey Borodin wrote: >> Does anyone maintain opensource pg_surgery analogs for released versions of >> PG? >> It seems to me I'll have to use something like this and I just though that I >> should cons

Re: support for MERGE

2021-01-18 Thread Robert Haas
On Thu, Dec 31, 2020 at 8:48 AM Alvaro Herrera wrote: > Here's a rebase of Simon/Pavan's MERGE patch to current sources. I > cleaned up some minor things in it, but aside from rebasing, it's pretty > much their work (even the commit message is Simon's). It's my impression that the previous discu

Re: Add session statistics to pg_stat_database

2021-01-18 Thread Laurenz Albe
On Sun, 2021-01-17 at 14:07 +0100, Magnus Hagander wrote: > I have applied this version, with some minor changes: > > * I renamed the n__time members in the struct to just > total__time. The n_ indicates "number of" and is thus wrong for > time parameters. Right. > * Some very minor wording chan

Re: ResourceOwner refactoring

2021-01-18 Thread Robert Haas
On Mon, Jan 18, 2021 at 10:19 AM Heikki Linnakangas wrote: > > On 18/01/2021 16:34, Alvaro Herrera wrote: > > So according to your performance benchmark, we're willing to accept a > > 30% performance loss on an allegedly common operation -- numkeep=0 > > numsnaps=10 becomes 49.8ns from 37.6ns. Th

Re: ResourceOwner refactoring

2021-01-18 Thread Robert Haas
On Mon, Jan 18, 2021 at 11:11 AM Robert Haas wrote: > On Mon, Jan 18, 2021 at 10:19 AM Heikki Linnakangas wrote: > > On 18/01/2021 16:34, Alvaro Herrera wrote: > > > So according to your performance benchmark, we're willing to accept a > > > 30% performance loss on an allegedly common operation -

Re: popcount

2021-01-18 Thread Daniel Verite
Peter Eisentraut wrote: > + /* > +* ceil(VARBITLEN(ARG1)/BITS_PER_BYTE) > +* done to minimize branches and instructions. > +*/ > > I don't know what that is supposed to mean or why that kind of tuning > would be necessary for a user-callable function. Also, the formula jus

Re: support for MERGE

2021-01-18 Thread Alvaro Herrera
On 2021-Jan-18, Robert Haas wrote: > On Thu, Dec 31, 2020 at 8:48 AM Alvaro Herrera > wrote: > > Here's a rebase of Simon/Pavan's MERGE patch to current sources. I > > cleaned up some minor things in it, but aside from rebasing, it's pretty > > much their work (even the commit message is Simon'

Re: Add session statistics to pg_stat_database

2021-01-18 Thread Magnus Hagander
On Mon, Jan 18, 2021 at 5:11 PM Laurenz Albe wrote: > > On Sun, 2021-01-17 at 14:07 +0100, Magnus Hagander wrote: > > I have applied this version, with some minor changes: > > > > * I renamed the n__time members in the struct to just > > total__time. The n_ indicates "number of" and is thus wrong

Re: [PATCH] ProcessInterrupts_hook

2021-01-18 Thread Tom Lane
Robert Haas writes: > On Mon, Jan 18, 2021 at 3:00 AM Craig Ringer > wrote: >> A few times lately I've been doing things in extensions that've made me want >> to be able to run my own code whenever InterruptPending is true and >> CHECK_FOR_INTERRUPTS() calls ProcessInterrupts() > I've wanted t

Re: Key management with tests

2021-01-18 Thread Bruce Momjian
On Mon, Jan 18, 2021 at 10:50:37AM -0500, Bruce Momjian wrote: > OK, I looked at that and it is good, and I see my patch is missing that. > Are people looking for me to take the wiki content, expand on it and tie > it to the code that will be applied, or something else like all the > various crypto

Re: Add primary keys to system catalogs

2021-01-18 Thread Tom Lane
Robert Haas writes: > I don't have any complaint about labelling some of the unique indexes > as primary keys, but I think installing foreign keys that don't really > enforce anything may lead to confusion. I'm not sure if I buy the "confusion" argument, but after thinking about this more I reali

Re: Key management with tests

2021-01-18 Thread Andres Freund
Hi, On 2021-01-18 12:06:35 -0500, Bruce Momjian wrote: > On Mon, Jan 18, 2021 at 10:50:37AM -0500, Bruce Momjian wrote: > > OK, I looked at that and it is good, and I see my patch is missing that. > > Are people looking for me to take the wiki content, expand on it and tie > > it to the code that

Re: simplifying foreign key/RI checks

2021-01-18 Thread Zhihong Yu
Hi, I was looking at this statement: insert into f select generate_series(1, 200, 2); Since certain generated values (the second half) are not in table p, wouldn't insertion for those values fail ? I tried a scaled down version (1000th) of your example: yugabyte=# insert into f select genera

Re: POC: postgres_fdw insert batching

2021-01-18 Thread Tomas Vondra
On 1/18/21 7:51 AM, tsunakawa.ta...@fujitsu.com wrote: Tomas-san, From: Amit Langote Good thing you reminded me that this is about inserts, and in that case no, ExecInitModifyTable() doesn't know all leaf partitions, it only sees the root table whose batch_size doesn't really matter. So it'

Re: [PATCH] ProcessInterrupts_hook

2021-01-18 Thread Robert Haas
On Mon, Jan 18, 2021 at 11:56 AM Tom Lane wrote: > > I've wanted this in the past, too, so +1 from me. > > I dunno, this seems pretty scary and easily abusable. There's not all > that much that can be done safely in ProcessInterrupts(), and we should > not be encouraging extensions to think they

Re: simplifying foreign key/RI checks

2021-01-18 Thread Pavel Stehule
po 18. 1. 2021 v 13:40 odesílatel Amit Langote napsal: > While discussing the topic of foreign key performance off-list with > Robert and Corey (also came up briefly on the list recently [1], [2]), > a few ideas were thrown around to simplify our current system of RI > checks to enforce foreign k

Re: [Patch] ALTER SYSTEM READ ONLY

2021-01-18 Thread Robert Haas
On Thu, Jan 14, 2021 at 6:29 AM Amul Sul wrote: > To move development, testing, and the review forward, I have commented out the > code acquiring CheckpointLock from CreateCheckPoint() in the 0003 patch and > added the changes for the checkpointer so that system read-write state change > request c

Re: search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault

2021-01-18 Thread Zhihong Yu
Hi, +* Custom scan nodes can be leaf nodes or inner nodes and therfore need special treatment. The special treatment applies to inner nodes. The above should be better phrased to clarify. Cheers On Mon, Jan 18, 2021 at 2:43 AM David Geier wrote: > Hi hackers, > > While working wit

Re: Online checksums patch - once again

2021-01-18 Thread Michael Banck
Hi, On Fri, Jan 15, 2021 at 11:32:56AM +0100, Daniel Gustafsson wrote: > The attached v30 adds the proposed optimizations in this thread as previously > asked for, as well as some small cleanups to the procsignal calling codepath > (replacing single call functions with just calling the function) a

Re: proposal: schema variables

2021-01-18 Thread Pavel Stehule
po 18. 1. 2021 v 15:24 odesílatel Erik Rijkers napsal: > On 2021-01-18 10:59, Pavel Stehule wrote: > >> > > and here is the patch > > [schema-variables-20200118.patch.gz ] > > > One small thing: > > The drop variable synopsis is: > > DROP VARIABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]

Re: Add primary keys to system catalogs

2021-01-18 Thread Tom Lane
I wrote: > ... I still like the idea of marking OID relationships in the > catalog headers though. Perhaps we should take Joel's suggestion > of a new system catalog more seriously, and have genbki.pl populate > such a catalog from info in the catalog header files. On second thought, a catalog is

Re: CLUSTER on partitioned index

2021-01-18 Thread Justin Pryzby
On Sat, Nov 28, 2020 at 08:03:02PM -0600, Justin Pryzby wrote: > On Sun, Nov 15, 2020 at 07:53:35PM -0600, Justin Pryzby wrote: > > On Wed, Nov 04, 2020 at 08:23:56PM -0600, Justin Pryzby wrote: > > > On Tue, Oct 27, 2020 at 07:33:12PM -0500, Justin Pryzby wrote: > > > > I'm attaching a counter-pro

Re: search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault

2021-01-18 Thread Tom Lane
David Geier writes: > search_plan_tree() assumes that > CustomScanState::ScanState::ss_currentRelation is never NULL. In my > understanding that only holds for CustomScanState nodes which are at the > bottom of the plan and actually read from a relation. CustomScanState > nodes which are not a

Re: WIP: System Versioned Temporal Table

2021-01-18 Thread Surafel Temesgen
On Mon, Jan 18, 2021 at 1:43 AM Vik Fearing wrote: > > This is not good, and I see that DROP SYSTEM VERSIONING also removes > these columns which is even worse. Please read the standard that you > are trying to implement! > > The standard states the function of ALTER TABLE ADD SYSTEM VERSIONING

Re: Key management with tests

2021-01-18 Thread Bruce Momjian
On Mon, Jan 18, 2021 at 09:42:54AM -0800, Andres Freund wrote: > Personally, but I admit that there's legitimate reasons to differ on > that note, I don't think it's reasonable for a feature this invasive to > commit preliminary patches without the major subsequent patches being in > a shape that a

Re: Key management with tests

2021-01-18 Thread Tom Kincaid
> > I have to admit I was kind of baffled that the wiki page wasn't > > sufficient, because it is one of the longest Postgres feature > > explanations I have seen, but I now think the missing part is tying > > the wiki contents to the code implementation. If that is it, please > > confirm. If it

Re: Key management with tests

2021-01-18 Thread Andres Freund
On 2021-01-18 13:58:20 -0500, Bruce Momjian wrote: > On Mon, Jan 18, 2021 at 09:42:54AM -0800, Andres Freund wrote: > > Personally, but I admit that there's legitimate reasons to differ on > > that note, I don't think it's reasonable for a feature this invasive to > > commit preliminary patches wit

Re: search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault

2021-01-18 Thread Zhihong Yu
Hi, It seems sstate->ss_currentRelation being null can only occur for T_ForeignScanState and T_CustomScanState. What about the following change ? Cheers diff --git a/src/backend/executor/execCurrent.c b/src/backend/executor/execCurrent.c index 0852bb9cec..56e31951d1 100644 --- a/src/backend/exec

Re: CheckpointLock needed in CreateCheckPoint()?

2021-01-18 Thread Robert Haas
On Thu, Jan 14, 2021 at 10:21 AM Robert Haas wrote: > Yeah, I think this lock is useless. In fact, I think it's harmful, > because it makes large sections of the checkpointer code, basically > all of it really, run with interrupts held off for no reason. > > It's not impossible that removing the l

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

2021-01-18 Thread Peter Geoghegan
On Sun, Jan 17, 2021 at 10:44 PM Amit Kapila wrote: > With the above example, it seems like it would also help when this is not > true. I'll respond to your remarks here separately, in a later email. > I am not sure what I proposed fits here but the bottom-up sounds like > we are starting from

Re: [PATCH] Add support for leading/trailing bytea trim()ing

2021-01-18 Thread Tom Lane
"Joel Jacobson" writes: > On Fri, Dec 4, 2020, at 22:02, Tom Lane wrote: >> (Maybe the existing ltrim/rtrim descrs are also like this, but if so >> I'd change them too.) > They weren't, but I think the description for the bytea functions > can be improved to have a more precise description > if w

Re: {CREATE INDEX, REINDEX} CONCURRENTLY improvements

2021-01-18 Thread Matthias van de Meent
On Fri, 15 Jan 2021 at 15:29, Álvaro Herrera wrote: > > So one last remaining improvement was to have VACUUM ignore processes > doing CIC and RC to compute the Xid horizon of tuples to remove. I > think we can do something simple like the attached patch. Regarding the patch: > +if (

Re: search_plan_tree(): handling of non-leaf CustomScanState nodes causes segfault

2021-01-18 Thread Tom Lane
Zhihong Yu writes: > It seems sstate->ss_currentRelation being null can only > occur for T_ForeignScanState and T_CustomScanState. > What about the following change ? Seems like more code for no very good reason. regards, tom lane

Re: CheckpointLock needed in CreateCheckPoint()?

2021-01-18 Thread Tom Lane
Robert Haas writes: > Here's a patch to remove CheckpointLock completely. ... > So I don't see any problem with just ripping this out entirely, but > I'd like to know if anybody else does. If memory serves, the reason for the lock was that the CHECKPOINT command used to run the checkpointing cod

Re: {CREATE INDEX, REINDEX} CONCURRENTLY improvements

2021-01-18 Thread Álvaro Herrera
On 2021-Jan-18, Matthias van de Meent wrote: > Example: > > 1.) RI starts > 2.) PHASE 2: filling the index: > 2.1.) scanning the heap (live tuple is cached) > < tuple is deleted > < last transaction other than RI commits, only snapshot of RI exists > < vacuum drops the tuple, and cannot remove it

Re: {CREATE INDEX, REINDEX} CONCURRENTLY improvements

2021-01-18 Thread Álvaro Herrera
On 2021-Jan-18, Matthias van de Meent wrote: > On Fri, 15 Jan 2021 at 15:29, Álvaro Herrera wrote: > Would this not need to be the following? Right now, it resets > potentially older h->catalog_oldest_nonremovable (which is set in the > PROC_IN_SAFE_IC branch). > > > +if (statusFlag

Re: PG vs LLVM 12 on seawasp, next round

2021-01-18 Thread Fabien COELHO
Hello Alvaro, The "no such file" error seems more like a machine local issue to me. I'll look into it when I have time, which make take some time. Hopefully over the holidays. This is still happening ... Any chance you can have a look at it? Indeed. I'll try to look (again) into it soon.

  1   2   >