Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5ea9322

Browse files
committed
Cast functions can be immutable or stable.
1 parentdb4f3c0 commit5ea9322

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎doc/src/sgml/ref/create_cast.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_cast.sgml,v 1.3 2002/09/01 02:37:02 tgl Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_cast.sgml,v 1.4 2002/09/15 13:04:16 petere Exp $ -->
22

33
<refentry id="SQL-CREATECAST">
44
<refmeta>
@@ -117,7 +117,7 @@ INSERT INTO foo(f1) VALUES(42);
117117
be schema-qualified. If it is not, the function will be looked
118118
up in the path. The argument type must be identical to the
119119
source type, the result data type must match the target type of
120-
the cast. Cast functions must be marked immutable.
120+
the cast. Cast functions must be marked immutable or stable.
121121
</para>
122122
</listitem>
123123
</varlistentry>

‎src/backend/commands/functioncmds.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.19 2002/09/04 20:31:15 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.20 2002/09/15 13:04:16 petere Exp $
1313
*
1414
* DESCRIPTION
1515
* These routines take the parse tree and pick out the
@@ -676,8 +676,8 @@ CreateCast(CreateCastStmt *stmt)
676676
elog(ERROR,"argument of cast function must match source data type");
677677
if (procstruct->prorettype!=targettypeid)
678678
elog(ERROR,"return data type of cast function must match target data type");
679-
if (procstruct->provolatile!=PROVOLATILE_IMMUTABLE)
680-
elog(ERROR,"cast function must beimmutable");
679+
if (procstruct->provolatile==PROVOLATILE_VOLATILE)
680+
elog(ERROR,"cast function mustnotbevolatile");
681681
if (procstruct->proisagg)
682682
elog(ERROR,"cast function must not be an aggregate function");
683683
if (procstruct->proretset)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp