Re: First draft of the PG 15 release notes

2022-05-24 Thread Amit Langote
On Wed, May 25, 2022 at 12:44 PM David Rowley wrote: > On Wed, 25 May 2022 at 15:01, Amit Langote wrote: > > +Previously, a partitioned table with DEFAULT partition or a LIST > > partition containing multiple values could not be used for ordered > > partition scans. Now it

Re: First draft of the PG 15 release notes

2022-05-24 Thread Amit Langote
On Wed, May 25, 2022 at 8:36 AM Bruce Momjian wrote: > On Thu, May 19, 2022 at 06:13:28PM +0900, Amit Langote wrote: > > Or maybe we could mention that but use a wording that doesn't make it > > sound like an implementation detail, like: > > > > +Previously, an o

enable/disable broken for statement triggers on partitioned tables

2022-05-24 Thread Amit Langote
he attached. A lot of boilerplate is needed given that the various enable/disable trigger variants are represented as separate sub-commands (AlterTableCmd subtypes), which can perhaps be avoided by inventing a EnableDisableTrigStmt sub-command node that stores (only?) the recurse flag. -- Thanks, Amit

Re: First draft of the PG 15 release notes

2022-05-19 Thread Amit Langote
On Thu, May 19, 2022 at 2:56 PM David Rowley wrote: > On Thu, 19 May 2022 at 14:41, Amit Langote wrote: > > Though a bit late given beta is now wrapped, I have another partition > > item wording improvement suggestion: > > > > -Previously, a partitioned table with an

Re: First draft of the PG 15 release notes

2022-05-18 Thread Amit Langote
On Sat, May 14, 2022 at 12:42 AM Bruce Momjian wrote: > On Fri, May 13, 2022 at 10:48:41AM +0900, Amit Langote wrote: > > Btw, perhaps the following should be listed under E.1.3.2.1. Logical > > Replication, not E.1.3.1.1. Partitioning? > > > > > > > &g

Re: pgbench --partitions=0

2022-05-17 Thread Amit Langote
On Wed, May 18, 2022 at 9:50 Michael Paquier wrote: > On Mon, May 16, 2022 at 03:00:51PM +0900, Michael Paquier wrote: > > (I have added an open item, just in case.) > > And fixed as of 27f1366 Thank you. -- Thanks, Amit Langote EDB: http://www.enterprisedb.com

Re: pgbench --partitions=0

2022-05-15 Thread Amit Langote
On Mon, May 16, 2022 at 2:41 PM Michael Paquier wrote: > On Mon, May 16, 2022 at 11:34:41AM +0900, Amit Langote wrote: > > Attached a patch to fix with a test added. cc'ing Michael who > > authored that commit. > > Indeed, 6f164e6d got that incorrectly. I don'

pgbench --partitions=0

2022-05-15 Thread Amit Langote
Michael who authored that commit. -- Thanks, Amit Langote EDB: http://www.enterprisedb.com pgbench-accept-0-partitions.patch Description: Binary data

Re: First draft of the PG 15 release notes

2022-05-12 Thread Amit Langote
On Fri, May 13, 2022 at 11:44 AM Amit Kapila wrote: > On Fri, May 13, 2022 at 7:19 AM Amit Langote wrote: > > > > On Thu, May 12, 2022 at 10:52 PM Bruce Momjian wrote: > > > Okay, I went with: > > > > > > Previously, such updates ran delete act

Re: First draft of the PG 15 release notes

2022-05-12 Thread Amit Langote
tion root. WFM, thanks. Btw, perhaps the following should be listed under E.1.3.2.1. Logical Replication, not E.1.3.1.1. Partitioning? Remove incorrect duplicate partitions in system view pg_publication_tables (Hou Zhijie) Attached a patch to do so. -- Thanks, Amit La

Re: First draft of the PG 15 release notes

2022-05-11 Thread Amit Langote
On Wed, May 11, 2022 at 11:41 PM Bruce Momjian wrote: > On Wed, May 11, 2022 at 04:02:31PM +0900, Amit Langote wrote: > > On Wed, May 11, 2022 at 12:44 AM Bruce Momjian wrote: > > > I have completed the first draft of the PG 15 release notes > > The commit is intended to

Re: First draft of the PG 15 release notes

2022-05-11 Thread Amit Langote
On Wed, May 11, 2022 at 12:44 AM Bruce Momjian wrote: > I have completed the first draft of the PG 15 release notes Thanks. Regarding: Improve the trigger behavior of updates on partitioned tables that move rows between partitions (Amit Langote) Previously, such updates fired del

Re: simplifying foreign key/RI checks

2022-05-02 Thread Amit Langote
On Mon, Apr 11, 2022 at 4:47 PM Amit Langote wrote: > This one has been marked Returned with Feedback in the CF app, which > makes sense given the discussion on -committers [1]. > > Agree with the feedback given that it would be better to address *all* > RI trigger check/a

