You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This is the last major omission in our domains feature: you can nowmake a domain over anything that's not a pseudotype.The major complication from an implementation standpoint is that placesthat might be creating tuples of a domain type now need to be preparedto apply domain_check(). It seems better that unprepared code failwith an error like "<type> is not composite" than that it silently failto apply domain constraints. Therefore, relevant infrastructure likeget_func_result_type() and lookup_rowtype_tupdesc() has been adjustedto treat domain-over-composite as a distinct case that unprepared codewon't recognize, rather than just transparently treating it the sameas plain composite. This isn't a 100% solution to the possibility ofoverlooked domain checks, but it catches most places.In passing, improve typcache.c's support for domains (it can now cachethe identity of a domain's base type), and rewrite the argument handlinglogic in jsonfuncs.c's populate_record[set]_worker to reduce duplicativeper-call lookups.I believe this is code-complete so far as the core and contrib code go.The PLs need varying amounts of work, which will be tackled in followuppatches.Discussion:https://postgr.es/m/4206.1499798337@sss.pgh.pa.us