Re: Postgres do not allow to create many tables with more than 63-symbols prefix

From: Önder Kalacı <onderkalaci(at)gmail(dot)com>
To: Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, d(dot)koval(at)postgrespro(dot)ru, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: Re: Postgres do not allow to create many tables with more than 63-symbols prefix
Date: 2022-06-24 08:09:06
Message-ID: CACawEhWxE3V4L7zU1XD03pO2D7pRUATsmeU2x8C4uYCd4y=Uaw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thanks for working on this.

>> According to subj you can try to create many tables (induced by the case
> >> of partitioned table) with long prefix - see 6727v.sql for
> reproduction.
> >> But now it's impossible because of logic of the makeUniqueTypeName()
> >> routine.
> >> You get the error:
> >> ERROR: could not form array type name for type ...
> >>
> >> It is very corner case, of course. But solution is easy and short. So,
> >> why not to fix? - See the patch in attachment.
> >
> > While this seems to be a good improvement, I think it's not a bug.
> > Probably we cannot backpatch it as it will end up having type names
> > defined by different naming rules. I'd suggest discussing it on
> > -hackers.
> Done.
>

On Citus extension, we hit a similar issue while creating partitions (over
multiple transactions in parallel). You can see some more discussions on
the related Github issue #5334
<https://github.com/citusdata/citus/issues/5354>. We basically discuss this
behavior on the issue.

I tested this patch with the mentioned issue, and as expected the issue is
resolved.

Also, in general, the patch looks reasonable, following the approach
that ChooseRelationName()
implements makes sense to me as well.

Onder KALACI
Developing the Citus extension @Microsoft

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2022-06-24 08:35:27 Future Postgres 15 and Clang 15
Previous Message John Naylor 2022-06-24 07:33:00 Re: WIP Patch: Add a function that returns binary JSONB as a bytea