Re: [SQL] Date fields and libpq.... - Mailing list pgsql-sql

From Colin Dick
Subject Re: [SQL] Date fields and libpq....
Date
Msg-id Pine.LNX.3.96.980626140758.20477B-100000@ocis.ocis.net
Whole thread Raw
In response to Re: [SQL] Date fields and libpq....  (Kachun Lee <kachun@pathlink.com>)
Responses Re: [SQL] Date fields and libpq....
List pgsql-sql
> I think you may want to change your query to:
>
>    select date_part(datetime(abst_att), 'epoch') ....
>
> In addition, unless you were using BINARY cursor, you will need to do
> something like:
>
>   time_t t = atol(PQgetvalue(res, i, 0));

I have tried this but don't think I understand the internal datetime
function correctly.  Should my query be(start is defined as abstime):

select start(datetime(abst_att),'epoch') from timebase;

And then should this work:

printf("%lu\n",(unsigned long)PGgetvalue(res,0,0));

Thanks for your help.

--
Colin Dick
On Call Internet Services
cdick@mail.ocis.net


pgsql-sql by date:

Previous
From: Colin Dick
Date:
Subject: Re: [SQL] isnull function]
Next
From: Kachun Lee
Date:
Subject: Re: [SQL] Date fields and libpq....