Re: BUG #16325: Assert failure on partitioning by int for a textvalue with a collation
| От | Dmitry Dolgov |
|---|---|
| Тема | Re: BUG #16325: Assert failure on partitioning by int for a textvalue with a collation |
| Дата | |
| Msg-id | 20200403152910.rsdc2yg7bisqaltb@localhost обсуждение исходный текст |
| Ответ на | Re: BUG #16325: Assert failure on partitioning by int for a textvalue with a collation (Michael Paquier <michael@paquier.xyz>) |
| Ответы |
Re: BUG #16325: Assert failure on partitioning by int for a textvalue with a collation
|
| Список | pgsql-bugs |
> On Thu, Apr 02, 2020 at 11:01:50AM +0900, Michael Paquier wrote:
>
> > + /*
> > + * No need to check if exprCollOid is invalid, since if it would be,
> > + * then transformCollateClause will throw an error earlier
> > + */
> > + if (!type_is_collatable(colType))
> > + ereport(ERROR,
> > + (errcode(ERRCODE_DATATYPE_MISMATCH),
> > + errmsg("collations are not supported by type %s",
> > + format_type_be(colType))));
> > +
> >
> > if (OidIsValid(exprCollOid) &&
> > exprCollOid != DEFAULT_COLLATION_OID &&
> > exprCollOid != partCollation)
>
> Another point that could be made is that as we know that we are in the
> presence of a CollateExpr() here, and exprCollOid will never be
> InvalidOid. So there could be a point in using an assertion instead
> of the check done below making sure that exprCollOid is always valid?
Thanks for the suggestion. It's not strictly related to the fix I guess,
but of course you're right, and we can indeed improve this part and
replace the check with an assert.
Вложения
В списке pgsql-bugs по дате отправления: