Re: uuid c function contrib - Mailing list pgsql-general

From Ron Peterson
Subject Re: uuid c function contrib
Date
Msg-id 20061018203157.GA1149@yellowbank.com
Whole thread Raw
In response to Re: uuid c function contrib  (Ron Peterson <ron.peterson@yellowbank.com>)
Responses Re: uuid c function contrib  (Ron Peterson <ron.peterson@yellowbank.com>)
List pgsql-general
On Tue, Oct 17, 2006 at 09:07:08PM -0400, Ron Peterson wrote:
> On Tue, Oct 17, 2006 at 03:25:05PM -0400, Ron Peterson wrote:
>
> > I've written some PostgreSQL C functions which expose the functionality
> > of Theodore Ts'o's UUID library.

% select y_uuid_time( y_uuid_generate_time() );
         y_uuid_time
----------------------------
 2006-10-17 20:59:25.101671

My y_uuid_time function returns text.  It would be better to have it
return a timestamp.  What internal functions does PostgreSQL use for
timestamp manipulation?

int64 or maybe float atimestamp
atimestamp = convert_seconds+usecs_since_epoch( somedata )
PG_RETURN_TIMESTAMP( atimestamp )

I'm having a hard time finding any examples of functions returning
timestamps I can study to see how they are handled internally.  I'm sure
it's only a line or two of code.

TIA.

--
Ron Peterson
https://www.yellowbank.com/

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Drop All the Databases
Next
From: Chris Browne
Date:
Subject: Re: Stats Collector Won't Start