Identifying no-op length coercions

Поиск
Список
Период
Сортировка
От Noah Misch
Тема Identifying no-op length coercions
Дата
Msg-id 20110523164234.GA14758@tornado.gateway.2wire.net
обсуждение исходный текст
Ответы Re: Identifying no-op length coercions
Список pgsql-hackers
I'd like to revive the discussion that arose during the last CommitFest over
the proper design for identifying no-op length coercions like varchar(4) ->
varchar(8).  Here is the root of the original debate:
 http://archives.postgresql.org/message-id/20110109220353.GD5777@tornado.leadboat.com

There were two proposals on the table:

1. Attach a "f(from_typmod, to_typmod, is_explicit) RETURNS boolean" function  to the pg_cast; call it in
find_coercion_pathway()
2. Attach a "f(FuncExpr) RETURNS Expr" (actually internal/internal) function  to the pg_proc; call it in
simplify_function()

I tried and failed to write a summary of the respective arguments that could
legitimately substitute for (re-)reading the original thread, so I haven't
included one.  I myself find the advantages of #2 mildly more compelling.

As previously noted, if we enrich the typmod system, only #1 will require
interface changes.  One of the suggestions that came up before was designing
the typmod enrichment before designing this.  Unless someone has short-term
plans to prepare that design, I'd like to avoid serializing on it -- it may
never happen.  One thought: if #1 proves preferable independent of this
concern, should we consider implementing it without documenting it or exposing
it at the SQL level?  External type developers could still directly update
pg_cast, so long as they'll be happy to keep both pieces if we someday change
the required function signature.

Can we reach a design that nobody dislikes excessively?

Thanks,
nm


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: SSI predicate locking on heap -- tuple or row?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Identifying no-op length coercions