Name/Value array to table row

Поиск
Список
Период
Сортировка
От Michael Moore
Тема Name/Value array to table row
Дата
Msg-id CACpWLjPr70JnLO76v66oMyo=-Cdk7SxkDGwO5fh4w1uRKPmp4A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Name/Value array to table row  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-sql
I have an array that is a name value pair where the name is the name of a column in a table. There are about 300 columns. I want to use all of the name value pairs to construct the table row. I've thought about using jsonb or hstore. I'm sure I could write some ugly code to do this, but what is the BEST way to go about this?
I.E 
ARRAY
name |value
-----------
animal | 'cat'
lbs      | 20

create table animals (animal text, lbs number);
thanks,
Mike

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

Предыдущее
От: Hector Vass
Дата:
Сообщение: Re: regexp_replace question/suggestions needed
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Name/Value array to table row