OSDN Git Service

Fix a bunch of problems with domains by making them use special input functions
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 5 Apr 2006 22:11:58 +0000 (22:11 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 5 Apr 2006 22:11:58 +0000 (22:11 +0000)
commit7fdb4305db20f64bce27e6bac0a0f9c972e4dec8
tree18efa90dfcf996675cf1c7bb938d8575f7e551ad
parent89a67e523e744eb168b41d192b83d17a395b4137
Fix a bunch of problems with domains by making them use special input functions
that apply the necessary domain constraint checks immediately.  This fixes
cases where domain constraints went unchecked for statement parameters,
PL function local variables and results, etc.  We can also eliminate existing
special cases for domains in places that had gotten it right, eg COPY.

Also, allow domains over domains (base of a domain is another domain type).
This almost worked before, but was disallowed because the original patch
hadn't gotten it quite right.
20 files changed:
doc/src/sgml/ref/create_domain.sgml
doc/src/sgml/ref/create_type.sgml
src/backend/access/common/printtup.c
src/backend/commands/copy.c
src/backend/commands/typecmds.c
src/backend/optimizer/prep/preptlist.c
src/backend/parser/parse_coerce.c
src/backend/rewrite/rewriteHandler.c
src/backend/rewrite/rewriteManip.c
src/backend/utils/adt/Makefile
src/backend/utils/adt/domains.c [new file with mode: 0644]
src/backend/utils/cache/lsyscache.c
src/include/catalog/catversion.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_type.h
src/include/parser/parse_coerce.h
src/include/utils/builtins.h
src/include/utils/lsyscache.h
src/test/regress/expected/domain.out
src/test/regress/sql/domain.sql