Re: simplifying foreign key/RI checks

2022-04-11 Thread Amit Langote
On Thu, Apr 7, 2022 at 10:05 AM Amit Langote wrote: > There were rebase conflicts with the recently committed > execPartition.c/h changes. While fixing them, I thought maybe > find_leaf_part_for_key() doesn't quite match in style with its > neighbors in execPartition.h

Re: generic plans and "initial" pruning

2022-04-10 Thread Amit Langote
On Fri, Apr 8, 2022 at 8:45 PM Amit Langote wrote: > Most looked fine changes to me except a couple of typos, so I've > adopted those into the attached new version, even though I know it's > too late to try to apply it. > > + * XXX is it worth doing a bms_copy() on glob

Re: generic plans and "initial" pruning

2022-04-08 Thread Amit Langote
Hi David, On Fri, Apr 8, 2022 at 8:16 PM David Rowley wrote: > On Fri, 8 Apr 2022 at 17:49, Amit Langote wrote: > > Attached updated patch with these changes. > Thanks for making the changes. I started looking over this patch but > really feel like it needs quite a few more ite

Re: generic plans and "initial" pruning

2022-04-07 Thread Amit Langote
On Thu, Apr 7, 2022 at 9:41 PM David Rowley wrote: > On Thu, 7 Apr 2022 at 20:28, Amit Langote wrote: > > Here's an updated version. In Particular, I removed > > part_prune_results list from PortalData, in favor of anything that > > needs to look at the list ca

Re: generic plans and "initial" pruning

2022-04-07 Thread Amit Langote
On Wed, Apr 6, 2022 at 4:20 PM Amit Langote wrote: > And here is a version like that that passes make check-world. Maybe > still a WIP as I think comments could use more editing. > > Here's how the new implementation works: > > AcquireExecutorLocks() calls ExecutorDoIniti

Re: simplifying foreign key/RI checks

2022-04-06 Thread Amit Langote
There were rebase conflicts with the recently committed execPartition.c/h changes. While fixing them, I thought maybe find_leaf_part_for_key() doesn't quite match in style with its neighbors in execPartition.h, so changed it to ExecGetLeafPartitionForKey(). -- Amit Langote EDB: http

Re: generic plans and "initial" pruning

2022-04-06 Thread Amit Langote
On Fri, Apr 1, 2022 at 5:36 PM Amit Langote wrote: > On Fri, Apr 1, 2022 at 5:20 PM David Rowley wrote: > > On Fri, 1 Apr 2022 at 19:58, Amit Langote wrote: > > > Yes, the ExecLockRelsInfo node in the current patch, that first gets > > > added to the QueryDesc and

Re: Skip partition tuple routing with constant partition key

2022-04-05 Thread Amit Langote
FAIL Hmm, make check-world passes for me after rebasing the patch (v10) to the latest HEAD (clean), nor do I see a failure on cfbot: http://cfbot.cputube.org/amit-langote.html -- Amit Langote EDB: http://www.enterprisedb.com

Re: generic plans and "initial" pruning

2022-04-05 Thread Amit Langote
On Tue, Apr 5, 2022 at 7:00 PM Alvaro Herrera wrote: > On 2022-Apr-05, Amit Langote wrote: > > While at it, maybe it's better to rename ExecInitPruningContext() to > > InitPartitionPruneContext(), which I've done in the attached updated > > patch. > > Good call.

Re: generic plans and "initial" pruning

2022-04-04 Thread Amit Langote
On Mon, Apr 4, 2022 at 9:55 PM Amit Langote wrote: > On Sun, Apr 3, 2022 at 8:33 PM Alvaro Herrera wrote: > > I think the names ExecCreatePartitionPruneState and > > ExecInitPartitionPruning are too confusingly similar. Maybe the former > > should be renamed to

Re: generic plans and "initial" pruning

2022-04-04 Thread Amit Langote
set of target subplans to choose from than + * those in the pre-initial-pruning set, so the maps in PartitionPruneState + * containing those indexes must be updated to reflect the new indexes of + * subplans in the post-initial-pruning set. I've attached only the updated 0001, though I'm still working on the others to address David's comments. -- Amit Langote EDB: http://www.enterprisedb.com v9-0001-Some-refactoring-of-runtime-pruning-code.patch Description: Binary data

Re: generic plans and "initial" pruning

2022-04-01 Thread Amit Langote
On Fri, Apr 1, 2022 at 5:20 PM David Rowley wrote: > On Fri, 1 Apr 2022 at 19:58, Amit Langote wrote: > > Yes, the ExecLockRelsInfo node in the current patch, that first gets > > added to the QueryDesc and subsequently to the EState of the query, > > serves as that stas

Re: generic plans and "initial" pruning

