Basil Bourque <basil(dot)list(at)me(dot)com> writes:
> For a "timestamp with time zone" column, how do I find all rows where the value is within the beginning and ending of a single date?
If you compare a date to a timestamp, the date is taken to mean midnight
of its day. So you need something along the line of
WHERE timestampcol BETWEEN dateval AND dateval+1
> And I'm concerned about local date time. I want to find by the user's local beginning and end of the day, not UTC.
Well, you're not being too clear about what you need here, but in what
I suggest above, "midnight" will be interpreted according to the current
regards, tom lane
In response to
pgsql-novice by date
|Next:||From: Merlin Moncure||Date: 2011-10-20 13:42:15|
|Subject: Re: Can triggers update other tables?|
|Previous:||From: Basil Bourque||Date: 2011-10-20 01:08:00|
|Subject: Query on DATETIME for a date (the whole day)|