Re: UUID's as primary keys
От | Martijn van Oosterhout |
---|---|
Тема | Re: UUID's as primary keys |
Дата | |
Msg-id | 20060628083951.GC29253@svana.org обсуждение исходный текст |
Ответ на | Re: UUID's as primary keys (Thomas Hallgren <thomas@tada.se>) |
Ответы |
Re: UUID's as primary keys
|
Список | pgsql-general |
On Wed, Jun 28, 2006 at 10:22:45AM +0200, Thomas Hallgren wrote: > Thanks. That would of course work but at the same time it increases the > complexity of my app. Yet another component to install and keep track > of. It's also a bit of an overkill since the only thing I need is an > opaque bit storage. Why is it that PostgreSQL lack a fixed length binary > type similar to the RAW type in Oracle? ISTM that could be very useful > and not very hard to implement. AIUI, it can't be done because of a basic rule of the type system: the typmod can't be necessary to interpret the binary representation of a value. For something like RAW(16) the type would be the oid for "raw" and the typmod would be 16. However, when reading the value from a disk page, you're not given the typmod, so you have no way of determining the length. That's why there is a verlena header for types where you don't know the length, which adds overhead. The alternative is to create a type of the exact length you want, but in your case that's not acceptable either. I'm not sure if there are any other alternatives. Have a ncie day, -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.
Вложения
В списке pgsql-general по дате отправления: