Gevik,

> select format_uuid(mypk,'format3') from tbluuid;
> and then get: {6b13c5a1-afb4-dcf5-ce8f-8b4656b6c93c}
> (which would be MSSQL compatible)

> What do the PostgreSQL masters think? :)

There are no masters here.   Except in replication.

I think that we should have a formatting function, but it should be developer 
defined rather than pre-set, like to_char is. For example, instead of:

> select format_uuid(mypk,'format3') from tbluuid;
> and then get: {6b13c5a1-afb4-dcf5-ce8f-8b4656b6c93c}

Have:

select format_uuid(mypk,'HHHHHH-HHHH-HHHH-HHHH-HHHHHHHHHHH')
... to get the same result.   Or you could even support regexes:

select format_uuid(mypk,'[0-9a-f]{6}-[0-9a-f]{6}-[0-9a-f]{6}-[0-9a-f]{6}')

... but something which allows the definition of "ad-hoc" formating masks so 
that we can cover compatibility with products of which we're not yet aware.

-- 
Josh Berkus
PostgreSQL @ Sun
San Francisco

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to