Re: Partitioning option for COPY - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Partitioning option for COPY
Date
Msg-id 18802.1258996736@sss.pgh.pa.us
Whole thread Raw
In response to Re: Partitioning option for COPY  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Partitioning option for COPY
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> Anyway, I want data routing, as is the intention of this patch. I just
> don't think this patch is a useful way to do it. It is too narrow in its
> scope and potentially buggy in its approach to developing a cache and
> using trigger-like stuff. 

FWIW, I agree --- there are two really fundamental problems with this
patch:

* It only applies to COPY.  You'd certainly want routing for INSERT as well.  And it shouldn't be necessary to specify
anoption.
 

* Building this type of infrastructure on top of independent, not guaranteed consistent table constraints is just
throwingmore work into a dead end.  The patch is already full of special-case errors for possible inconsistency of the
constraints,and I don't think it's bulletproof even so (what if someone is altering the constraints concurrently? What
ifthere's more than one legal destination?) And the performance necessarily sucks.
 

What we need first is an explicit representation of partitioning, and
then to build routing code on top of that.  I haven't looked at
Itagaki-san's syntax patch at all, but I think it's at least starting
in a sensible place.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: point_ops for GiST
Next
From: Greg Smith
Date:
Subject: Re: Partitioning option for COPY