Re: Remove inconsistent quotes from date_part error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nikhil Benesch <nikhil(dot)benesch(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove inconsistent quotes from date_part error
Date: 2022-01-03 18:14:48
Message-ID: 3682868.1641233688@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Nikhil Benesch <nikhil(dot)benesch(at)gmail(dot)com> writes:
> Updated patch attached.

Hmm, I think you went a bit too far here. The existing code intends
to draw a distinction between "not recognized" (i.e., "we don't know
what that word was you used") and "not supported" (i.e., "we know
that word, but it doesn't seem to make sense in context, or we
haven't got round to the case yet"). You've mashed those into the
same error text, which I don't think we should do, especially
since we're using distinct ERRCODE values for them.

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.)

regards, tom lane

Attachment Content-Type Size
v3-0001-Improve-unsupported-units-errors.patch text/x-diff 14.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2022-01-03 18:29:26 Re: [PoC] Delegating pg_ident to a third party
Previous Message Blake, Geoff 2022-01-03 18:11:01 Re: Add spin_delay() implementation for Arm in s_lock.h