2022-04-01 Thread Amit Langote
On Fri, Apr 1, 2022 at 12:45 PM Tom Lane wrote: > Amit Langote writes: > > On Fri, Apr 1, 2022 at 10:32 AM David Rowley wrote: > >> 1. You've changed the signature of various functions by adding > >> ExecLockRelsInfo *execlockrelsinfo. I'm wondering w

Re: generic plans and "initial" pruning

2022-04-01 Thread Amit Langote
On Fri, Apr 1, 2022 at 1:08 PM David Rowley wrote: > On Fri, 1 Apr 2022 at 16:09, Amit Langote wrote: > > definition of PlannedStmt says this: > > > > /* > > * PlannedStmt node > > * > > * The output of the planner > >

Re: generic plans and "initial" pruning

2022-03-31 Thread Amit Langote
d found it a bit complex and expensive (the scanning the leaf paths part). > It's a fairly high-level review at this stage. I can look in more > detail if the above points get looked at. You may find or know of > some reason why it can't be done like I mention above. I'l

Re: generic plans and "initial" pruning

2022-03-31 Thread Amit Langote
ing patch is to make it easier to review the more complex changes that 0004 makes to execPartition.c, I agree it has merit on its own. Although, one may say that the bit about providing a PlanState-independent ExprContext is more closely tied with 0004's requirements... -- Amit Langote

Re: Skip partition tuple routing with constant partition key

2022-03-24 Thread Amit Langote
On Thu, Mar 24, 2022 at 1:55 AM Zhihong Yu wrote: > On Wed, Mar 23, 2022 at 5:52 AM Amit Langote wrote: >> I've attached an updated version of the patch, though I haven't >> changed the threshold constant. > + * Threshold of the number of tuples to need to have bee

Re: Skip partition tuple routing with constant partition key

2022-03-23 Thread Amit Langote
e bound offset in succession a number of times. Maybe waiting a 1000 tuples to re-assess that is a bit too conservative, yes. I guess even as small a number as 10 is fine here? I've attached an updated version of the patch, though I haven't changed the threshold constant. -- Amit Langote EDB: http:/

Re: generic plans and "initial" pruning

2022-03-22 Thread Amit Langote
On Tue, Mar 15, 2022 at 3:19 PM Amit Langote wrote: > On Tue, Mar 15, 2022 at 5:06 AM Robert Haas wrote: > > On Mon, Mar 14, 2022 at 3:38 PM Tom Lane wrote: > > > Also, while I've not spent much time at all reading this patch, > > > it seems rather desperatel

Re: simplifying foreign key/RI checks

2022-03-21 Thread Amit Langote
On Mon, Mar 14, 2022 at 6:28 PM Zhihong Yu wrote: > On Mon, Mar 14, 2022 at 1:33 AM Amit Langote wrote: >> On Tue, Jan 18, 2022 at 3:30 PM Amit Langote wrote: >> > v13 is attached. >> >> I noticed that the recent 641f3dffcdf's changes to >> get_constrain

Re: a misbehavior of partition row movement (?)

2022-03-21 Thread Amit Langote
Hi Alvaro, On Mon, Mar 21, 2022 at 2:58 AM Alvaro Herrera wrote: > On 2022-Mar-20, Amit Langote wrote: > > On Sun, Mar 20, 2022 at 5:13 AM Alvaro Herrera > > wrote: > > > On 2022-Mar-18, Zhihong Yu wrote: > > > > > + if (!partRel->rd_rel->relisp

Re: Allow batched insert during cross-partition updates

2022-03-21 Thread Amit Langote
On Tue, Mar 22, 2022 at 9:30 AM Andres Freund wrote: > On 2021-08-24 12:03:59 +0900, Amit Langote wrote: > > Tomas committed the bug-fix, so attaching a rebased version of the > > patch for $subject. > > This patch is in the current CF, but doesn't apply: > http://cfbot.c

Re: a misbehavior of partition row movement (?)

2022-03-19 Thread Amit Langote
PK table in that relationship. Other than the comment, the code itself seems self-documenting with regard to what's being done (given the function/macro/variable naming), so maybe we're better off without additional commentary here. I've attached a delta patch on v16 for the above comment and a couple of other changes. -- Amit Langote EDB: http://www.enterprisedb.com v16_delta.diff Description: Binary data

Re: support for MERGE

2022-03-15 Thread Amit Langote
On Mon, Mar 14, 2022 at 11:36 PM Amit Langote wrote: > On Sun, Mar 13, 2022 at 12:36 AM Alvaro Herrera > wrote: > > FYI I intend to get the ModifyTable split patch (0001+0003) pushed > > hopefully on Tuesday or Wednesday next week, unless something really > > ugly is f

Re: generic plans and "initial" pruning

2022-03-15 Thread Amit Langote
e to pass down to the executor alongside the plan tree. If it does not, ExecInit[Merge]Append() does the pruning in the same way it does now. Such cases include initial pruning using only STABLE expressions that the planner doesn't bother to compute by itself lest the resulting plan may be cached, but no EXTERN parameters. -- Amit Langote EDB: http://www.enterprisedb.com

Re: support for MERGE

2022-03-14 Thread Amit Langote
just have these two be the output arguments of ExecUpdateAct()? +redo_act: + /* XXX reinit ->crossPartUpdate here? */ Why not just make ExecUpdateAct() always set the flag, not only when a cross-partition update does occur? Will look some more in the morning tomorrow. --

Re: simplifying foreign key/RI checks

2022-03-14 Thread Amit Langote
On Tue, Jan 18, 2022 at 3:30 PM Amit Langote wrote: > v13 is attached. I noticed that the recent 641f3dffcdf's changes to get_constraint_index() made it basically unusable for this patch's purposes. Reading in the thread that led to 641f3dffcdf why get_constraint_index() was changed the

Re: generic plans and "initial" pruning

2022-03-11 Thread Amit Langote
On Fri, Mar 11, 2022 at 11:35 PM Amit Langote wrote: > Attached is v5, now broken into 3 patches: > > 0001: Some refactoring of runtime pruning code > 0002: Add a plan_tree_walker > 0003: Teach AcquireExecutorLocks to skip locking pruned relations Repeated the performance

Re: generic plans and "initial" pruning

2022-03-07 Thread Amit Langote
On Fri, Feb 11, 2022 at 7:02 AM Robert Haas wrote: > On Thu, Feb 10, 2022 at 3:14 AM Amit Langote wrote: > > Maybe this should be more than one patch? Say: > > > > 0001 to add ExecutorPrep and the boilerplate, > > 0002 to teach plancache.c to use the new facilit

Re: generic plans and "initial" pruning

2022-02-27 Thread Amit Langote
Hi Andres, On Fri, Feb 11, 2022 at 10:29 AM Andres Freund wrote: > On 2022-02-10 17:13:52 +0900, Amit Langote wrote: > > The attached patch implements this idea. Sorry for the delay in > > getting this out and thanks to Robert for the off-list discussions on > > this.

obsolete reference to a SubPlan field

2022-02-02 Thread Amit Langote
ched patch removes those. -- Amit Langote EDB: http://www.enterprisedb.com SubPlan-obsolete-comment.patch Description: Binary data

Re: Question on partition pruning involving stable operator: timestamptz_ge_date

2022-01-26 Thread Amit Langote
ifferent values. ExecInitAppend(), on the other hand, can assume a particular value when choosing partitions to initialize, because the value is fixed for a particular execution during which it runs. > 2) why timestamptz_xxx_date is STABLE not IMMUTABLE; Because calculations involving timest

Re: missing indexes in indexlist with partitioned tables

2022-01-25 Thread Amit Langote
s mildly confusing, since > it's not really about inheritance. I don't have a significantly better idea > though. Partitioned tables are "inheritance parent", so share the same code as what traditional inheritance parents have always used for planning. -- Amit Langote EDB: http://www.enterprisedb.com

Re: a misbehavior of partition row movement (?)

2022-01-19 Thread Amit Langote
On Wed, Jan 19, 2022 at 6:26 PM Alvaro Herrera wrote: > On 2022-Jan-19, Amit Langote wrote: > > BTW, your tweaks patch added this: > > > > + * *inserted_tuple is the tuple that's effectively inserted; > > + * *inserted_destrel is the rel

Re: generic plans and "initial" pruning

2022-01-19 Thread Amit Langote
On Tue, Jan 18, 2022 at 11:53 PM Robert Haas wrote: > On Tue, Jan 18, 2022 at 3:10 AM Amit Langote wrote: > > Pursuing that kind of a project would perhaps have been more > > worthwhile if the locking issue had affected more than just this > > particular case, that is

Re: generic plans and "initial" pruning

2022-01-19 Thread Amit Langote
On Tue, Jan 18, 2022 at 7:28 PM Simon Riggs wrote: > On Tue, 18 Jan 2022 at 08:10, Amit Langote wrote: > > On Tue, Jan 18, 2022 at 4:44 PM Simon Riggs > > wrote: > > > I haven't followed this in any detail, but this patch and its goal of > > > reducing

Re: a misbehavior of partition row movement (?)

2022-01-18 Thread Amit Langote
On Wed, Jan 19, 2022 at 4:13 PM Amit Langote wrote: > On Wed, Jan 19, 2022 at 7:29 AM Alvaro Herrera > wrote: > > On 2022-Jan-18, Alvaro Herrera wrote: > > > On 2022-Jan-18, Amit Langote wrote: > > > > > > > Would you like me to update the patch wit

Re: a misbehavior of partition row movement (?)

2022-01-18 Thread Amit Langote
On Wed, Jan 19, 2022 at 7:29 AM Alvaro Herrera wrote: > On 2022-Jan-18, Alvaro Herrera wrote: > > On 2022-Jan-18, Amit Langote wrote: > > > > > Would you like me to update the patch with the above renumbering or > > > are you working on a new version yourself

