Re: Proposal: Automatic partition creation - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal: Automatic partition creation
Date
Msg-id 1378901.1594051837@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal: Automatic partition creation  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Proposal: Automatic partition creation  (Robert Haas <robertmhaas@gmail.com>)
Re: Proposal: Automatic partition creation  (Anastasia Lubennikova <a.lubennikova@postgrespro.ru>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> On Mon, Jul 6, 2020 at 6:46 AM Anastasia Lubennikova
> <a.lubennikova@postgrespro.ru> wrote:
>> I am going to implement this via SPI, which allow to simplify checks and
>> calculations. Do you see any pitfalls in this approach?

> I don't really see why we need SPI here.

I would vote against any core facility that is implemented via SPI
queries.  It is just too darn hard to control the semantics completely in
the face of fun stuff like varying search_path.  Look at what a mess the
queries generated by the RI triggers are --- and they only have a very
small set of behaviors to worry about.  I'm still only about 95% confident
they don't have security issues, too.

If you're using SPI to try to look up appropriate operators, I think
the chances of being vulnerable to security problems are 100%.

> I think the big problem here is identifying the operator to use. We
> have no way of identifying the "plus" or "minus" operator associated
> with a datatype; indeed, that constant doesn't exist.

We did indeed solve this in connection with window functions, cf
0a459cec9.  I may be misunderstanding what the problem is here,
but I think trying to reuse that infrastructure might help.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Proposal: Automatic partition creation
Next
From: Thom Brown
Date:
Subject: Multi-byte character case-folding