cant get what I want from array_to_json (simple)

Поиск
Список
Период
Сортировка
От Michael Moore
Тема cant get what I want from array_to_json (simple)
Дата
Msg-id CACpWLjOpxfWyJOOPZ6uDYMvfVWYzfZrhdHuoqXTACbWJd04B_A@mail.gmail.com
обсуждение исходный текст
Ответы Re: cant get what I want from array_to_json (simple)  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-sql
CREATE TYPE key_value_pair AS
   (key text,
    value text);

DO $$declare
   arr qsn_app.key_value_pair[]; 
   pcolumn_values_i json;
begin
  arr[0]  := ('this','that');
  arr[1]  := ('another','one');
  pcolumn_values_i := array_to_json( arr );
  RAISE NOTICE '#1 %', pcolumn_values_i;
end$$;

the 'NOTICE' shows:
NOTICE:  #1 [{"key":"this","value":"that"},{"key":"another","value":"one"}]
what I want to see is:
NOTICE:  #1 {"this":"that","another":"one"}

TIA,
Mike

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

Предыдущее
От: Michael Moore
Дата:
Сообщение: Re: Name/Value array to table row
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: cant get what I want from array_to_json (simple)