Re: Remove inconsistent quotes from date_part error - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Remove inconsistent quotes from date_part error
Date
Msg-id 202201031835.zxrlklgg5z66@alvherre.pgsql
Whole thread Raw
In response to Re: Remove inconsistent quotes from date_part error  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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/



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Introducing PgVA aka PostgresVectorAcceleration using SIMD vector instructions starting with hex_encode
Next
From: Chapman Flack
Date:
Subject: TYPCATEGORY_{NETWORK,USER} [was Dubious usage of TYPCATEGORY_STRING]