Re: generic plans and "initial" pruning

2022-01-18 Thread Amit Langote
run-time pruning (and plancache to some degree) seemed like it might lead to this getting fixed in a bounded timeframe. I admit that the concerns that Robert has raised about the patch make me want to reconsider that position, though maybe it's too soon to conclude. -- Amit Langote EDB: http://www.enterprisedb.com

Re: simplifying foreign key/RI checks

2022-01-17 Thread Amit Langote
+* the transaction-snapshot mode. If we didn't push one already, do > > didn't push -> haven't pushed Done. > For ri_PerformCheck(): > > + boolsource_is_pk = true; > > It seems the value of source_is_pk doesn't change - the value true can be > plugged int

Re: a misbehavior of partition row movement (?)

2022-01-17 Thread Amit Langote
zel.de > > Oh I missed it, thanks! Sorry for the noise. Thanks, it had puzzled me too when I first saw it this morning. -- Amit Langote EDB: http://www.enterprisedb.com

Re: a misbehavior of partition row movement (?)

2022-01-17 Thread Amit Langote
0 Agree that the ultimate code readability trumps diff minimalism. :-) Would you like me to update the patch with the above renumbering or are you working on a new version yourself? -- Amit Langote EDB: http://www.enterprisedb.com

Re: generic plans and "initial" pruning

2022-01-17 Thread Amit Langote
On Fri, Jan 14, 2022 at 11:10 PM Amit Langote wrote: > On Thu, Jan 6, 2022 at 3:45 PM Amul Sul wrote: > > Here are few comments for v1 patch: > > Thanks Amul. I'm thinking about Robert's latest comments addressing > which may need some rethinking of this whole design, but I

Re: generic plans and "initial" pruning

2022-01-14 Thread Amit Langote
will do the needful -- a bit of > comment would have helped. You're right. Added a dummy else {} block with just the comment saying so. > + case T_CustomScan: > + foreach(lc, ((CustomScan *) plan)->custom_plans) > + { > + if (walker((Pla

Re: a misbehavior of partition row movement (?)

2022-01-12 Thread Amit Langote
On Thu, Jan 13, 2022 at 12:19 PM Julien Rouhaud wrote: > On Tue, Jan 11, 2022 at 05:08:59PM +0900, Amit Langote wrote: > > > > I think I've managed to apply f4566345cf40b into v13 and v14. Patches > > attached. > > > > FTR this doesn't play well with the cfbot u

Re: generic plans and "initial" pruning

2022-01-12 Thread Amit Langote
Thanks for taking the time to look at this. On Wed, Jan 12, 2022 at 1:22 AM Robert Haas wrote: > On Fri, Dec 24, 2021 at 10:36 PM Amit Langote wrote: > > However, using an idea that Robert suggested to me off-list a little > > while back, it seems possible to determine the se

Re: a misbehavior of partition row movement (?)

2022-01-11 Thread Amit Langote
On Thu, Jan 6, 2022 at 9:36 PM Alvaro Herrera wrote: > On 2022-Jan-06, Amit Langote wrote: > > On Thu, Jan 6, 2022 at 7:27 AM Alvaro Herrera > > wrote: > > > > I have pushed it thinking that we would not backpatch any of this fix. > > > However, after ru

Re: sqlsmith: ERROR: XX000: bogus varno: 2

2022-01-07 Thread Amit Langote
On Fri, Jan 7, 2022 at 12:24 AM Tom Lane wrote: > Amit Langote writes: > > Thanks for addressing that in the patch you posted. I guess fixing > > only expression_tree_walker/mutator() suffices for now, but curious to > > know if it was intentional that you decided not t

Re: sqlsmith: ERROR: XX000: bogus varno: 2

2022-01-06 Thread Amit Langote
On Thu, Jan 6, 2022 at 3:43 PM Amit Langote wrote: > On Tue, Dec 21, 2021 at 6:20 AM Tom Lane wrote: > > Robert Haas writes: > > > OK ... but my point is that dump and restore does work. So whatever > > > cases pg_get_expr() doesn't work must be cases that aren't need

Re: a misbehavior of partition row movement (?)

2022-01-05 Thread Amit Langote
001 down to v12, I suppose it would be nice to get this fixed down to v12. -- Amit Langote EDB: http://www.enterprisedb.com

Re: sqlsmith: ERROR: XX000: bogus varno: 2

2022-01-05 Thread Amit Langote
as possible. * ... * Note: the reason we don't simply use expression_tree_walker() is that the * point of that function is to support tree walkers that don't care about * most tree node types, but here we care about all types. We should complain * about any unrecognized node type. or maybe not, because relpartbound contents ought never reach queryjumble.c? -- Amit Langote EDB: http://www.enterprisedb.com

