Re: Analogue to SQL Server UniqueIdentifier?

Поиск
Список
Период
Сортировка
От Bill Moran
Тема Re: Analogue to SQL Server UniqueIdentifier?
Дата
Msg-id 20080218115204.c3f28b4e.wmoran@potentialtech.com
обсуждение исходный текст
Ответ на Analogue to SQL Server UniqueIdentifier?  ("jerry.evans@chordia" <jerry.evans@chordia.co.uk>)
Ответы Re: Analogue to SQL Server UniqueIdentifier?
Список pgsql-general
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 about
thishave 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 implemented
functionto 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.

Unless, of course, I've misunderstood your question.

--
Bill Moran
http://www.potentialtech.com

В списке pgsql-general по дате отправления:

Предыдущее
От: "fdu.xiaojf@gmail.com"
Дата:
Сообщение: questions about very large table and partitioning
Следующее
От: "Dave Page"
Дата:
Сообщение: Re: Analogue to SQL Server UniqueIdentifier?