Subject: Re: abstime

From: postarch (Postgres Mailing Archive)
Date: Thu, 07 Nov 91 13:19:14 PST

In message <[email-masked]> you write:
> I'm having some problems with the abstime data type under postgres. I've
> created some tuples that have fields of type abstime that were initially
> set to "".  When I do a retieve they show up as epoch but i am unable to
> retrieve them by specifying either epoch or "" as shown here:
> 
> retrieve (repair.all) where repair.date=""
> 
> or
> 
> retrieve (repair.all) where repair.date=""
> 
> Is there some way to retrieve on NULL dates?

I was able to retrieve the tuples you describe by specifying the epoch
date explicitly:

  retrieve (repair.all) where repair.date = "Dec 31 16:00:00 1901 PDT"::abstime

> Also there is an addition problem that postgres does not return dates of type
> abstime in the same form that it accepts them because it appends the time
> zone to the end of the value returned, yet it will not accept a timezone on
> a date value that has been entered.

you are correct.

Jeff Meredith
[email-masked]

---

From: [email-masked] (Mike Olson)
Date: Thu, 07 Nov 91 13:34:28 PST

>   retrieve (repair.all) where repair.date = "Dec 31 16:00:00 1901 PDT"::abstime

the expression

	retrieve (repair.all) where repair.date = "epoch"::abstime

is exactly equivalent, and is independent of the timezone in which you
find yourself.
					mike