Re: proposal: plpgsql - iteration over fields of rec or row variable - Mailing list pgsql-hackers

From Dmitriy Igrishin
Subject Re: proposal: plpgsql - iteration over fields of rec or row variable
Date
Msg-id AANLkTin5D71H_n1setvOrQ+1RuA-WRZa0gUWiVZjOvDA@mail.gmail.com
Whole thread Raw
In response to Re: proposal: plpgsql - iteration over fields of rec or row variable  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
Merlin,

Sorry, I don't clearly understand what the problem here, but I just want to avoid
conversion from record to hstore with suggested API. I am currently happy with
hstore API to work with record. From the user's point of view :-).

2010/11/8 Merlin Moncure <mmoncure@gmail.com>
On Mon, Nov 8, 2010 at 3:02 PM, Dmitriy Igrishin <dmitigr@gmail.com> wrote:
> Hey Pavel, Tom, Merlin,
>
> As a user, I would like to work with records by using simple API:
>
>   -- Returns a number of key/values pairs of record.
>   nKeys_ integer := nRecordKeys(NEW);
>
>   -- Returns an i-th key.
>   key_i text := recordKey(NEW, i);
>
>   -- Returns an i-th value.
>   value1_ text := recordValueByIndex(NEW, i);
>
>   -- Returns an value by named key.
>   value2_ text := recordValueByName(NEW, "id");
>
> and so on...

This doesn't really solve the problem -- you need some participation
from plpgsql because function behavior post-plan time can not be
ambiguous.

merlin



--
// Dmitriy.


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql - iteration over fields of rec or row variable
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql - iteration over fields of rec or row variable