Re: uuid c function contrib

From: Ron Peterson <ron(dot)peterson(at)yellowbank(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: uuid c function contrib
Date: 2006-10-18 20:31:57
Message-ID: 20061018203157.GA1149@yellowbank.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2006-10-18 20:32:09 Re: Drop All the Databases
Previous Message George Pavlov 2006-10-18 20:22:52 Re: [GENERAL] query log corrupted-looking entries