[PATCH] Document the fact that pg_proc.protrftypes references pg_type.oid

2021-01-24 Thread Joel Jacobson
Hi, This patch fixes $SUBJECT. /Joel pg-proc-protrftypes-references-pg-type-oid.patch Description: Binary data

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

2021-01-24 Thread Greg Nancarrow
On Mon, Jan 25, 2021 at 4:37 PM tsunakawa.ta...@fujitsu.com wrote: > > > > > (4) > > You could, but I'm not sure it would make the code easier to read, > > especially for those who don't know !isParallelWorker() means it's a > > parallel leader. > ... > > I really can't see a problem. PrepareParal

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

2021-01-24 Thread Masahiro Ikeda
Hi, thanks for the reviews. I updated the attached patch. The summary of the changes is following. 1. fix document I followed another view's comments. 2. refactor issue_xlog_fsync() I removed "sync_called" variables, narrowed the "duration" scope and change the switch statement to if stateme

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

2021-01-24 Thread Fujii Masao
On 2021/01/23 13:40, Bharath Rupireddy wrote: On Fri, Jan 22, 2021 at 6:43 PM Fujii Masao wrote: Please review the v16 patch set further. Thanks! Will review that later. + /* +* For the given server, if we closed connection or it is still in

Re: The mysterious pg_proc.protrftypes

2021-01-24 Thread Joel Jacobson
On Mon, Jan 25, 2021, at 08:14, Pavel Stehule wrote: >you should to use TRANSFORM clause in CREATE FUNCTION statement Thanks, it worked, and like expected it references the pg_type.oid of the transform. Attached patch adds "(references pg_type.oid)" to the documentation for pg_proc.protrftypes.

Re: Identify missing publications from publisher while create/alter subscription.

2021-01-24 Thread vignesh C
On Thu, Jan 21, 2021 at 10:21 PM Bharath Rupireddy wrote: > > On Thu, Jan 21, 2021 at 6:56 PM vignesh C wrote: > > > > Hi, > > > > Creating/altering subscription is successful when we specify a > > publication which does not exist in the publisher. I felt we should > > throw an error in this case

Re: The mysterious pg_proc.protrftypes

2021-01-24 Thread Pavel Stehule
po 25. 1. 2021 v 8:05 odesílatel Joel Jacobson napsal: > Hi, > > I'm trying to understand how pg_proc.protrftypes works. > > The documentation says "Data type OIDs for which to apply transforms.". > For this column, there is no reference to any catalog table? > I would guess it should be "(refere

RE: libpq debug log

2021-01-24 Thread tsunakawa.ta...@fujitsu.com
First, some possibly major questions: (23) From: 'Alvaro Herrera' > Maybe we can create a new file specifically for this to avoid mixing > unrelated stuff in fe-misc.c -- say fe-trace.c where all this new > tracing stuff goes. What do you think about this suggestion? I think this is reasonable

Re: Heap's backwards scan scans the incorrect pages with heap_setscanlimits()

2021-01-24 Thread David Rowley
On Thu, 21 Jan 2021 at 13:16, David Rowley wrote: > Proposed patch attached. I ended up pushing a slightly revised version of this which kept the code the same as before when rs_numblocks had not been changed. I backpatched to 9.5 as it seemed low risk and worthy of stopping some head-scratching

The mysterious pg_proc.protrftypes

2021-01-24 Thread Joel Jacobson
Hi, I'm trying to understand how pg_proc.protrftypes works. The documentation says "Data type OIDs for which to apply transforms.". For this column, there is no reference to any catalog table? I would guess it should be "(references pg_type.oid)", right? I tried to generate a value for this colu

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

2021-01-24 Thread Greg Nancarrow
On Mon, Jan 25, 2021 at 2:22 PM Hou, Zhijie wrote: > Hi, > > After doing some test to cover the code path in the PATCH 0001. > I have some suggestions for the 0002 testcase. > > > (1) > + /* Check parallel-safety of any expressions in the > partition key */ > +

Re: Release SPI plans for referential integrity with DISCARD ALL

