1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-02 23:42:46 +03:00

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.
This commit is contained in:
Tom Lane
2006-02-28 22:37:27 +00:00
parent 7f19339cca
commit 8e68d78390
12 changed files with 220 additions and 86 deletions

View File

@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/pseudotypes.c,v 1.15 2004/12/31 22:01:22 pgsql Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/pseudotypes.c,v 1.16 2006/02/28 22:37:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -321,3 +321,29 @@ anyelement_out(PG_FUNCTION_ARGS)
PG_RETURN_VOID(); /* keep compiler quiet */
}
/*
* shell_in - input routine for "shell" types (those not yet filled in).
*/
Datum
shell_in(PG_FUNCTION_ARGS)
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot accept a value of a shell type")));
PG_RETURN_VOID(); /* keep compiler quiet */
}
/*
* shell_out - output routine for "shell" types.
*/
Datum
shell_out(PG_FUNCTION_ARGS)
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("cannot display a value of a shell type")));
PG_RETURN_VOID(); /* keep compiler quiet */
}