Search Postgresql Archives

Re: date range query help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 20, 2008 at 01:10:41PM +1100, novice wrote:
> select * from mobile_custodian;
> 
>  custodian_id | user_id | issue_date | return_date |  mobile_no
> --------------+---------+------------+-------------+-------------
>             4 |     Ben | 2008-10-11 | 2008-10-13  | 09455225998
>             5 |    Josh | 2008-10-15 |             | 09455225998

I sometimes find it easier to store ranges like this with having the
open ends at infinity.  This is easier with timestamps as they have
magic 'infinity' values in PG (both positive and negative).  Values of
date type don't have any special values like this which makes things a
bit more awkward.

I haven't seen it posted to the list for a while; but there's a nice
old book titled "Developing Time Oriented Database Applications in SQL"
that's now out of print but is available as a PDF.

  http://www.cs.arizona.edu/~rts/tdbbook.pdf


  Sam

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux