Re: Opinion wanted on UUID/GUID datatype output formats.
От | Josh Berkus |
---|---|
Тема | Re: Opinion wanted on UUID/GUID datatype output formats. |
Дата | |
Msg-id | 200609141402.45084.josh@agliodbs.com обсуждение исходный текст |
Ответ на | Opinion wanted on UUID/GUID datatype output formats. (Gevik Babakhani <pgdev@xs4all.nl>) |
Список | pgsql-hackers |
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
В списке pgsql-hackers по дате отправления: