How to dereference 2 dimensional array?

Поиск
Список
Период
Сортировка
От ChoonSoo Park
Тема How to dereference 2 dimensional array?
Дата
Msg-id CACgbiFt=S+bScUv3OLXhVeToWrGcjJ74vYZ85tqW9X6g0-OPSg@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to dereference 2 dimensional array?  (Bartosz Dmytrak <bdmytrak@eranet.pl>)
Re: How to dereference 2 dimensional array?  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general

I would like to construct hstore array from 2 dimensional array.


For example, 


'{{f1, 1, f2, 123, f3, ABC, ...}, {f1, 2, f2, 345, f3, DEF, ...}}'


Should be converted to


2 hstore values

"f1"=>"1", "f2"=>"123", "f3"=>"ABC", ...

"f2"=>"2", "f2"=>"345", "f3"=>"DEF", ...


create or replace function convertHStore(p1 text[][]) RETURNS hstore[]


hstore function requires text[] to convert array to hstore. Therefore I should be able to dereference 2 dimensional array element.

Inside this custom plpgsql function, p1[1] is not valid syntax to dereference the 1st element in p1.


Anyone knows how to solve this problem?


Thank you,

Choon Park 

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

Предыдущее
От: Vojtěch Rylko
Дата:
Сообщение: Re: Drop big index
Следующее
От: "Musial, Jan (GIUB)"
Дата:
Сообщение: Re: Dynamic update of a date field