On 2022-Jan-03, Tom Lane wrote:

> Attached v3 restores that distinction, and makes some other small
> tweaks.  (I found that there were actually a couple of spots in
> date.c that got it backwards, so admittedly this is a fine point
> that not everybody is on board with.  But let's make it consistent
> now.)

LGTM.

> @@ -2202,9 +2204,9 @@ time_part_common(PG_FUNCTION_ARGS, bool retnumeric)
>                       case DTK_ISOYEAR:
>                       default:
>                               ereport(ERROR,
> -                                             
> (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> -                                              errmsg("\"time\" units \"%s\" 
> not recognized",
> -                                                             lowunits)));
> +                                             
> (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
> +                                              errmsg("unit \"%s\" not 
> supported for type %s",
> +                                                             lowunits, 
> format_type_be(TIMEOID))));

I agree that these changes are an improvement.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/


Reply via email to