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

2021-01-31 Thread Bharath Rupireddy
On Mon, Feb 1, 2021 at 12:43 PM Fujii Masao wrote: > On 2021/01/27 10:06, Bharath Rupireddy wrote: > > On Tue, Jan 26, 2021 at 8:38 AM Bharath Rupireddy > > wrote: > >> I will post "keep_connections" GUC and "keep_connection" server level > >> option patches later. > > > > Attaching v19 patch

Re: Single transaction in the tablesync worker?

2021-01-31 Thread Peter Smith
On Mon, Feb 1, 2021 at 5:19 PM Amit Kapila wrote: > > > AFAIK there is always a potential race with DropSubscription dropping > > > > slots. The DropSubscription might be running at exactly the same time > > > > the apply worker has just dropped the very same tablesync slot. > > > > > > > > > >

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

2021-01-31 Thread Bharath Rupireddy
On Mon, Feb 1, 2021 at 12:29 PM Fujii Masao wrote: > On 2021/01/30 9:28, Bharath Rupireddy wrote: > > On Sat, Jan 30, 2021 at 12:14 AM Fujii Masao > > wrote: > >> + /* > >> +* It doesn't make sense to show this entry in the > >> output with a > >> +

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

2021-01-31 Thread Fujii Masao
On 2021/01/27 10:06, Bharath Rupireddy wrote: On Tue, Jan 26, 2021 at 8:38 AM Bharath Rupireddy wrote: I will post "keep_connections" GUC and "keep_connection" server level option patches later. Attaching v19 patch set for "keep_connections" GUC and "keep_connection" server level option.

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

2021-01-31 Thread Fujii Masao
On 2021/01/30 9:28, Bharath Rupireddy wrote: On Sat, Jan 30, 2021 at 12:14 AM Fujii Masao wrote: + /* +* It doesn't make sense to show this entry in the output with a +* NULL server_name as it will be closed at the xact

Re: Is Recovery actually paused?

2021-01-31 Thread Kyotaro Horiguchi
At Sun, 31 Jan 2021 11:24:30 +0530, Dilip Kumar wrote in > On Fri, Jan 29, 2021 at 4:33 PM Dilip Kumar wrote: > > > > On Fri, Jan 29, 2021 at 3:25 PM Yugo NAGATA wrote: > > > > > > On Thu, 28 Jan 2021 09:55:42 +0530 > > > Dilip Kumar wrote: > > > > > > > On Wed, Jan 27, 2021 at 2:28 PM Dilip

Re: [sqlsmith] Failed assertion during partition pruning

2021-01-31 Thread David Rowley
On Mon, 1 Feb 2021 at 18:57, Tom Lane wrote: > > I wrote: > > David Rowley writes: > >> Parent RT indexes are guaranteed to be lower than their children RT > >> indexes, > > > I was intentionally avoiding that assumption ;-). Maybe it buys enough > > to be worth the loss of generality, but ...

Re: Single transaction in the tablesync worker?

2021-01-31 Thread Amit Kapila
On Mon, Feb 1, 2021 at 11:23 AM Peter Smith wrote: > > On Mon, Feb 1, 2021 at 3:44 PM Amit Kapila wrote: > > > > On Mon, Feb 1, 2021 at 9:38 AM Peter Smith wrote: > > > > > > > I think this is true only when the user specifically requested it by > > > > the use of "ALTER SUBSCRIPTION ... SET

Re: Faulty HEAP_XMAX_LOCK_ONLY & HEAP_KEYS_UPDATED hintbit combination

2021-01-31 Thread Dilip Kumar
On Sun, Jan 24, 2021 at 9:31 PM Alvaro Herrera wrote: > > On 2021-Jan-24, Julien Rouhaud wrote: > > > + /* > > + * Do not allow tuples with invalid combinations of hint bits to be > > placed > > + * on a page. These combinations are detected as corruption by the > > + *

Re: [sqlsmith] Failed assertion during partition pruning

2021-01-31 Thread Tom Lane
I wrote: > David Rowley writes: >> Parent RT indexes are guaranteed to be lower than their children RT >> indexes, > I was intentionally avoiding that assumption ;-). Maybe it buys enough > to be worth the loss of generality, but ... Oh, it's too late at night. I now remember that the real

Re: Single transaction in the tablesync worker?

2021-01-31 Thread Peter Smith
On Mon, Feb 1, 2021 at 3:44 PM Amit Kapila wrote: > > On Mon, Feb 1, 2021 at 9:38 AM Peter Smith wrote: > > > > On Mon, Feb 1, 2021 at 1:54 PM Amit Kapila wrote: > > > > > > On Mon, Feb 1, 2021 at 6:48 AM Peter Smith wrote: > > > > > > > > On Sun, Jan 31, 2021 at 12:19 AM Amit Kapila > > > >

Re: [sqlsmith] Failed assertion during partition pruning

2021-01-31 Thread Tom Lane
David Rowley writes: > What I can't understand is why you changed to a List-of-Lists rather > than a List-of-Relids. Yeah, I spent no effort on micro-optimizing the data structure. I figured that since we were not including leaf partitions, there would never be enough rels involved to worry

Re: Single transaction in the tablesync worker?

2021-01-31 Thread Amit Kapila
On Mon, Feb 1, 2021 at 10:14 AM Amit Kapila wrote: > > On Mon, Feb 1, 2021 at 9:38 AM Peter Smith wrote: > > > > On Mon, Feb 1, 2021 at 1:54 PM Amit Kapila wrote: > > > > > > On Mon, Feb 1, 2021 at 6:48 AM Peter Smith wrote: > > > > > > > > On Sun, Jan 31, 2021 at 12:19 AM Amit Kapila > > >

Re: [sqlsmith] Failed assertion during partition pruning

2021-01-31 Thread David Rowley
On Sun, 31 Jan 2021 at 11:42, Tom Lane wrote: > > For simplicity of review I divided the patch into two parts. > 0001 revises make_partition_pruneinfo() and children to identify > the relevant parent partitions for themselves, which is not too > hard to do by chasing up the child-to-parent

Re: Printing backtrace of postgres processes

2021-01-31 Thread Bharath Rupireddy
On Mon, Feb 1, 2021 at 6:14 AM Bharath Rupireddy wrote: > On Fri, Jan 29, 2021 at 7:10 PM vignesh C wrote: > > > 4) How about following > > > + errmsg("must be a superuser to print backtrace > > > of backend process"))); > > > instead of > > > +

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

2021-01-31 Thread Julien Rouhaud
On Thu, Jan 28, 2021 at 8:38 PM Yugo NAGATA wrote: > > postgres=# explain (analyze, verbose) select * from a,b where a.i=b.j; > > QUERY PLAN >

RE: Determine parallel-safety of partition relations for Inserts

2021-01-31 Thread Hou, Zhijie
Hi greg, Thanks for the review ! > Personally, I think a table's "parallel_dml" option should be ON by default. > It's annoying to have to separately enable it for each and every table being > used, when I think the need to turn it selectively OFF should be fairly > rare. Yes, I agreed.

Re: Single transaction in the tablesync worker?

2021-01-31 Thread Amit Kapila
On Mon, Feb 1, 2021 at 9:38 AM Peter Smith wrote: > > On Mon, Feb 1, 2021 at 1:54 PM Amit Kapila wrote: > > > > On Mon, Feb 1, 2021 at 6:48 AM Peter Smith wrote: > > > > > > On Sun, Jan 31, 2021 at 12:19 AM Amit Kapila > > > wrote: > > > > > > > > I have made the below changes in the patch.

Re: Single transaction in the tablesync worker?

2021-01-31 Thread Peter Smith
On Mon, Feb 1, 2021 at 1:54 PM Amit Kapila wrote: > > On Mon, Feb 1, 2021 at 6:48 AM Peter Smith wrote: > > > > On Sun, Jan 31, 2021 at 12:19 AM Amit Kapila > > wrote: > > > > > > I have made the below changes in the patch. Let me know what you think > > > about these? > > > 1. It was a bit

Re: avoid bitmapOR-ing indexes with scan condition inconsistent with partition constraint

2021-01-31 Thread Masahiko Sawada
Hi, On Fri, Nov 13, 2020 at 5:14 AM Tom Lane wrote: > > I started looking through this patch. I really quite dislike solving > this via a kluge in indxpath.c. There are multiple disadvantages > to that: > > * It only helps for the very specific problem of redundant bitmap > index scans,

Re: Asynchronous Append on postgres_fdw nodes.

2021-01-31 Thread Etsuro Fujita
On Tue, Nov 17, 2020 at 6:56 PM Etsuro Fujita wrote: > * I haven't yet done anything about the issue on postgres_fdw's > handling of concurrent data fetches by multiple ForeignScan nodes > (below *different* Append nodes in the query) using the same > connection discussed in [2]. I modified the

Re: Single transaction in the tablesync worker?

2021-01-31 Thread Amit Kapila
On Mon, Feb 1, 2021 at 6:48 AM Peter Smith wrote: > > On Sun, Jan 31, 2021 at 12:19 AM Amit Kapila wrote: > > > > I have made the below changes in the patch. Let me know what you think > > about these? > > 1. It was a bit difficult to understand the code in DropSubscription > > so I have

Re: [sqlsmith] Failed assertion during partition pruning

2021-01-31 Thread Amit Langote
On Mon, Feb 1, 2021 at 8:50 AM David Rowley wrote: > On Sun, 31 Jan 2021 at 11:42, Tom Lane wrote: > > This fixes the cases reported by Andreas and Jaime, leaving me > > more confident that there's nothing wrong with David's Assert. > > It could be fixed by modifying

Re: Fix typo about generate_gather_paths

2021-01-31 Thread Masahiko Sawada
Hi, On Wed, Dec 23, 2020 at 3:24 AM Tomas Vondra wrote: > > On 12/9/20 3:21 AM, Hou, Zhijie wrote: > > Hi > > > > Since ba3e76c, > > the optimizer call generate_useful_gather_paths instead of > > generate_gather_paths() outside. > > > > But I noticed that some comment still talking about

Re: Is it worth accepting multiple CRLs?

2021-01-31 Thread Kyotaro Horiguchi
At Sat, 30 Jan 2021 22:20:19 +0100, Peter Eisentraut wrote in > On 2021-01-19 09:32, Kyotaro Horiguchi wrote: > > At Tue, 19 Jan 2021 09:17:34 +0900 (JST), Kyotaro Horiguchi > > wrote in > >> By the way we can do the same thing on CA file/dir, but I personally > >> think that the benefit from

Re: Determine parallel-safety of partition relations for Inserts

2021-01-31 Thread Greg Nancarrow
On Fri, Jan 29, 2021 at 5:44 PM Hou, Zhijie wrote: > > > Attatching v1 patches, introducing options which let user manually control > whether to use parallel dml. > > About the patch: > 1. add a new guc option: enable_parallel_dml (boolean) > 2. add a new tableoption: parallel_dml (boolean) > >

Re: [BUG] orphaned function

2021-01-31 Thread Masahiko Sawada
Hi Bertrand, On Fri, Dec 18, 2020 at 6:52 PM Gilles Darold wrote: > > Le 18/12/2020 à 00:26, Tom Lane a écrit : > > Gilles Darold writes: > >> The same problem applies if the returned type or the procedural language > >> is dropped. I have tried to fix that in ProcedureCreate() by using an > >>

Re: Key management with tests

2021-01-31 Thread Moon, Insung
Dear All. Thank you for all opinions and discussions regarding the KMS/TDE function. First of all, to get to the point of this email, I want to participate in anything I can do (review or development) when TDE related development is in progress. If there is a meeting related to it, I can't

Re: Single transaction in the tablesync worker?

2021-01-31 Thread Peter Smith
On Sun, Jan 31, 2021 at 12:19 AM Amit Kapila wrote: > 2. In AlterSubscription_refresh(), we can't allow workers to be > stopped at commit time as we have already dropped the slots because > the worker can access the dropped slot. We need to stop the workers > before dropping slots. This makes

Re: Single transaction in the tablesync worker?

2021-01-31 Thread Peter Smith
On Sun, Jan 31, 2021 at 12:19 AM Amit Kapila wrote: > > I have made the below changes in the patch. Let me know what you think > about these? > 1. It was a bit difficult to understand the code in DropSubscription > so I have rearranged the code to match the way we are doing in HEAD > where we

Re: Printing backtrace of postgres processes

2021-01-31 Thread Bharath Rupireddy
On Fri, Jan 29, 2021 at 7:10 PM vignesh C wrote: > > 4) How about following > > + errmsg("must be a superuser to print backtrace > > of backend process"))); > > instead of > > + errmsg("must be a superuser to print backtrace > > of superuser query

Re: row filtering for logical replication

2021-01-31 Thread Euler Taveira
On Mon, Mar 16, 2020, at 10:58 AM, David Steele wrote: > Please submit to a future CF when a new patch is available. Hi, This is another version of the row filter patch. Patch summary: 0001: refactor to remove dead code 0002: grammar refactor for row filter 0003: core code, documentation, and

Re: [sqlsmith] Failed assertion during partition pruning

2021-01-31 Thread David Rowley
On Sun, 31 Jan 2021 at 11:42, Tom Lane wrote: > This fixes the cases reported by Andreas and Jaime, leaving me > more confident that there's nothing wrong with David's Assert. I agree that there is nothing wrong with the Assert. The commit message of a929e17e5 mentions: > Here we tighten that

Re: [HACKERS] [PATCH] Generic type subscripting

2021-01-31 Thread Tom Lane
Alexander Korotkov writes: > Pushed with minor cleanup. thorntail seems unhappy: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=thorntail=2021-01-31%2020%3A58%3A12 ==-=-== stack trace: pgsql.build/src/test/regress/tmp_check/data/core ==-=-== [New LWP 2266507] [Thread

Re: Why does creating logical replication subscriptions require superuser?

2021-01-31 Thread Noah Misch
On Fri, Jan 22, 2021 at 02:08:02PM -0800, Paul Martinez wrote: > Some of the original justifications for requiring superuser to create > subscriptions include: > - Replication inherently adds significant network traffic and extra background > process, and we wouldn't want unprivileged users to

Re: Thoughts on "killed tuples" index hint bits support on standby

2021-01-31 Thread Peter Geoghegan
On Sat, Jan 30, 2021 at 5:39 PM Peter Geoghegan wrote: > If you invent some entirely new category of standby-only hint bit at a > level below the access method code, then you can use it inside access > method code such as nbtree. Maybe you don't have to play games with > minRecoveryPoint in code

Re: [HACKERS] [PATCH] Generic type subscripting

2021-01-31 Thread Alexander Korotkov
On Fri, Jan 29, 2021 at 7:01 PM Alexander Korotkov wrote: > On Thu, Jan 21, 2021 at 11:14 PM Pavel Stehule > wrote: > >> Looks good, I've applied it, thanks. > > > > I tested last set of patches > > > > 1. There is no problem with patching and compilation > > 2. make check-world passed > > 3.

Re: Added schema level support for publication.

2021-01-31 Thread vignesh C
On Fri, Jan 22, 2021 at 10:01 AM vignesh C wrote: > > Thanks Rahila for your comments. Please find my thoughts below: > > On Wed, Jan 20, 2021 at 6:27 PM Rahila Syed wrote: > > > > Hi Vignesh, > > > >> > >> I have handled the above scenario(drop schema should automatically > >> remove the schema

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

2021-01-31 Thread Tom Lane
Greg Stark writes: > I wonder if there isn't room to handle this the other way around. To > configure Postgres to not need a CREATE ROLE for every role but > delegate the user management to the external authentication service. > So Postgres would consider the actual role to be the one kerberos

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

2021-01-31 Thread Tom Lane
Magnus Hagander writes: > On Sat, Jan 30, 2021 at 12:40 AM Tom Lane wrote: >> I remain concerned about the cost and inconvenience of exposing >> it via log_line_prefix, but at least that shouldn't be visible >> to anyone who's not entitled to know who's logged in ... > What if we logged it as

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

2021-01-31 Thread Greg Stark
On Fri, 29 Jan 2021 at 18:41, Tom Lane wrote: > > Ah. So basically, this comes into play when you consider that some > outside-the-database entity is your "real" authenticated identity. > That seems reasonable when using Kerberos or the like, though it's > not real meaningful for traditional

[PATCH] Doc: improve documentation of oid columns that can be zero. (correct version)

2021-01-31 Thread Joel Jacobson
Please ignore previous email, the attached file was 0 bytes. Here comes the patch again, now including data. -- Doc: improve documentation of oid columns that can be zero. pg_attribute.atttypid Zero if column is dropped. pg_class.relam Can be zero, e.g. for views. pg_depend.classid Zero for

[PATCH] Doc: improve documentation of oid columns that can be zero.

2021-01-31 Thread Joel Jacobson
Doc: improve documentation of oid columns that can be zero. pg_attribute.atttypid Zero if column is dropped. pg_class.relam Can be zero, e.g. for views. pg_depend.classid Zero for pinned objects. pg_language.lanplcallfoid Zero for internal languages. pg_operator.oprcode Zero if none.

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

2021-01-31 Thread Magnus Hagander
On Sat, Jan 30, 2021 at 12:21 AM Jacob Champion wrote: > > On Fri, 2021-01-29 at 17:01 -0500, Stephen Frost wrote: > > > - for LDAP, the bind DN is discarded entirely; > > > > We don't support pg_ident.conf-style entries for LDAP, meaning that the > > user provided has to match what we check, so

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

2021-01-31 Thread Magnus Hagander
On Sat, Jan 30, 2021 at 12:40 AM Tom Lane wrote: > > Jacob Champion writes: > > On Fri, 2021-01-29 at 17:30 -0500, Tom Lane wrote: > >> What happens if ALTER USER RENAME is done while the session is still > >> alive? > > > IMO the authenticated identity should be write-once. Especially since > >