summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-10-04 22:49:59 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-10-04 22:49:59 +0000
commit6c61af665466131e8c96106837eaf293a472b682 (patch)
treec1c1aa0f78a78e66c3f427d5f42b3663a83c85f7 /src/include
parent1ab415596d1de61561d0de8fe9da4aea207adca4 (diff)
downloadpostgresql-6c61af665466131e8c96106837eaf293a472b682.tar.gz
Remove arithmetic operators on the 1-byte-char datatype, as per proposals
made several times in the past. Add coercion functions between "char" and integer so that a workaround is possible if needed. Initdb forced.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/catversion.h4
-rw-r--r--src/include/catalog/pg_cast.h5
-rw-r--r--src/include/catalog/pg_operator.h7
-rw-r--r--src/include/catalog/pg_proc.h14
-rw-r--r--src/include/utils/builtins.h8
5 files changed, 15 insertions, 23 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 281c82e2d0..8476500187 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -37,7 +37,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.249 2004/08/29 04:13:04 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.250 2004/10/04 22:49:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 200408031
+#define CATALOG_VERSION_NO 200410041
#endif
diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h
index c99e60dca0..df341ec15a 100644
--- a/src/include/catalog/pg_cast.h
+++ b/src/include/catalog/pg_cast.h
@@ -10,7 +10,7 @@
*
* Copyright (c) 2002-2004, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.15 2004/08/29 05:06:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_cast.h,v 1.16 2004/10/04 22:49:54 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -182,6 +182,9 @@ DATA(insert ( 1043 18 944 a ));
DATA(insert ( 25 19 407 i ));
DATA(insert ( 1042 19 409 i ));
DATA(insert ( 1043 19 1400 i ));
+/* Cross-category casts between int4 and "char" */
+DATA(insert ( 18 23 77 e ));
+DATA(insert ( 23 18 78 e ));
/*
* Datetime category
diff --git a/src/include/catalog/pg_operator.h b/src/include/catalog/pg_operator.h
index 7108ae51dd..f3f36e54b2 100644
--- a/src/include/catalog/pg_operator.h
+++ b/src/include/catalog/pg_operator.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.128 2004/08/29 05:06:55 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_operator.h,v 1.129 2004/10/04 22:49:54 tgl Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -299,11 +299,6 @@ DATA(insert OID = 632 ( "<=" PGNSP PGUID b f 18 18 16 634 633 0 0 0 0 charle
DATA(insert OID = 633 ( ">" PGNSP PGUID b f 18 18 16 631 632 0 0 0 0 chargt scalargtsel scalargtjoinsel ));
DATA(insert OID = 634 ( ">=" PGNSP PGUID b f 18 18 16 632 631 0 0 0 0 charge scalargtsel scalargtjoinsel ));
-DATA(insert OID = 635 ( "+" PGNSP PGUID b f 18 18 18 0 0 0 0 0 0 charpl - - ));
-DATA(insert OID = 636 ( "-" PGNSP PGUID b f 18 18 18 0 0 0 0 0 0 charmi - - ));
-DATA(insert OID = 637 ( "*" PGNSP PGUID b f 18 18 18 0 0 0 0 0 0 charmul - - ));
-DATA(insert OID = 638 ( "/" PGNSP PGUID b f 18 18 18 0 0 0 0 0 0 chardiv - - ));
-
DATA(insert OID = 639 ( "~" PGNSP PGUID b f 19 25 16 0 640 0 0 0 0 nameregexeq regexeqsel regexeqjoinsel ));
#define OID_NAME_REGEXEQ_OP 639
DATA(insert OID = 640 ( "!~" PGNSP PGUID b f 19 25 16 0 639 0 0 0 0 nameregexne regexnesel regexnejoinsel ));
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 0721beec0c..8a525035fc 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.346 2004/10/04 22:13:14 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.347 2004/10/04 22:49:55 tgl Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@@ -181,14 +181,10 @@ DATA(insert OID = 73 ( chargt PGNSP PGUID 12 f f t f i 2 16 "18 18" _null
DESCR("greater-than");
DATA(insert OID = 74 ( charge PGNSP PGUID 12 f f t f i 2 16 "18 18" _null_ charge - _null_ ));
DESCR("greater-than-or-equal");
-DATA(insert OID = 1248 ( charpl PGNSP PGUID 12 f f t f i 2 18 "18 18" _null_ charpl - _null_ ));
-DESCR("add");
-DATA(insert OID = 1250 ( charmi PGNSP PGUID 12 f f t f i 2 18 "18 18" _null_ charmi - _null_ ));
-DESCR("subtract");
-DATA(insert OID = 77 ( charmul PGNSP PGUID 12 f f t f i 2 18 "18 18" _null_ charmul - _null_ ));
-DESCR("multiply");
-DATA(insert OID = 78 ( chardiv PGNSP PGUID 12 f f t f i 2 18 "18 18" _null_ chardiv - _null_ ));
-DESCR("divide");
+DATA(insert OID = 77 ( int4 PGNSP PGUID 12 f f t f i 1 23 "18" _null_ chartoi4 - _null_ ));
+DESCR("convert char to int4");
+DATA(insert OID = 78 ( char PGNSP PGUID 12 f f t f i 1 18 "23" _null_ i4tochar - _null_ ));
+DESCR("convert int4 to char");
DATA(insert OID = 79 ( nameregexeq PGNSP PGUID 12 f f t f i 2 16 "19 25" _null_ nameregexeq - _null_ ));
DESCR("matches regex., case-sensitive");
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index b1d7b9a854..4b88596fdb 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.250 2004/08/30 02:54:40 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.251 2004/10/04 22:49:59 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -88,10 +88,8 @@ extern Datum charlt(PG_FUNCTION_ARGS);
extern Datum charle(PG_FUNCTION_ARGS);
extern Datum chargt(PG_FUNCTION_ARGS);
extern Datum charge(PG_FUNCTION_ARGS);
-extern Datum charpl(PG_FUNCTION_ARGS);
-extern Datum charmi(PG_FUNCTION_ARGS);
-extern Datum charmul(PG_FUNCTION_ARGS);
-extern Datum chardiv(PG_FUNCTION_ARGS);
+extern Datum chartoi4(PG_FUNCTION_ARGS);
+extern Datum i4tochar(PG_FUNCTION_ARGS);
extern Datum text_char(PG_FUNCTION_ARGS);
extern Datum char_text(PG_FUNCTION_ARGS);