Search Postgresql Archives

Re: uuid c function contrib

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux