Re: Dyamic updates of NEW with pl/pgsql

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Dyamic updates of NEW with pl/pgsql
Дата
Msg-id b42b73151003150914j4156915q7c24833af49fda1e@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Dyamic updates of NEW with pl/pgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Dyamic updates of NEW with pl/pgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Ragged latency log data in multi-threaded pgbench
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Dyamic updates of NEW with pl/pgsql