2021-01-24 Thread yuzuko
Hello, Thank you for your comments. Following Corey's advice, I applied Amit's patches proposed in this email [1], and confirmed our memory pressure problem was solved. So dropping cached plan with DISCARD is not necessary anymore. [1] https://www.postgresql.org/message-id/CA%2BHiwqG1qQuBwApueaU

Re: Single transaction in the tablesync worker?

2021-01-24 Thread Amit Kapila
On Mon, Jan 25, 2021 at 8:03 AM Peter Smith wrote: > > Hi Amit. > > PSA the v19 patch for the Tablesync Solution1. > I see one race condition in this patch where we try to drop the origin via apply process and DropSubscription. I think it can lead to the error "cache lookup failed for replication

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

2021-01-24 Thread tsunakawa.ta...@fujitsu.com
From: Greg Nancarrow > > (1) > Yes, you're right the wording is not right (and I don't really like > the wording used before the patch). > > Perhaps it could say: > > (Note that we do allow CREATE TABLE AS, INSERT INTO...SELECT, SELECT > INTO, and CREATE MATERIALIZED VIEW to use parallel plans.

Re: ModifyTable overheads in generic plans

2021-01-24 Thread Amit Langote
On Tue, Dec 22, 2020 at 5:16 PM Amit Langote wrote: > On Mon, Dec 7, 2020 at 3:53 PM Amit Langote wrote: > > On Thu, Nov 12, 2020 at 5:04 PM Amit Langote > > wrote: > > > Attached new 0002 which does these adjustments. I went with > > > ri_RootTargetDesc to go along with ri_RelationDesc. > > >

Re: Is Recovery actually paused?

2021-01-24 Thread Kyotaro Horiguchi
At Mon, 25 Jan 2021 10:05:19 +0530, Dilip Kumar wrote in > On Mon, Jan 25, 2021 at 8:42 AM Kyotaro Horiguchi > wrote: > > > > At Sun, 24 Jan 2021 14:26:08 +0530, Dilip Kumar > > wrote in > > > On Sun, Jan 24, 2021 at 12:16 PM Bharath Rupireddy > > > wrote: > > > > > > > > On Sun, Jan 24, 202

Re: Is it useful to record whether plans are generic or custom?

2021-01-24 Thread Kyotaro Horiguchi
At Tue, 12 Jan 2021 20:36:58 +0900, torikoshia wrote in > I suppose it would be normal practice to store past results of > pg_stat_statements for future comparisons. > If this is the case, I think that if we only add the number of > generic plan execution, it will give us a hint to notice the ca

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

2021-01-24 Thread Masahiko Sawada
On Mon, Jan 25, 2021 at 1:28 PM Masahiro Ikeda wrote: > > On 2021-01-25 13:15, Masahiro Ikeda wrote: > > On 2021-01-25 10:36, Masahiko Sawada wrote: > >> On Fri, Jan 22, 2021 at 10:05 PM Masahiro Ikeda > >> wrote: > >>> > >>> On 2021-01-22 14:50, Masahiko Sawada wrote: > >>> > On Fri, Dec 25, 202

Re: Is Recovery actually paused?

2021-01-24 Thread Dilip Kumar
On Mon, Jan 25, 2021 at 8:42 AM Kyotaro Horiguchi wrote: > > At Sun, 24 Jan 2021 14:26:08 +0530, Dilip Kumar wrote > in > > On Sun, Jan 24, 2021 at 12:16 PM Bharath Rupireddy > > wrote: > > > > > > On Sun, Jan 24, 2021 at 7:17 AM Dilip Kumar wrote: > > > > On Sat, 23 Jan 2021 at 4:40 PM, Bhara

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

2021-01-24 Thread Masahiro Ikeda
On 2021-01-25 13:15, Masahiro Ikeda wrote: On 2021-01-25 10:36, Masahiko Sawada wrote: On Fri, Jan 22, 2021 at 10:05 PM Masahiro Ikeda wrote: On 2021-01-22 14:50, Masahiko Sawada wrote: > On Fri, Dec 25, 2020 at 6:46 PM Masahiro Ikeda > wrote: >> >> Hi, >> >> I rebased the patch to the maste

Re: Is Recovery actually paused?

2021-01-24 Thread Dilip Kumar
On Mon, Jan 25, 2021 at 6:12 AM Masahiko Sawada wrote: > > On Sun, Jan 17, 2021 at 5:19 PM Dilip Kumar wrote: > > > > On Sat, Jan 16, 2021 at 8:59 AM Masahiko Sawada > > wrote: > > > > > > On Wed, Jan 13, 2021 at 9:20 PM Dilip Kumar wrote: > > > > > > > > On Wed, Jan 13, 2021 at 3:35 PM Dilip

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

2021-01-24 Thread Masahiro Ikeda
On 2021-01-25 11:47, japin wrote: On Mon, 25 Jan 2021 at 09:36, Masahiko Sawada wrote: On Fri, Jan 22, 2021 at 10:05 PM Masahiro Ikeda wrote: On 2021-01-22 14:50, Masahiko Sawada wrote: > On Fri, Dec 25, 2020 at 6:46 PM Masahiro Ikeda > wrote: >> >> Hi, >> >> I rebased the patch to the mast

RE: POC: postgres_fdw insert batching

2021-01-24 Thread tsunakawa.ta...@fujitsu.com
From: Amit Langote > Yes, it can be simplified by using a local join to prevent the update of the > foreign > partition from being pushed to the remote server, for which my example in the > previous email used a local trigger. Note that the update of the foreign > partition to be done locally is

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

2021-01-24 Thread Masahiro Ikeda
On 2021-01-25 10:36, Masahiko Sawada wrote: On Fri, Jan 22, 2021 at 10:05 PM Masahiro Ikeda wrote: On 2021-01-22 14:50, Masahiko Sawada wrote: > On Fri, Dec 25, 2020 at 6:46 PM Masahiro Ikeda > wrote: >> >> Hi, >> >> I rebased the patch to the master branch. > > Thank you for working on this.

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

2021-01-24 Thread kuroda.hay...@fujitsu.com
Dear Ikeda-san, > I checked columns' descriptions of other views. > There are "Number of xxx", "Total number of xxx", "Total amount of time > that xxx" and "Total time spent xxx". Right. > Since the "time" is used for showing spending time, not count, > I'll change it to "Total number of WAL da

Re: PG vs LLVM 12 on seawasp, next round

2021-01-24 Thread Tom Lane
Noah Misch writes: > On Mon, Jan 18, 2021 at 09:29:53PM +0100, Fabien COELHO wrote: >> ... Last two months were a >> little overworked for me so I let slip quite a few things. If you want to >> disable the animal as Tom suggests, do as you want. > Perhaps he was suggesting that you (buildfarm own

Re: Single transaction in the tablesync worker?

2021-01-24 Thread Amit Kapila
On Mon, Jan 25, 2021 at 8:23 AM Peter Smith wrote: > > On Sat, Jan 23, 2021 at 11:26 PM Amit Kapila wrote: > > > > 2. > > @@ -98,11 +102,16 @@ > > #include "miscadmin.h" > > #include "parser/parse_relation.h" > > #include "pgstat.h" > > +#include "postmaster/interrupt.h" > > #include "replica

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

2021-01-24 Thread Masahiro Ikeda
On 2021-01-25 10:34, kuroda.hay...@fujitsu.com wrote: Dear Ikeda-san, Thank you for updating the patch. This can be applied to master, and can be used on my RHEL7. wal_write_time and wal_sync_time increase normally :-). ``` postgres=# select * from pg_stat_wal; -[ RECORD 1 ]+---

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

2021-01-24 Thread Greg Nancarrow
On Mon, Jan 25, 2021 at 10:23 AM tsunakawa.ta...@fujitsu.com < tsunakawa.ta...@fujitsu.com> wrote: > > Hello Greg-san, > > > Second group of comments (I'll reply to (1) - (4) later): > > > (5) > @@ -790,7 +790,8 @@ ExecCheckXactReadOnly(PlannedStmt *plannedstmt) > ... > - if (plannedstmt->com

Re: PG vs LLVM 12 on seawasp, next round

2021-01-24 Thread Noah Misch
On Mon, Jan 18, 2021 at 09:29:53PM +0100, Fabien COELHO wrote: > >>>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 ha

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

2021-01-24 Thread Hou, Zhijie
Hi, After doing some test to cover the code path in the PATCH 0001. I have some suggestions for the 0002 testcase. (1) + /* Check parallel-safety of any expressions in the partition key */ + if (get_partition_col_attnum(pkey, i) == 0) +

Re: Logical Replication - behavior of ALTER PUBLICATION .. DROP TABLE and ALTER SUBSCRIPTION .. REFRESH PUBLICATION

2021-01-24 Thread Amit Kapila
On Sat, Jan 23, 2021 at 1:44 PM Bharath Rupireddy wrote: > > On Sat, Jan 23, 2021 at 11:50 AM Amit Kapila wrote: > > > > On Fri, Jan 22, 2021 at 2:59 PM Bharath Rupireddy > > wrote: > > > > > > On Fri, Jan 22, 2021 at 2:00 PM Amit Kapila > > > wrote: > > > > > > Yes you are right. Looks like t

Re: Single transaction in the tablesync worker?

2021-01-24 Thread Amit Kapila
On Sat, Jan 23, 2021 at 11:08 AM Ajin Cherian wrote: > > On Sat, Jan 23, 2021 at 3:16 PM Amit Kapila wrote: > > > > > I think so. But do you have any reason to believe that it won't be > > required anymore? > > A temporary slot will not clash with a permanent slot of the same name, > I have trie

Re: Is Recovery actually paused?

2021-01-24 Thread Kyotaro Horiguchi
At Sun, 24 Jan 2021 14:26:08 +0530, Dilip Kumar wrote in > On Sun, Jan 24, 2021 at 12:16 PM Bharath Rupireddy > wrote: > > > > On Sun, Jan 24, 2021 at 7:17 AM Dilip Kumar wrote: > > > On Sat, 23 Jan 2021 at 4:40 PM, Bharath Rupireddy > > > wrote: > > >> > > >> On Sat, Jan 23, 2021 at 1:36 PM

RE: Parallel Inserts in CREATE TABLE AS

2021-01-24 Thread Tang, Haiying
>Thanks a lot for the tests. In your test case, parallel insertions are not >being picked because the Gather node has > some projections(floor(((random() * '1'::double precision) + >'1'::double > precision)) to perform. That's expected. >Whenever parallel insertions are chosen for CTAS, we sh

Re: Single transaction in the tablesync worker?

2021-01-24 Thread Amit Kapila
On Sun, Jan 24, 2021 at 12:24 PM Peter Smith wrote: > > On Sat, Jan 23, 2021 at 11:26 PM Amit Kapila wrote: > > > > > > Few comments: > > = > > 1. > > - * So the state progression is always: INIT -> DATASYNC -> SYNCWAIT -> > > - * CATCHUP -> SYNCDONE -> READY. > > + * So the sta

Re: [PoC] Non-volatile WAL buffer

2021-01-24 Thread Masahiko Sawada
On Fri, Jan 22, 2021 at 11:32 AM Tomas Vondra wrote: > > > > On 1/21/21 3:17 AM, Masahiko Sawada wrote: > > On Thu, Jan 7, 2021 at 2:16 AM Tomas Vondra > > wrote: > >> > >> Hi, > >> > >> I think I've managed to get the 0002 patch [1] rebased to master and > >> working (with help from Masahiko Saw

Re: Single transaction in the tablesync worker?

2021-01-24 Thread Peter Smith
On Sat, Jan 23, 2021 at 11:26 PM Amit Kapila wrote: > > 2. > @@ -98,11 +102,16 @@ > #include "miscadmin.h" > #include "parser/parse_relation.h" > #include "pgstat.h" > +#include "postmaster/interrupt.h" > #include "replication/logicallauncher.h" > #include "replication/logicalrelation.h" > +#

Re: Single transaction in the tablesync worker?

2021-01-24 Thread Amit Kapila
On Mon, Jan 25, 2021 at 6:15 AM Peter Smith wrote: > > On Sun, Jan 24, 2021 at 5:54 PM Peter Smith wrote: > > > 4. > > > - /* > > > - * To build a slot name for the sync work, we are limited to NAMEDATALEN > > > - > > > - * 1 characters. We cut the original slot name to NAMEDATALEN - 28 chars >

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

2021-01-24 Thread japin
On Mon, 25 Jan 2021 at 09:36, Masahiko Sawada wrote: > On Fri, Jan 22, 2021 at 10:05 PM Masahiro Ikeda > wrote: >> >> On 2021-01-22 14:50, Masahiko Sawada wrote: >> > On Fri, Dec 25, 2020 at 6:46 PM Masahiro Ikeda >> > wrote: >> >> >> >> Hi, >> >> >> >> I rebased the patch to the master branch

Re: Single transaction in the tablesync worker?

2021-01-24 Thread Peter Smith
Hi Amit. PSA the v19 patch for the Tablesync Solution1. Main differences from v18: + Patch has been rebased off HEAD @ 24/Jan + Addressing some review comments [ak0123] [ak0123] https://www.postgresql.org/message-id/CAA4eK1JhpuwujrV6ABMmZ3jXfW37ssZnJ3fikrY7rRdvoEmu_g%40mail.gmail.com Fea

Re: Extend more usecase for planning time partition pruning and init partition pruning.

2021-01-24 Thread Andy Fan
On Sun, Jan 24, 2021 at 6:34 PM Andy Fan wrote: > Hi: > > I recently found a use case like this. SELECT * FROM p, q WHERE > p.partkey = > q.colx AND (q.colx = $1 OR q.colx = $2); Then we can't do either planning > time > partition prune or init partition prune. Even though we have run-time >

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

2021-01-24 Thread Masahiko Sawada
On Fri, Jan 22, 2021 at 10:05 PM Masahiro Ikeda wrote: > > On 2021-01-22 14:50, Masahiko Sawada wrote: > > On Fri, Dec 25, 2020 at 6:46 PM Masahiro Ikeda > > wrote: > >> > >> Hi, > >> > >> I rebased the patch to the master branch. > > > > Thank you for working on this. I've read the latest patch.

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

2021-01-24 Thread kuroda.hay...@fujitsu.com
Dear Ikeda-san, Thank you for updating the patch. This can be applied to master, and can be used on my RHEL7. wal_write_time and wal_sync_time increase normally :-). ``` postgres=# select * from pg_stat_wal; -[ RECORD 1 ]+-- wal_records | 121781 wal_fpi

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-01-24 Thread Alvaro Herrera
On 2021-Jan-24, Mark Rofail wrote: > I do not think that postgres contains vector operators, correct me if I am > wrong. I feel that supporting vectors is our of the scope of this patch, if > you have an idea how to support it please let me know. I do not think that this patch needs to support oi

Re: Single transaction in the tablesync worker?

2021-01-24 Thread Peter Smith
On Sun, Jan 24, 2021 at 5:54 PM Peter Smith wrote: > > 4. > > - /* > > - * To build a slot name for the sync work, we are limited to NAMEDATALEN - > > - * 1 characters. We cut the original slot name to NAMEDATALEN - 28 chars > > - * and append _%u_sync_%u (1 + 10 + 6 + 10 + '\0'). (It's actually

Re: Is Recovery actually paused?

2021-01-24 Thread Masahiko Sawada
On Sun, Jan 17, 2021 at 5:19 PM Dilip Kumar wrote: > > On Sat, Jan 16, 2021 at 8:59 AM Masahiko Sawada wrote: > > > > On Wed, Jan 13, 2021 at 9:20 PM Dilip Kumar wrote: > > > > > > On Wed, Jan 13, 2021 at 3:35 PM Dilip Kumar wrote: > > > > > > > > On Wed, Jan 13, 2021 at 3:27 PM Yugo NAGATA wr

Re: simplifying foreign key/RI checks

2021-01-24 Thread Corey Huinker
On Sun, Jan 24, 2021 at 6:51 AM Amit Langote wrote: > On Sun, Jan 24, 2021 at 11:26 AM Corey Huinker > wrote: > > On Sat, Jan 23, 2021 at 12:52 PM Zhihong Yu wrote: > >> > >> Hi, > > Thanks for the review. > > >> + for (i = 0; i < riinfo->nkeys; i++) > >> + { > >> + Oid

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

2021-01-24 Thread Masahiro Ikeda
Hi, Japin Thanks for your comments. On 2021-01-23 01:46, japin wrote: Hi, Masahiro Thanks for you update the v4 patch. Here are some comments: (1) + char*msg = NULL; + boolsync_called;/* whether to sync data to the disk. */ + instr_time

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

2021-01-24 Thread tsunakawa.ta...@fujitsu.com
Hello Greg-san, Second group of comments (I'll reply to (1) - (4) later): (5) @@ -790,7 +790,8 @@ ExecCheckXactReadOnly(PlannedStmt *plannedstmt) ... - if (plannedstmt->commandType != CMD_SELECT || plannedstmt->hasModifyingCTE) + if ((plannedstmt->commandType != CMD_SELECT && +

Re: Stronger safeguard for archive recovery not to miss data

2021-01-24 Thread Laurenz Albe
On Thu, 2021-01-21 at 15:30 +0100, I wrote: > On Thu, 2021-01-21 at 13:09 +, osumi.takami...@fujitsu.com wrote: > > > > My vote is that we should not have a GUC for such an unlikely event, and > > > that > > > stopping recovery is good enough. > > OK. IIUC, my current patch for this fix doesn

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-01-24 Thread Mark Rofail
Hello Joel, UPDATE catalog_clone.pg_index SET indkey = '1 2 12345'::int2vector WHERE > indexrelid = 2837; > ERROR: operator does not exist: int2vector pg_catalog.@> smallint[] > LINE 1: ...WHERE "attrelid" OPERATOR(pg_catalog.=) $1 AND $2 OPERATOR(p... > In your example, you are using the notati

Re: Faulty HEAP_XMAX_LOCK_ONLY & HEAP_KEYS_UPDATED hintbit combination

2021-01-24 Thread Julien Rouhaud
On Mon, Jan 25, 2021 at 12:06 AM Mahendra Singh Thalor wrote: > > On Sun, 24 Jan 2021 at 11:48, Julien Rouhaud wrote: > > > > Hi, > > > > I'm not really familiar with this part of the code, so it's not exactly > > clear > > to me if some logic is missing in compute_new_xmax_infomask() / > > heap

Re: Faulty HEAP_XMAX_LOCK_ONLY & HEAP_KEYS_UPDATED hintbit combination

2021-01-24 Thread Julien Rouhaud
On Mon, Jan 25, 2021 at 12:01 AM 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 > > + * contr

Re: Faulty HEAP_XMAX_LOCK_ONLY & HEAP_KEYS_UPDATED hintbit combination

2021-01-24 Thread Mahendra Singh Thalor
On Sun, 24 Jan 2021 at 11:48, Julien Rouhaud wrote: > > Hi, > > While working on pg14 compatibility for an extension relying on an apparently > uncommon combination of FOR UPDATE and stored function calls, I hit some new > Asserts introduced in 866e24d47db (Extend amcheck to check heap pages): > >

Re: Faulty HEAP_XMAX_LOCK_ONLY & HEAP_KEYS_UPDATED hintbit combination

2021-01-24 Thread Alvaro Herrera
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 > + * contrib/amcheck logic, so if you disable one or both of these > + * ass

Re: mkid reference

2021-01-24 Thread Magnus Hagander
On Fri, Jan 22, 2021 at 7:07 PM Tom Lane wrote: > > Daniel Gustafsson writes: > >> On 22 Jan 2021, at 12:56, Magnus Hagander wrote: > >> And maybe even more interestnig -- is there a point to this whole > >> make_diff directory at all in these days of git? Or should we just > >> remove it rather

Re: POC: postgres_fdw insert batching

2021-01-24 Thread Amit Langote
On Sun, Jan 24, 2021 at 2:17 AM Tomas Vondra wrote: > On 1/23/21 9:31 AM, Amit Langote wrote: > > I was looking at this and it looks like we've got a problematic case > > where postgresGetForeignModifyBatchSize() is called from > > ExecInitRoutingInfo(). > > > > That case is when the insert is per

Re: simplifying foreign key/RI checks

2021-01-24 Thread Amit Langote
On Sun, Jan 24, 2021 at 11:26 AM Corey Huinker wrote: > On Sat, Jan 23, 2021 at 12:52 PM Zhihong Yu wrote: >> >> Hi, Thanks for the review. >> + for (i = 0; i < riinfo->nkeys; i++) >> + { >> + Oid eq_opr = eq_oprs[i]; >> + Oid typeid = RIAttType(fk_rel, r

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-01-24 Thread Joel Jacobson
Hi again, I found a similar problem with int2vector columns: CREATE TABLE catalog_clone.pg_index AS SELECT * FROM pg_catalog.pg_index; CREATE TABLE catalog_clone.pg_attribute AS SELECT attrelid,attnum FROM pg_catalog.pg_attribute; ALTER TABLE catalog_clone.pg_attribute ADD UNIQUE (attrelid, attn

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-01-24 Thread Mark Rofail
Hello Joel, On Sun, Jan 24, 2021 at 12:11 PM Joel Jacobson wrote: > HINT: No operator matches the given name and argument types. You might > need to add explicit type casts. > QUERY: SELECT 1 WHERE (SELECT pg_catalog.count(DISTINCT y) FROM > pg_catalog.unnest($1) y) OPERATOR(pg_catalog.=) (SEL

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-01-24 Thread Joel Jacobson
On Sun, Jan 24, 2021, at 11:21, Mark Rofail wrote: >This seems to be a type casting problem indeed. The coercion part of the patch >found in "ruleutils.c:11438-11491" is the culprit, is there a cleaner way to >achieve this? >I am aware of the problem and will try to fix it, but I assume this is b

Extend more usecase for planning time partition pruning and init partition pruning.

2021-01-24 Thread Andy Fan
Hi: I recently found a use case like this. SELECT * FROM p, q WHERE p.partkey = q.colx AND (q.colx = $1 OR q.colx = $2); Then we can't do either planning time partition prune or init partition prune. Even though we have run-time partition pruning work at last, it is too late in some cases si

Re: [PATCH] Keeps tracking the uniqueness with UniqueKey

2021-01-24 Thread Andy Fan
Hi Masahiko: On Fri, Jan 22, 2021 at 9:15 PM Masahiko Sawada wrote: > Hi Andy, > > On Mon, Dec 7, 2020 at 9:15 PM Andy Fan wrote: > > > > > > > > On Mon, Dec 7, 2020 at 4:16 PM Jesper Pedersen < > jesper.peder...@redhat.com> wrote: > >> > >> Hi, > >> > >> On 12/5/20 10:38 PM, Andy Fan wrote: >

Re: [HACKERS] GSoC 2017: Foreign Key Arrays

2021-01-24 Thread Joel Jacobson
Hi Mark and others, On Sun, Jan 24, 2021, at 09:22, Mark Rofail wrote: > Changelog: > - v13 (compatible with current master 2021-01-24, commit > 7e57255f6189380d545e1df6a6b38827b213e3da) ... > I encourage everyone to take review this patch. After considerable reviews > and performance testing, i

Re: Is Recovery actually paused?

2021-01-24 Thread Dilip Kumar
On Sun, Jan 24, 2021 at 12:16 PM Bharath Rupireddy wrote: > > On Sun, Jan 24, 2021 at 7:17 AM Dilip Kumar wrote: > > On Sat, 23 Jan 2021 at 4:40 PM, Bharath Rupireddy > > wrote: > >> > >> On Sat, Jan 23, 2021 at 1:36 PM Dilip Kumar wrote: > >> > Please find the patch for the same. I haven't a

Re: pg_upgrade fails with non-standard ACL

2021-01-24 Thread Noah Misch
On Thu, Jan 21, 2021 at 01:03:58AM +0300, Anastasia Lubennikova wrote: > On 03.01.2021 14:29, Noah Misch wrote: > >Overall, this patch predicts a subset of cases where pg_dump will emit a > >failing GRANT or REVOKE that targets a pg_catalog object. Can you write a > >code comment stating what it d