Re: Support TZ format code in to_timestamp()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Aleksander Alekseev <aleksander(at)timescale(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Peter Smith <smithpb2250(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>
Subject: Re: Support TZ format code in to_timestamp()
Date: 2024-01-24 16:13:13
Message-ID: 160136.1706112793@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Aleksander Alekseev <aleksander(at)timescale(dot)com> writes:
> +SELECT to_timestamp('2011-12-18 11:38 JUNK', 'YYYY-MM-DD HH12:MI TZ'); -- error
> +ERROR: invalid value "JUNK" for "TZ"
> +DETAIL: Time zone abbreviation is not recognized.
> +SELECT to_timestamp('2011-12-18 11:38 ...', 'YYYY-MM-DD HH12:MI TZ'); -- error
> +ERROR: invalid value ".." for "TZ"

> Shouldn't the second error display the full value "..." (three dots)
> similarly to the previous one?

That's coming from the pre-existing OF code, which is looking for
a integer of at most two digits. I'm not especially inclined to
mess with that, and even if I were I'd think it should be a separate
patch.

> Also I think we need at least one
> negative test for OF.

OK.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tristan Partin 2024-01-24 16:18:31 Re: make dist using git archive
Previous Message Daniel Verite 2024-01-24 16:01:15 Re: Fixing backslash dot for COPY FROM...CSV