Re: why can't plpgsql return a row-expression?

From: Asif Rehman <asifr(dot)rehman(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: why can't plpgsql return a row-expression?
Date: 2012-12-03 19:15:27
Message-ID: CADM=Jeg2nSb-NCDjg98LNYdKPygxR2EZWMrvrQdjYVSizKHsAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thanks for the review. Please see the updated patch.

Hmm. We're running an I/O cast during do_tup_convert() now, and look
> up the required functions for each tuple. I think if we're going to
> support this operation at that level, we need to look up the necessary
> functions at convert_tuples_by_foo level, and then apply unconditionally
> if they've been set up.
>
Done. TupleConversionMap struct should keep the array of functions oid's
that
needs to be applied. Though only for those cases where both attribute type
id's
do not match. This way no unnecessary casting will happen.

> Also, what are the implicancies for existing users of tupconvert? Do we
> want to apply casting during ANALYZE for example? AFAICS the patch
> shouldn't break any case that works today, but I don't see that there
> has been any analysis of this.
>
I believe this part of the code should not impact existing users of
tupconvert.
As this part of code is relaxing a restriction upon which an error would
have been
generated. Though it could have a little impact on performance but should
be only for
cases where attribute type id's are different and are implicitly cast able.

Besides existing users involve tupconvert in case of inheritance. And in
that case
an exact match is expected.

Regards,
--Asif

Attachment Content-Type Size
return_rowtype.v2.patch application/octet-stream 23.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-12-03 19:28:35 Re: pgsql: Add mode where contrib installcheck runs each module in a separa
Previous Message Simon Riggs 2012-12-03 19:02:40 Re: visibilitymap_count() at the end of vacuum