Re: [HACKERS] plpgsql, return can contains any expression

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: bruce(at)momjian(dot)us, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org, neilc(at)samurai(dot)com
Subject: Re: [HACKERS] plpgsql, return can contains any expression
Date: 2007-02-09 15:01:17
Message-ID: 20070209150117.GD4253@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Pavel Stehule wrote:

> >OK, where are we on this patch?
>
> without changes. This task have to do anybody who better know PostgreSQL
> cache system than me.

How about you submit a version without any caching, but which works
correctly; and we worry about optimizations later?

> >---------------------------------------------------------------------------
> >
> >Pavel Stehule wrote:
> >>
> >>
> >> >
> >> >"Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com> writes:
> >> > >> This patch doesn't seem to cope with cases where the supplied tuple
> >has
> >> > >> the wrong number of columns, and it doesn't look like it's being
> >> >careful
> >> > >> about dropped columns either. Also, that's a mighty
> >bizarre-looking
> >> > >> choice of cache memory context in coerce_to_tuple ... but then
> >again,
> >> > >> why are you bothering with a cache at all for temporary arrays?
> >> >
> >> > > I am sorry, Tom. But I don't understand. I can check number of
> >columns,
> >> > > ofcourse and I'll do it. What cache for temporary arrays do you
> >mean?
> >> >
> >> >I thought that making coerce_to_tuple depend on estate->err_func was
> >> >pretty bizarre, and that there was no need for any "cache" at all for
> >> >arrays that need only live as long as the function runs. All you are
> >> >saving here is a palloc/pfree cycle, which is not worth the
> >obscurantism
> >> >and risk of bugs (are you sure natts can never change?).
> >>
> >> No, cache there is ugly. But I don't have idea about more efective
> >> implementation of it :-(. First version of this patch was more clean.
> >and
> >> little bit slow. This cache save 10%.
> >>
> >> >
> >> >BTW, if you want this patch to make it into 8.2, it needs to be fixed
> >> >and resubmitted *very* soon.
> >>
> >> I understand, but I am not able work on it in next four days. And I need
> >> help with it from Neil. It will be for 8.3.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-02-09 15:02:09 Re: Proposal: TABLE functions
Previous Message Magnus Hagander 2007-02-09 14:55:20 Re: [PATCHES] How can I use 2GB of shared buffers on Windows?

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2007-02-09 15:14:01 Re: \prompt for psql
Previous Message Magnus Hagander 2007-02-09 14:55:20 Re: [PATCHES] How can I use 2GB of shared buffers on Windows?