Re: Delay the variable initialization in get_rel_sync_entry

2022-01-05 Thread Amit Langote
es I looked at. So, applied > down to 13. Thanks. I agree the variables were being defined in the wrong place before this patch. -- Amit Langote EDB: http://www.enterprisedb.com

Re: generic plans and "initial" pruning

2021-12-30 Thread Amit Langote
On Tue, Dec 28, 2021 at 22:12 Ashutosh Bapat wrote: > On Sat, Dec 25, 2021 at 9:06 AM Amit Langote > wrote: > > > > Executing generic plans involving partitions is known to become slower > > as partition count grows due to a number of bottlenecks, with > >

generic plans and "initial" pruning

2021-12-24 Thread Amit Langote
ps = 16312.412704 (without initial connection time) -- Amit Langote EDB: http://www.enterprisedb.com [1] https://www.postgresql.org/message-id/CAKJS1f_kfRQ3ZpjQyHC7=pk9vrhxihbqfz+hc0jcwwnrkkf...@mail.gmail.com [2] https://www.postgresql.org/message-id/CAKJS1f99JNe%2Bsw5E3qWmS%2BHeLMFaAhehK

Re: Multi-Column List Partitioning

2021-12-21 Thread Amit Langote
On Tue, Dec 21, 2021 at 2:47 PM Ashutosh Sharma wrote: > On Mon, Dec 20, 2021 at 7:04 PM Amit Langote wrote: >> On Mon, Dec 13, 2021 at 11:37 PM Ashutosh Sharma >> wrote: >> > >> > Hi, >> > >> > Is this okay? >> > >

Re: Multi-Column List Partitioning

2021-12-20 Thread Amit Langote
| | > Partition key: LIST (a, a, a) > Number of partitions: 1 (Use \d+ to list them.) I'd say it's not okay for a user to expect this to work sensibly, and I don't think it would be worthwhile to write code to point that out to the user if that is what you were implying. -- Amit Langote EDB: http://www.enterprisedb.com

Re: simplifying foreign key/RI checks

2021-12-20 Thread Amit Langote
On Mon, Dec 20, 2021 at 6:19 PM Zhihong Yu wrote: > On Sun, Dec 19, 2021 at 10:20 PM Amit Langote wrote: >> >> On Mon, Dec 20, 2021 at 2:00 PM Corey Huinker >> wrote: >> > Sorry for the delay. This patch no longer

Re: a misbehavior of partition row movement (?)

2021-12-20 Thread Amit Langote
On Thu, Oct 14, 2021 at 6:00 PM Amit Langote wrote: > On Mon, Sep 20, 2021 at 3:32 PM Amit Langote wrote: > > The problem was that the tuplestore > > (afterTriggers.query_stack[query_level].tuplestore) that I decided to > > use to store the AFTER trigger tuples o

Re: simplifying foreign key/RI checks

2021-12-19 Thread Amit Langote
On Mon, Dec 20, 2021 at 2:00 PM Corey Huinker wrote: > Sorry for the delay. This patch no longer applies, it has some conflict with > d6f96ed94e73052f99a2e545ed17a8b2fdc1fb8a Thanks Corey for the heads up. Rebased with some cosmetic adjustments. -- Amit Langote EDB

Re: Multi-Column List Partitioning

2021-12-08 Thread Amit Langote
On Thu, Dec 9, 2021 at 3:12 PM Amul Sul wrote: > On Thu, Dec 9, 2021 at 11:24 AM Amit Langote wrote: > > > [] > > On Mon, Dec 6, 2021 at 10:57 PM Nitin Jadhav > > wrote: > > > > Looks difficult to understand at first glance, how about the following: &

Re: Multi-Column List Partitioning

2021-12-08 Thread Amit Langote
On Thu, Dec 9, 2021 at 2:54 PM Amit Langote wrote: > > Hi Nitin, > > Was looking at warnings generated by v8: > > partbounds.c:971:17: warning: unused variable 'b1_isnull' [-Wunused-variable] > bool

Re: Multi-Column List Partitioning

2021-12-08 Thread Amit Langote
continue; } /* < the long comment snipped >*/ if (!datumIsEqual(b1->datums[i][j], b2->datums[i][j], parttypbyval[j], parttyplen[j])) return false; Also, please remove the declarations of b1_isnull and b2_isnull to get rid of the warnings. -- Amit Langote EDB: http://www.enterprisedb.com

Re: pg_get_publication_tables() output duplicate relid

2021-12-07 Thread Amit Langote
On Tue, Dec 7, 2021 at 3:20 PM Amit Kapila wrote: > On Tue, Dec 7, 2021 at 10:52 AM Amit Langote wrote: > > So if a partition is > > explicitly present in a publication with a filter defined on it, I > > suppose following are the possible scenarios: > > > >

Re: pg_get_publication_tables() output duplicate relid

