Re: Unexpected casts while using date_trunc()

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chris Bandy <bandy(dot)chris(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Unexpected casts while using date_trunc()
Date: 2018-05-24 19:17:28
Message-ID: 87muwo27f7.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

Tom> Yeah. There are two relevant variants of date_trunc():
[...]
Tom> So we probably ought to change the docs here.

There's also the option of adding an explicit function
date_trunc(text,date) returns date, which is a workaround that I (and
probably quite a few other people) have used. I think having such a
function added to core would be less surprising than the current
behavior.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-05-24 19:30:03 contrib/sepgsql fails on Fedora 28
Previous Message Paolo Crosato 2018-05-24 19:00:55 Re: Error on vacuum: xmin before relfrozenxid