Allow the syntax CREATE TYPE foo, with no parameters, to permit explicit
Tom Lane <tgl@sss.pgh.pa.us>
Allow the syntax CREATE TYPE foo, with no parameters, to permit explicit creation of a shell type. This allows a less hacky way of dealing with the mutual dependency between a datatype and its I/O functions: make a shell type, then make the functions, then define the datatype fully. We should fix pg_dump to handle things this way, but this commit just deals with the backend. Martijn van Oosterhout, with some corrections by Tom Lane.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/create_type.sgml | modified | +37 −15 |
| doc/src/sgml/xtypes.sgml | modified | +12 −9 |
| src/backend/catalog/pg_type.c | modified | +43 −31 |
| src/backend/commands/typecmds.c | modified | +32 −17 |
| src/backend/parser/gram.y | modified | +10 −1 |
| src/backend/utils/adt/pseudotypes.c | modified | +27 −1 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_operator.h | modified | +3 −3 |
| src/include/catalog/pg_proc.h | modified | +6 −2 |
| src/include/utils/builtins.h | modified | +3 −1 |
| src/test/regress/expected/create_type.out | modified | +24 −4 |
| src/test/regress/sql/create_type.sql | modified | +21 −0 |