Re: Dyamic updates of NEW with pl/pgsql - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: Dyamic updates of NEW with pl/pgsql
Date
Msg-id b42b73151003150914j4156915q7c24833af49fda1e@mail.gmail.com
Whole thread Raw
In response to Re: Dyamic updates of NEW with pl/pgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Dyamic updates of NEW with pl/pgsql
List pgsql-hackers
On Mon, Mar 15, 2010 at 11:37 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> If we make the implementation be such that "(rec->field)::foo" forces
a runtime cast to foo (rather than throwing an error if it's not type
foo already)

yeah...explicit cast should always do 'best effort'

> The cost of looking up the ever-changing cast function could still be
> unpleasant, although I think we could hide it in the executor expression
> node instead of forcing a whole new parse/plan cycle each time.

right. if you do that, it's still going to be faster than the
dyna-sql/information schema/perl hacks people are doing right now
(assuming they didn't give up and code it in the app).  This is rtti
for plpgsql, and functions that use it are going have to be understood
as being slower and to be avoided if possible, like exception
handlers.  IMNSHO, this is a small price to pay.

merlin


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Ragged latency log data in multi-threaded pgbench
Next
From: Tom Lane
Date:
Subject: Re: Dyamic updates of NEW with pl/pgsql