Обсуждение: Не ошибка ли это в HSTORE?
$ psql psql (9.1.1) Type "help" for help. ano=# SELECT 'rr=>r, qq=>w, rr=>0'::hstore; hstore ---------------------- "qq"=>"w", "rr"=>"r" (1 row) То есть, в строке два одинаковых ключа. Функция преобразования из текста в hstore взяла первое значение. Это ожидаемое поведение, или ошибка?
Приветствую,
// Dmitriy.
2 декабря 2011 г. 18:30 пользователь Andrey N. Oktyabrski <ano@bestmx.ru> написал:
-- $ psql
psql (9.1.1)
Type "help" for help.
ano=# SELECT 'rr=>r, qq=>w, rr=>0'::hstore;
hstore
----------------------
"qq"=>"w", "rr"=>"r"
(1 row)
То есть, в строке два одинаковых ключа. Функция преобразования из текста в hstore взяла первое значение.
Это ожидаемое поведение, или ошибка?
Неужели трудно открыть документацию?
Цитирую "Each key in an hstore is unique. If you declare an hstore with duplicate keys, only one will be stored in the hstore and there is no guarantee as to which will be kept..."
http://www.postgresql.org/docs/9.1/static/hstore.html
Цитирую "Each key in an hstore is unique. If you declare an hstore with duplicate keys, only one will be stored in the hstore and there is no guarantee as to which will be kept..."
http://www.postgresql.org/docs/9.1/static/hstore.html
// Dmitriy.