File tree Expand file tree Collapse file tree 4 files changed +36
-5
lines changed Expand file tree Collapse file tree 4 files changed +36
-5
lines changed Original file line number Diff line number Diff line change 7
7
* Portions Copyright (c) 1994, Regents of the University of California
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.34 2001/10/25 05:49:44 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/int8.c,v 1.35 2001/10/25 14:10:06 tgl Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -697,6 +697,29 @@ int84(PG_FUNCTION_ARGS)
697
697
PG_RETURN_INT32 (result );
698
698
}
699
699
700
+ Datum
701
+ int28 (PG_FUNCTION_ARGS )
702
+ {
703
+ int16 val = PG_GETARG_INT16 (0 );
704
+
705
+ PG_RETURN_INT64 ((int64 ) val );
706
+ }
707
+
708
+ Datum
709
+ int82 (PG_FUNCTION_ARGS )
710
+ {
711
+ int64 val = PG_GETARG_INT64 (0 );
712
+ int16 result ;
713
+
714
+ result = (int16 ) val ;
715
+
716
+ /* Test for overflow by reverse-conversion. */
717
+ if ((int64 ) result != val )
718
+ elog (ERROR , "int8 conversion to int2 is out of range" );
719
+
720
+ PG_RETURN_INT16 (result );
721
+ }
722
+
700
723
Datum
701
724
i8tod (PG_FUNCTION_ARGS )
702
725
{
Original file line number Diff line number Diff line change 37
37
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
38
38
* Portions Copyright (c) 1994, Regents of the University of California
39
39
*
40
- * $Id: catversion.h,v 1.100 2001/10/25 05:49:56 momjian Exp $
40
+ * $Id: catversion.h,v 1.101 2001/10/25 14:10:06 tgl Exp $
41
41
*
42
42
*-------------------------------------------------------------------------
43
43
*/
53
53
*/
54
54
55
55
/* yyyymmddN */
56
- #define CATALOG_VERSION_NO 200110181
56
+ #define CATALOG_VERSION_NO 200110251
57
57
#endif
Original file line number Diff line number Diff line change 7
7
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $Id: pg_proc.h,v 1.218 2001/10/25 05:49:57 momjian Exp $
10
+ * $Id: pg_proc.h,v 1.219 2001/10/25 14:10:06 tgl Exp $
11
11
*
12
12
* NOTES
13
13
* The script catalog/genbki.sh reads this file and generates .bki
@@ -885,6 +885,11 @@ DESCR("convert int8 to float8");
885
885
DATA (insert OID = 483 ( int8 PGUID 12 f t t t 1 f 20 "701" 100 0 0 100 dtoi8 - ));
886
886
DESCR ("convert float8 to int8" );
887
887
888
+ DATA (insert OID = 714 ( int2 PGUID 12 f t t t 1 f 21 "20" 100 0 0 100 int82 - ));
889
+ DESCR ("convert int8 to int2" );
890
+ DATA (insert OID = 754 ( int8 PGUID 12 f t t t 1 f 20 "21" 100 0 0 100 int28 - ));
891
+ DESCR ("convert int2 to int8" );
892
+
888
893
/* OIDS 500 - 599 */
889
894
890
895
/* OIDS 600 - 699 */
Original file line number Diff line number Diff line change 7
7
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8
8
* Portions Copyright (c) 1994, Regents of the University of California
9
9
*
10
- * $Id: int8.h,v 1.28 2001/10/25 05:50:10 momjian Exp $
10
+ * $Id: int8.h,v 1.29 2001/10/25 14:10:07 tgl Exp $
11
11
*
12
12
* NOTES
13
13
* These data types are supported on all 64-bit architectures, and may
@@ -98,6 +98,9 @@ extern Datum int48div(PG_FUNCTION_ARGS);
98
98
extern Datum int48 (PG_FUNCTION_ARGS );
99
99
extern Datum int84 (PG_FUNCTION_ARGS );
100
100
101
+ extern Datum int28 (PG_FUNCTION_ARGS );
102
+ extern Datum int82 (PG_FUNCTION_ARGS );
103
+
101
104
extern Datum i8tod (PG_FUNCTION_ARGS );
102
105
extern Datum dtoi8 (PG_FUNCTION_ARGS );
103
106
You can’t perform that action at this time.
0 commit comments