Re: plpgsql doesn't supply typmod for the Params it generates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: plpgsql doesn't supply typmod for the Params it generates
Date: 2011-05-12 21:55:20
Message-ID: 10995.1305237320@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I think the appropriate fix is pretty clear: add a function similar to
> exec_get_datum_type that returns the datum's typmod, and use that to set
> paramtypmod properly. What is worrying me is that it's not clear how
> much user-visible behavioral change will result, and therefore I'm not
> entirely comfortable with the idea of back-patching such a change into
> 9.0 --- and it wouldn't work at all in 8.4, where there simply isn't a
> good opportunity to set a typmod for parameters passed to the main
> executor (since the SPI interfaces plpgsql uses don't support that).

Attached is a proposed patch for HEAD that sets up the Param's typmod
sanely. I've verified that this fixes the reported problem and does not
result in any changes in the regression tests, which makes me a bit more
optimistic about it ... but I'm still not convinced it'd be a good idea
to back-patch into 9.0.

regards, tom lane

Attachment Content-Type Size
plpgsql-provide-typmod.patch text/x-patch 6.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexey Klyukin 2011-05-12 22:09:16 'tuple concurrently updated' error for alter role ... set
Previous Message David E. Wheeler 2011-05-12 21:46:14 Contrib Versions