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

Commit3c49c4b

Browse files
committed
Mark the float8 -> int8 cast as implicit. This resolves the problem
pointed out by Barry Lind: UPDATE bigintcol = 10000000000 fails becausethe 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 theexisting binary-compatibility coercion path from int4 to reltime,and probably has been unreachable code for a long while.
1 parent845a6c3 commit3c49c4b

File tree

4 files changed

+22
-24
lines changed

4 files changed

+22
-24
lines changed

‎src/backend/utils/adt/nabstime.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.96 2002/08/04 06:44:47 thomas Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.97 2002/09/01 00:58:06 tgl Exp $
1313
*
1414
* NOTES
1515
*
@@ -1735,15 +1735,6 @@ istinterval(char *i_string,
17351735
*
17361736
*****************************************************************************/
17371737

1738-
Datum
1739-
int4reltime(PG_FUNCTION_ARGS)
1740-
{
1741-
int32timevalue=PG_GETARG_INT32(0);
1742-
1743-
/* Just coerce it directly to RelativeTime ... */
1744-
PG_RETURN_RELATIVETIME((RelativeTime)timevalue);
1745-
}
1746-
17471738
/*
17481739
* timeofday -
17491740
* returns the current time as a text. similar to timenow() but returns

‎src/include/catalog/pg_cast.h

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* $Header: /cvsroot/pgsql/src/include/catalog/pg_cast.h,v 1.1 2002/07/18 23:11:30 petere Exp $
3+
* pg_cast.h
4+
* definition of the system "type casts" relation (pg_cast)
5+
* along with the relation's initial contents.
6+
*
47
*
58
* Copyright (c) 2002, PostgreSQL Global Development Group
69
*
10+
* $Id: pg_cast.h,v 1.2 2002/09/01 00:58:06 tgl Exp $
11+
*
12+
* NOTES
13+
* the genbki.sh script reads this file and generates .bki
14+
* information from the DATA() statements.
15+
*
716
*-------------------------------------------------------------------------
817
*/
918
#ifndefPG_CAST_H
1019
#definePG_CAST_H
1120

1221
CATALOG(pg_cast)
1322
{
14-
Oidcastsource;
15-
Oidcasttarget;
23+
Oidcastsource;/* source datatype for cast */
24+
Oidcasttarget;/* destination datatype for cast */
1625
Oidcastfunc;/* 0 = binary compatible */
17-
boolcastimplicit;
26+
boolcastimplicit;/* allow implicit casting? */
1827
}FormData_pg_cast;
1928

2029
typedefFormData_pg_cast*Form_pg_cast;
@@ -115,7 +124,10 @@ DATA(insert ( 1562 1560 0 t ));
115124
* This list can be obtained from the following query as long as the
116125
* naming convention of the cast functions remains the same:
117126
*
118-
* 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;
127+
* select p.proargtypes[0] as source, p.prorettype as target, p.oid as func,
128+
* p.proimplicit as implicit
129+
* from pg_proc p, pg_type t where p.pronargs=1 and p.proname = t.typname
130+
* and p.prorettype = t.oid order by 1, 2;
119131
*/
120132
DATA(insert (1825946t ));
121133
DATA(insert (181042860t ));
@@ -139,7 +151,6 @@ DATA(insert ( 23 21 314 t ));
139151
DATA(insert (2325112t ));
140152
DATA(insert (23700318t ));
141153
DATA(insert (23701316t ));
142-
/*xDATA(insert ( 23 703 1200 f ));*/
143154
DATA(insert (2310431619f ));
144155
DATA(insert (2317001740t ));
145156
DATA(insert (2518944t ));
@@ -159,7 +170,7 @@ DATA(insert ( 25 1114 2022 f ));
159170
DATA(insert (2511841191f ));
160171
DATA(insert (2511861263f ));
161172
DATA(insert (251266938f ));
162-
DATA(insert (2625114f ));
173+
DATA(insert (2625114t ));
163174
DATA(insert (6016001532f ));
164175
DATA(insert (6026001533f ));
165176
DATA(insert (6026041449f ));
@@ -176,7 +187,7 @@ DATA(insert ( 700 23 319 f ));
176187
DATA(insert (70025841t ));
177188
DATA(insert (700701311t ));
178189
DATA(insert (70017001742t ));
179-
DATA(insert (70120483f ));
190+
DATA(insert (70120483t ));
180191
DATA(insert (70121237f ));
181192
DATA(insert (70123317f ));
182193
DATA(insert (70125840t ));

‎src/include/catalog/pg_proc.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: pg_proc.h,v 1.266 2002/08/27 04:00:28 momjian Exp $
10+
* $Id: pg_proc.h,v 1.267 2002/09/0100:58:06 tgl Exp $
1111
*
1212
* NOTES
1313
* The script catalog/genbki.sh reads this file and generates .bki
@@ -1479,9 +1479,6 @@ DESCR("date difference preserving months and years");
14791479

14801480
/* OIDS 1200 - 1299 */
14811481

1482-
DATA(insertOID=1200 (reltimePGNSPPGUID12fftfi1703"23"int4reltime-_null_ ));
1483-
DESCR("convert int4 to reltime");
1484-
14851482
DATA(insertOID=1215 (obj_descriptionPGNSPPGUID14fftfs225"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_ ));
14861483
DESCR("get description for object id and catalog name");
14871484
DATA(insertOID=1216 (col_descriptionPGNSPPGUID14fftfs225"26 23""select description from pg_description where objoid = $1 and classoid = \'pg_catalog.pg_class\'::regclass and objsubid = $2"-_null_ ));

‎src/include/utils/nabstime.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: nabstime.h,v 1.36 2002/06/20 20:29:53 momjian Exp $
10+
* $Id: nabstime.h,v 1.37 2002/09/01 00:58:07 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -152,7 +152,6 @@ extern Datum tintervalct(PG_FUNCTION_ARGS);
152152
externDatumtintervalov(PG_FUNCTION_ARGS);
153153
externDatumtintervalstart(PG_FUNCTION_ARGS);
154154
externDatumtintervalend(PG_FUNCTION_ARGS);
155-
externDatumint4reltime(PG_FUNCTION_ARGS);
156155
externDatumtimeofday(PG_FUNCTION_ARGS);
157156

158157
/* non-fmgr-callable support routines */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp