X.50x OID representation

Поиск
Список
Период
Сортировка
От redhog
Тема X.50x OID representation
Дата
Msg-id 1162900663.458206.82470@h48g2000cwc.googlegroups.com
обсуждение исходный текст
Ответы Re: X.50x OID representation  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
I need to save something very similar to X.50x IOD:s, that is, paths
where the path-components are numbers. For example: 10.5.5003.24.35.

Futhermore, I need to sort these in numerical path order, so that if
two paths are compared according to the first path component that
differs, and this path component is compared numerically, so that e.g.
100 is considered greater than 1.

Is there a suitable datatype in PostgreSQL, or some other way to
achieve this? Storing the paths as strings would make path-components
of different length compare wrongly, e.g. "91" would be considered
greater than "900", since the second digit 1 is greater than the second
digit 0.

One possibility is to store the paths as strings but with the digits
within each path component reversed, so that e.g. 4711 becomes 1174.
This would work, given that the path-separator compares less than all
digits, but is rather uggly and requires a bit of nasty rewriting when
updating/inserting/reading rows.

Any ideas?

Thanks in advance,
Egil


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

Предыдущее
От: "William Leite Araújo"
Дата:
Сообщение: Re: FOR ... IN
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: X.50x OID representation