Re: proposal: plpgsql - iteration over fields of rec or row variable

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql - iteration over fields of rec or row variable
Date: 2010-11-09 07:01:05
Message-ID: AANLkTin1F0FW1hXjnRcc5x3KTfeAzs63NUaReH1XRM2y@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> a) transformation to common type
>
> + 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
>

I thinking about some simple API, that can be based on transformation
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)

??

Pavel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2010-11-09 08:12:06 Re: Query Plan Columns
Previous Message Jeremy Drake 2010-11-09 06:14:28 Re: [Pgbuildfarm-members] Buildfarm client version 4.3 released