Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
От | Corey Huinker |
---|---|
Тема | Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions |
Дата | |
Msg-id | CADkLM=chahh6ddZFjLL6AUdqzL_Px0raTu-5Jzn2WN8yELtmJw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions (jian he <jian.universality@gmail.com>) |
Ответы |
Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions
|
Список | pgsql-hackers |
In the end, it seems we need to make all these functions in the below
query error safe.
select castsource::regtype, casttarget::regtype, castfunc,
castcontext,castmethod, pp.prosrc, pp.proname from pg_cast pc join pg_proc pp on
pp.oid = pc.castfunc and pc.castfunc > 0
order by castsource::regtype;
It's a lot of work, but seems doable, after playing around with it.
It is do-able. But that's just the cast functions that are part of core postgres.
I don't think we need to change the pg_cast catalog entry,
we just need to make these function (pg_cast.castmethod) errors safe.
That would break any user-defined cast functions that were not also error safe, which is to say all of them.
We need a way for user-defined cast functions to indicate whether or not they are error safe, and handle both situations accordingly (i.e. fail a CAST ON DEFAULT when the user-defined cast is not error-safe).
В списке pgsql-hackers по дате отправления: