Re: proposal: plpgsql - iteration over fields of rec or row variable
От | Dmitriy Igrishin |
---|---|
Тема | Re: proposal: plpgsql - iteration over fields of rec or row variable |
Дата | |
Msg-id | AANLkTin-Aic5+kZ0q2Tjeyaea9_tD6rwm7yKZdgCFPfL@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: proposal: plpgsql - iteration over fields of rec or row variable (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: proposal: plpgsql - iteration over fields of rec or row variable
|
Список | pgsql-hackers |
Hey Pavel,
--
// Dmitriy.
2010/11/9 Pavel Stehule <pavel.stehule@gmail.com>
> a) transformation to common typeI thinking about some simple API, that can be based on transformation
>
> + simple - it is one day job - function record_to_array,
> array_to_record, and fieldnames_to_array
> - lost of type info, hidden problems with IO cast - int a := 10.0/2.0
> is a problem
>
> using a plperl, pltcl is same like @a
>
to text. It can be enough for almost all.
* text[] = record_to_array(record)
* table(id, key, datatype, value) = record_to_table(record)
* text = record_get_field(record, text)
* record = record_set_field(record, text, anyelement)
??
I personally like it. But I propose to add as well:
integer := record_nkeys();
text := record_get_field(record, integer);
integer := record_nkeys();
text := record_get_field(record, integer);
Pavel
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
--
// Dmitriy.
В списке pgsql-hackers по дате отправления: