On Feb 24, 2024, at 19:11, Jim Jones <jim.jones@uni-muenster.de> wrote:
>> What’s the protocol for marking a patch ready for committer?
>
> I guess after the review of the last assigned reviewer
Oh, I didn’t realize someone was assigned. :-)
> The fact that a completely invalid type returns NULL ..
>
> SELECT to_regtypemod('foo');
> to_regtypemod
> ---------------
>
> (1 row)
>
>
> .. but a "partially" valid one returns an error might be confusing
>
> postgres=# SELECT to_regtypemod('timestamp(-4)');
> ERROR: syntax error at or near "-"
> LINE 1: SELECT to_regtypemod('timestamp(-4)');
> ^
> CONTEXT: invalid type name "timestamp(-4)"
>
> postgres=# SELECT to_regtypemod('text(-4)');
> ERROR: type modifier is not allowed for type "text"
Yeah, there was quite a bit of discussion of this issue back in September[1].
> This behaviour is mentioned in the documentation, so I'd say it is ok.
This is my attempt to make it clearer that it can return an error, but I don’t love the wording TBH.
> I would personally prefer either NULL or an error in both cases, but I
> can totally live with the current design.
SAME.
Best,
David
[1] https://www.postgresql.org/message-id/flat/09F9CAD6-5096-43CC-B6A7-685703E4714D@justatheory.com