Re: unsupportable composite type partition keys

Amit Langote <amitlangote09@gmail.com>

From: Amit Langote <amitlangote09@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-12-25T00:33:28Z
Lists: pgsql-hackers
On Wed, Dec 25, 2019 at 2:42 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Amit Langote <amitlangote09@gmail.com> writes:
> > On Tue, Dec 24, 2019 at 12:00 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >> BTW, I forgot to mention: while I think the patch to forbid pseudotypes
> >> by using CheckAttributeType() can be back-patched, I'm leaning towards
> >> not back-patching the other patch.  The situation where we get into
> >> infinite recursion seems not very likely in practice, and it's not
> >> going to cause any crash or data loss, so I think we can just say
> >> "sorry that's not supported before v13".  The patch as I'm proposing
> >> it seems rather invasive for a back-branch fix.
>
> > It is indeed.
>
> > Just to be sure, by going with "unsupported before v13", which one do you mean:
>
> > * documenting it as so
> > * giving an error in such cases, like the patch in the first email on
> > this thread did
> > * doing nothing really
>
> I was thinking "do nothing in the back branches".  I don't believe we
> can detect such cases reliably (at least not without complicated logic,
> which'd defeat the point), so I don't think giving an error is actually
> feasible, and I doubt that documenting it would be useful.  If we get
> some field complaints about this, it'd be time enough to reconsider.

Sure, thanks for the reply.

Regards,
Amit



Commits

  1. Fix CheckAttributeType's handling of collations for ranges.

  2. Improve comments in utils/rel.h.

  3. Allow whole-row Vars to be used in partitioning expressions.

  4. Remove equalPartitionDescs().

  5. Load relcache entries' partitioning data on-demand, not immediately.

  6. Disallow partition key expressions that return pseudo-types.

  7. Prevent a rowtype from being included in itself via a range.