Tweak the API for per-datatype typmodin functions so that they are passed
Tom Lane <tgl@sss.pgh.pa.us>
Tweak the API for per-datatype typmodin functions so that they are passed an array of strings rather than an array of integers, and allow any simple constant or identifier to be used in typmods; for example create table foo (f1 widget(42,'23skidoo',point)); Of course the typmodin function has still got to pack this info into a non-negative int32 for storage, but it's still a useful improvement in flexibility, especially considering that you can do nearly anything if you are willing to keep the info in a side table. We can get away with this change since we have not yet released a version providing user-definable typmods. Per discussion.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/create_type.sgml | modified | +5 −5 |
| src/backend/commands/typecmds.c | modified | +3 −3 |
| src/backend/parser/gram.y | modified | +2 −2 |
| src/backend/parser/parse_type.c | modified | +39 −12 |
| src/backend/utils/adt/arrayutils.c | modified | +25 −8 |
| src/backend/utils/adt/date.c | modified | +2 −2 |
| src/backend/utils/adt/numeric.c | modified | +2 −2 |
| src/backend/utils/adt/timestamp.c | modified | +3 −3 |
| src/backend/utils/adt/varbit.c | modified | +2 −2 |
| src/backend/utils/adt/varchar.c | modified | +2 −2 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_proc.h | modified | +11 −11 |
| src/include/catalog/pg_type.h | modified | +11 −4 |
| src/include/utils/array.h | modified | +2 −2 |
| src/test/regress/expected/type_sanity.out | modified | +1 −1 |
| src/test/regress/sql/type_sanity.sql | modified | +1 −1 |