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.gd5...@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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers