Re: Patch: Add parse_type Function

From: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
To: Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>
Cc: Erik Wienhold <ewie(at)ewie(dot)name>, jian he <jian(dot)universality(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Patch: Add parse_type Function
Date: 2024-03-08 01:37:03
Message-ID: 48039C0E-CA03-44EA-81B4-BA3D273DBCE4@justatheory.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello Hackers,

On Feb 25, 2024, at 13:00, David E. Wheeler <david(at)justatheory(dot)com> wrote:

>> 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’ve rebased the patch and, in an attempt to clarify this behavior, added a couple of examples to the docs for to_regtype. Updated patch attached.

Best,

David

Attachment Content-Type Size
v10-0001-Add-to_regtypemod-SQL-function.patch application/octet-stream 10.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2024-03-08 02:02:00 Re: ALTER TABLE SET ACCESS METHOD on partitioned tables
Previous Message John Naylor 2024-03-08 01:31:37 Re: [PoC] Improve dead tuple storage for lazy vacuum