Re: Analogue to SQL Server UniqueIdentifier? - Mailing list pgsql-general

From Dave Page
Subject Re: Analogue to SQL Server UniqueIdentifier?
Date
Msg-id 937d27e10802180901x3f7f046dq864ca5dff17d9aaf@mail.gmail.com
Whole thread Raw
In response to Re: Analogue to SQL Server UniqueIdentifier?  (Bill Moran <wmoran@potentialtech.com>)
Responses Re: Analogue to SQL Server UniqueIdentifier?
List pgsql-general
On Feb 18, 2008 4:52 PM, Bill Moran <wmoran@potentialtech.com> wrote:
> In response to "jerry.evans@chordia" <jerry.evans@chordia.co.uk>:
>
>
> > Hi
> >
> > My porting experiment has encountered the SQL Server UniqueIdentifier problem. I can see one or two suggestions
aboutthis have been made over the years but I'd like to try and stay close to the original. So: 
> >
> > I'm wondering if I can use a combination of a domain 'hack' for syntatic compatibillity and an externally
implementedfunction to handle generation. 
> >
> > More specifically, given a table defined thus:
> >
> > CREATE TABLE jazz(
> > UUID UniqueIdentifier DEFAULT newIdentifier(),
> > rootname VARCHAR(255),
> > data_source VARCHAR(1024),
> > date_created DATETIME DEFAULT GETDATE())
> >
> > 1. Can I handle the UniqueIdentifier datatype via a domain that aliases UniqueIdentifier to char(X) (for example) ?
Thisseems to work fine for the DATETIME datatype. 
> > 2. Implement newIdentifier() in some extension DLL that simply calls CoCreateGUID() ?
> >
> > or does uuid-ossp do this for me?
>
> I'm no expert on this topic, but since nobody else has responded ...
>
> I'm unsure why you would do anything other than install uuid-ossp.
> Anything else is going to be a hack, and uuid-ossp was created specifically
> to address this requirement.

Lack of support for Windows, which it sounds like the OP might be running?



--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com
The Oracle-compatible database company

pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: Analogue to SQL Server UniqueIdentifier?
Next
From: "jerry.evans@chordia"
Date:
Subject: Re: Analogue to SQL Server UniqueIdentifier?