>> 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. 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.