提交 3c49c4b1 编写于 作者: T Tom Lane

Mark the float8 -> int8 cast as implicit. This resolves the problem

pointed out by Barry Lind: UPDATE bigintcol = 10000000000 fails because
the constant is initially taken as float8.  We really need a better way,
but it's not gonna happen for 7.3.

Also, remove int4reltime() function, which is redundant with the
existing binary-compatibility coercion path from int4 to reltime,
and probably has been unreachable code for a long while.
上级 845a6c3a
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.96 2002/08/04 06:44:47 thomas Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.97 2002/09/01 00:58:06 tgl Exp $
* *
* NOTES * NOTES
* *
...@@ -1735,15 +1735,6 @@ istinterval(char *i_string, ...@@ -1735,15 +1735,6 @@ istinterval(char *i_string,
* *
*****************************************************************************/ *****************************************************************************/
Datum
int4reltime(PG_FUNCTION_ARGS)
{
int32 timevalue = PG_GETARG_INT32(0);
/* Just coerce it directly to RelativeTime ... */
PG_RETURN_RELATIVETIME((RelativeTime) timevalue);
}
/* /*
* timeofday - * timeofday -
* returns the current time as a text. similar to timenow() but returns * returns the current time as a text. similar to timenow() but returns
......
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
* *
* $Header: /cvsroot/pgsql/src/include/catalog/pg_cast.h,v 1.1 2002/07/18 23:11:30 petere Exp $ * pg_cast.h
* definition of the system "type casts" relation (pg_cast)
* along with the relation's initial contents.
*
* *
* Copyright (c) 2002, PostgreSQL Global Development Group * Copyright (c) 2002, PostgreSQL Global Development Group
* *
* $Id: pg_cast.h,v 1.2 2002/09/01 00:58:06 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
* information from the DATA() statements.
*
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
#ifndef PG_CAST_H #ifndef PG_CAST_H
...@@ -11,10 +20,10 @@ ...@@ -11,10 +20,10 @@
CATALOG(pg_cast) CATALOG(pg_cast)
{ {
Oid castsource; Oid castsource; /* source datatype for cast */
Oid casttarget; Oid casttarget; /* destination datatype for cast */
Oid castfunc; /* 0 = binary compatible */ Oid castfunc; /* 0 = binary compatible */
bool castimplicit; bool castimplicit; /* allow implicit casting? */
} FormData_pg_cast; } FormData_pg_cast;
typedef FormData_pg_cast *Form_pg_cast; typedef FormData_pg_cast *Form_pg_cast;
...@@ -115,7 +124,10 @@ DATA(insert ( 1562 1560 0 t )); ...@@ -115,7 +124,10 @@ DATA(insert ( 1562 1560 0 t ));
* This list can be obtained from the following query as long as the * This list can be obtained from the following query as long as the
* naming convention of the cast functions remains the same: * naming convention of the cast functions remains the same:
* *
* select p.proargtypes[0] as source, p.prorettype as target, p.oid as func, p.proimplicit as implicit from pg_proc p, pg_type t where p.pronargs=1 and p.proname = t.typname and p.prorettype = t.oid order by 1, 2; * select p.proargtypes[0] as source, p.prorettype as target, p.oid as func,
* p.proimplicit as implicit
* from pg_proc p, pg_type t where p.pronargs=1 and p.proname = t.typname
* and p.prorettype = t.oid order by 1, 2;
*/ */
DATA(insert ( 18 25 946 t )); DATA(insert ( 18 25 946 t ));
DATA(insert ( 18 1042 860 t )); DATA(insert ( 18 1042 860 t ));
...@@ -139,7 +151,6 @@ DATA(insert ( 23 21 314 t )); ...@@ -139,7 +151,6 @@ DATA(insert ( 23 21 314 t ));
DATA(insert ( 23 25 112 t )); DATA(insert ( 23 25 112 t ));
DATA(insert ( 23 700 318 t )); DATA(insert ( 23 700 318 t ));
DATA(insert ( 23 701 316 t )); DATA(insert ( 23 701 316 t ));
/*xDATA(insert ( 23 703 1200 f ));*/
DATA(insert ( 23 1043 1619 f )); DATA(insert ( 23 1043 1619 f ));
DATA(insert ( 23 1700 1740 t )); DATA(insert ( 23 1700 1740 t ));
DATA(insert ( 25 18 944 t )); DATA(insert ( 25 18 944 t ));
...@@ -159,7 +170,7 @@ DATA(insert ( 25 1114 2022 f )); ...@@ -159,7 +170,7 @@ DATA(insert ( 25 1114 2022 f ));
DATA(insert ( 25 1184 1191 f )); DATA(insert ( 25 1184 1191 f ));
DATA(insert ( 25 1186 1263 f )); DATA(insert ( 25 1186 1263 f ));
DATA(insert ( 25 1266 938 f )); DATA(insert ( 25 1266 938 f ));
DATA(insert ( 26 25 114 f )); DATA(insert ( 26 25 114 t ));
DATA(insert ( 601 600 1532 f )); DATA(insert ( 601 600 1532 f ));
DATA(insert ( 602 600 1533 f )); DATA(insert ( 602 600 1533 f ));
DATA(insert ( 602 604 1449 f )); DATA(insert ( 602 604 1449 f ));
...@@ -176,7 +187,7 @@ DATA(insert ( 700 23 319 f )); ...@@ -176,7 +187,7 @@ DATA(insert ( 700 23 319 f ));
DATA(insert ( 700 25 841 t )); DATA(insert ( 700 25 841 t ));
DATA(insert ( 700 701 311 t )); DATA(insert ( 700 701 311 t ));
DATA(insert ( 700 1700 1742 t )); DATA(insert ( 700 1700 1742 t ));
DATA(insert ( 701 20 483 f )); DATA(insert ( 701 20 483 t ));
DATA(insert ( 701 21 237 f )); DATA(insert ( 701 21 237 f ));
DATA(insert ( 701 23 317 f )); DATA(insert ( 701 23 317 f ));
DATA(insert ( 701 25 840 t )); DATA(insert ( 701 25 840 t ));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pg_proc.h,v 1.266 2002/08/27 04:00:28 momjian Exp $ * $Id: pg_proc.h,v 1.267 2002/09/01 00:58:06 tgl Exp $
* *
* NOTES * NOTES
* The script catalog/genbki.sh reads this file and generates .bki * The script catalog/genbki.sh reads this file and generates .bki
...@@ -1479,9 +1479,6 @@ DESCR("date difference preserving months and years"); ...@@ -1479,9 +1479,6 @@ DESCR("date difference preserving months and years");
/* OIDS 1200 - 1299 */ /* OIDS 1200 - 1299 */
DATA(insert OID = 1200 ( reltime PGNSP PGUID 12 f f t f i 1 703 "23" int4reltime - _null_ ));
DESCR("convert int4 to reltime");
DATA(insert OID = 1215 ( obj_description PGNSP PGUID 14 f f t f s 2 25 "26 19" "select description from pg_description where objoid = $1 and classoid = (select oid from pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0" - _null_ )); DATA(insert OID = 1215 ( obj_description PGNSP PGUID 14 f f t f s 2 25 "26 19" "select description from pg_description where objoid = $1 and classoid = (select oid from pg_class where relname = $2 and relnamespace = PGNSP) and objsubid = 0" - _null_ ));
DESCR("get description for object id and catalog name"); DESCR("get description for object id and catalog name");
DATA(insert OID = 1216 ( col_description PGNSP PGUID 14 f f t f s 2 25 "26 23" "select description from pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::regclass and objsubid = $2" - _null_ )); DATA(insert OID = 1216 ( col_description PGNSP PGUID 14 f f t f s 2 25 "26 23" "select description from pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::regclass and objsubid = $2" - _null_ ));
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: nabstime.h,v 1.36 2002/06/20 20:29:53 momjian Exp $ * $Id: nabstime.h,v 1.37 2002/09/01 00:58:07 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -152,7 +152,6 @@ extern Datum tintervalct(PG_FUNCTION_ARGS); ...@@ -152,7 +152,6 @@ extern Datum tintervalct(PG_FUNCTION_ARGS);
extern Datum tintervalov(PG_FUNCTION_ARGS); extern Datum tintervalov(PG_FUNCTION_ARGS);
extern Datum tintervalstart(PG_FUNCTION_ARGS); extern Datum tintervalstart(PG_FUNCTION_ARGS);
extern Datum tintervalend(PG_FUNCTION_ARGS); extern Datum tintervalend(PG_FUNCTION_ARGS);
extern Datum int4reltime(PG_FUNCTION_ARGS);
extern Datum timeofday(PG_FUNCTION_ARGS); extern Datum timeofday(PG_FUNCTION_ARGS);
/* non-fmgr-callable support routines */ /* non-fmgr-callable support routines */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册