2021-12-06 Thread Amit Langote
On Tue, Dec 7, 2021 at 1:01 PM Amit Kapila wrote: > On Mon, Dec 6, 2021 at 8:59 PM Amit Langote wrote: > > On Mon, Dec 6, 2021 at 6:05 PM Amit Kapila wrote: > > > Your concern is not very clear to me. Can you be more specific in what > > > kind of problem you see

Re: pg_get_publication_tables() output duplicate relid

2021-12-06 Thread Amit Langote
On Tue, Dec 7, 2021 at 12:45 PM Amit Kapila wrote: > On Mon, Dec 6, 2021 at 8:04 PM Amit Langote wrote: > > So IIUC the scenario of concern is when a table to be attached as a > > partition is in a schema that's present in pg_publication_namespace. > > The only way

Re: pg_get_publication_tables() output duplicate relid

2021-12-06 Thread Amit Langote
On Mon, Dec 6, 2021 at 6:05 PM Amit Kapila wrote: > On Mon, Dec 6, 2021 at 1:00 PM Amit Langote wrote: > > On Mon, Dec 6, 2021 at 3:55 PM houzj.f...@fujitsu.com > > wrote: > > > After thinking more on this. I find there might be some usage about > > > a

Re: pg_get_publication_tables() output duplicate relid

2021-12-06 Thread Amit Langote
On Mon, Dec 6, 2021 at 1:59 PM Amit Kapila wrote: > On Fri, Dec 3, 2021 at 6:04 PM Amit Langote wrote: > > On Fri, Dec 3, 2021 at 12:37 PM Amit Kapila wrote: > > > On Thu, Dec 2, 2021 at 7:18 PM Amit Langote > > > wrote: > > > > Okay, I did write a PoC

Re: pg_get_publication_tables() output duplicate relid

2021-12-05 Thread Amit Langote
On Mon, Dec 6, 2021 at 3:55 PM houzj.f...@fujitsu.com wrote: > On Thursday, December 2, 2021 9:48 PM Amit Langote > wrote: > > On Thu, Dec 2, 2021 at 2:27 PM Amit Kapila wrote: > > > On Thu, Dec 2, 2021 at 8:42 AM Amit Langote > > wrote: > > > > Reading

Re: pg_get_publication_tables() output duplicate relid

2021-12-03 Thread Amit Langote
On Fri, Dec 3, 2021 at 21:34 Amit Langote wrote: > On Fri, Dec 3, 2021 at 12:37 PM Amit Kapila > wrote: > > On Thu, Dec 2, 2021 at 7:18 PM Amit Langote > wrote: > > > On Thu, Dec 2, 2021 at 2:27 PM Amit Kapila > wrote: > > > > On Thu, Dec 2

Re: pg_get_publication_tables() output duplicate relid

2021-12-03 Thread Amit Langote
On Fri, Dec 3, 2021 at 12:37 PM Amit Kapila wrote: > On Thu, Dec 2, 2021 at 7:18 PM Amit Langote wrote: > > On Thu, Dec 2, 2021 at 2:27 PM Amit Kapila wrote: > > > On Thu, Dec 2, 2021 at 8:42 AM Amit Langote > > > wrote: > > > > Reading Alvaro's

Re: pg_get_publication_tables() output duplicate relid

2021-12-02 Thread Amit Langote
On Thu, Dec 2, 2021 at 2:27 PM Amit Kapila wrote: > On Thu, Dec 2, 2021 at 8:42 AM Amit Langote wrote: > > Reading Alvaro's email at the top again gave me a pause to reconsider > > what I had said in reply. It might indeed have been nice if the > > publication DDL itself ha

Re: Data is copied twice when specifying both child and parent table in publication

2021-12-01 Thread Amit Langote
ce some problems like what we are trying to solve > here. Yeah, back-patching may not be such a bad idea. Thank you. -- Amit Langote EDB: http://www.enterprisedb.com

Re: pg_get_publication_tables() output duplicate relid

2021-12-01 Thread Amit Langote
On Thu, Dec 2, 2021 at 9:44 houzj.f...@fujitsu.com wrote: > On Wed, Dec 1, 2021 3:01 PM Amit Kapila wrote: > > > > On Mon, Nov 22, 2021 at 12:55 PM Amit Langote > > > > wrote: > > > > > On second thought, I agree that de-duplicating partitions

Re: pg_get_publication_tables() output duplicate relid

2021-11-25 Thread Amit Langote
On Thu, Nov 25, 2021 at 5:57 PM Amit Kapila wrote: > On Thu, Nov 25, 2021 at 1:30 PM Amit Langote wrote: > > I agree with backpatching the doc fix. I've attached a diff against > > master, though it also appears to apply to 13 and 14 branches. > > I think we can for publi

Re: pg_get_publication_tables() output duplicate relid

2021-11-25 Thread Amit Langote
On Wed, Nov 24, 2021 at 5:44 PM Amit Kapila wrote: > On Wed, Nov 24, 2021 at 12:02 PM Amit Langote wrote: > > So yeah, documenting the ATTACH issue as a limitation sounds like the > > best course for now. I might word it as follows and add it under > > Notes at https://ww

Re: pg_get_publication_tables() output duplicate relid

2021-11-23 Thread Amit Langote
do so the streaming after attach partition problem as > discussed above should be fixed. I agree. I have reproduced the problem though haven't managed to pin down the cause yet. -- Amit Langote EDB: http://www.enterprisedb.com

Re: pg_get_publication_tables() output duplicate relid

2021-11-22 Thread Amit Langote
On Sat, Nov 20, 2021 at 8:31 PM Amit Kapila wrote: > On Fri, Nov 19, 2021 at 10:58 AM Amit Kapila wrote: > > On Fri, Nov 19, 2021 at 7:19 AM Amit Langote > > wrote: > > > The problematic case is attaching the partition *after* the subscriber > > > has already

Re: pg_get_publication_tables() output duplicate relid

2021-11-21 Thread Amit Langote
On Fri, Nov 19, 2021 at 2:28 PM Amit Kapila wrote: > On Fri, Nov 19, 2021 at 7:19 AM Amit Langote wrote: > > As in, > > do we know of any replication (initial/streaming) misbehavior caused > > by the duplicate partition OIDs in this case or is the only problem > >

Re: simplifying foreign key/RI checks

2021-11-19 Thread Amit Langote
On Sat, Nov 13, 2021 at 5:43 AM Tom Lane wrote: > Amit Langote writes: > > On Fri, Nov 12, 2021 at 8:19 AM Tom Lane wrote: > >> Anyway, I think that (1) we should write some more test cases around > >> this behavior, (2) you need to establish the snapshot to use

Re: pg_get_publication_tables() output duplicate relid

2021-11-18 Thread Amit Langote
On Thu, Nov 18, 2021 at 1:53 PM Amit Kapila wrote: > On Wed, Nov 17, 2021 at 11:39 AM Amit Langote wrote: > > What IS problematic is what a subscriber sees in the > > pg_publication_tables view and the problem occurs only in the initial > > sync phase, where the partition is

Re: pg_get_publication_tables() output duplicate relid

2021-11-17 Thread Amit Langote
On Thu, Nov 18, 2021 at 9:33 houzj.f...@fujitsu.com wrote: > On Wed, Nov 17, 2021 2:18 PM Amit Langote wrote: > > On Wed, Nov 17, 2021 at 12:15 PM houzj.f...@fujitsu.com > > wrote: > > > On Wed, Nov 17, 2021 10:47 AM Amit Kapila > > wrote: > > > &g

Re: pg_get_publication_tables() output duplicate relid

2021-11-17 Thread Amit Langote
On Wed, Nov 17, 2021 at 3:09 PM Amit Langote wrote: > Though I now tend > to agree with Amit K that that may be such a meaningful and all that > common use case, Oops I meant: that may NOT be such... -- Amit Langote EDB: http://www.enterprisedb.com

Re: pg_get_publication_tables() output duplicate relid

2021-11-16 Thread Amit Langote
o the publication explicitly, like all the examples we have been discussing. I guess we're only arguing about the problems with the pg_publication_tables view, which does expand the partitioned table to show the partitions that are not otherwise not present in the base catalog. -- Amit Langote EDB: http://www.enterprisedb.com

Re: pg_get_publication_tables() output duplicate relid

2021-11-16 Thread Amit Langote
ns that are known at the time when the parent is first synced, that too via the parent (as SELECT FROM parent), and then marks the parent as sync-done. Refreshing the subscription after ATTACHing doesn't help, because the subscriber can't see any partitions to begin with. Maybe a more elaborate

Re: support for MERGE

2021-11-15 Thread Amit Langote
Hi Álvaro, On Tue, Nov 16, 2021 at 6:01 AM Álvaro Herrera wrote: > On 2021-Nov-14, Amit Langote wrote: > > The only problem caused by the code block that follows the buggy if > > statement unconditionally executing is wasted cycles. Fortunately, > > there's no corre

Re: support for MERGE

2021-11-14 Thread Amit Langote
tRelInfo is the same as the input result relation in the cases where the latter is not partitioned and there'd be no map to convert the tuple, so the block is basically a no-op. I was afraid about the case where the input relation is a regular inheritance parent, though apparently we don't s

Re: simplifying foreign key/RI checks

2021-11-12 Thread Amit Langote
o that is that it causes the SPI query to see even user table rows that it shouldn't be able to, so that is why you say it is too global a mechanism for this hack. Whatever mechanism we will use would still need to involve setting a global Snapshot variable though, right? -- Amit Langote EDB: http://www.enterprisedb.com

<    1   2   3   4   5   6   7   8   9   10   >