aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/functioncmds.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-02-01 22:09:26 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-02-01 22:09:26 +0000
commit6ba8af9d5d5d746069a506979f7163dced0302b7 (patch)
tree8f2b44ed95a731bcdd844b5a9497e19f15db1086 /src/backend/commands/functioncmds.c
parente0a1ee205333ea83604dd3a042f5c53cfc759b9d (diff)
downloadpostgresql-6ba8af9d5d5d746069a506979f7163dced0302b7.tar.gz
postgresql-6ba8af9d5d5d746069a506979f7163dced0302b7.zip
Remove restriction that cast functions cannot be volatile. This
restriction was debatable to begin with, but it has now become obvious that it breaks forward-porting of user-defined types; contrib/lo being the most salient example.
Diffstat (limited to 'src/backend/commands/functioncmds.c')
-rw-r--r--src/backend/commands/functioncmds.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c
index 2e660d7f61a..a0943993c16 100644
--- a/src/backend/commands/functioncmds.c
+++ b/src/backend/commands/functioncmds.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.24 2002/11/01 19:19:58 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.25 2003/02/01 22:09:26 tgl Exp $
*
* DESCRIPTION
* These routines take the parse tree and pick out the
@@ -745,8 +745,15 @@ CreateCast(CreateCastStmt *stmt)
elog(ERROR, "argument of cast function must match source data type");
if (procstruct->prorettype != targettypeid)
elog(ERROR, "return data type of cast function must match target data type");
+ /*
+ * Restricting the volatility of a cast function may or may not be
+ * a good idea in the abstract, but it definitely breaks many old
+ * user-defined types. Disable this check --- tgl 2/1/03
+ */
+#ifdef NOT_USED
if (procstruct->provolatile == PROVOLATILE_VOLATILE)
elog(ERROR, "cast function must not be volatile");
+#endif
if (procstruct->proisagg)
elog(ERROR, "cast function must not be an aggregate function");
if (procstruct->proretset)