You probably want to use
select date_part('epoch', timeval);
On 22 Jun 2001 pierre@kahuna.versions.com wrote:
> All,
>   Perhaps I'm not sing hte correct datatype, but I'd like to be able to convert 
> a timestamp over to an unsigned long to be used within C code and compare
> to the output of time().
> 
>  I can't seem to see any easy way of doing this using the built in
> stuff for postgresql.
> 
>   Ideas?
> 
>   Perhaps I'm using the wrong type?
> 
>  Pierre
> 
>