summaryrefslogtreecommitdiff
path: root/src/include/utils
diff options
context:
space:
mode:
authorTom Lane2007-04-02 03:49:42 +0000
committerTom Lane2007-04-02 03:49:42 +0000
commit57690c6803525f879fe96920a05e979ece073e71 (patch)
tree42e82eaa1e9c8247b39a2ad783bf190b5001acfe /src/include/utils
parenta482a3e58b3e5830899560c555e57e4184b8e6be (diff)
Support enum data types. Along the way, use macros for the values of
pg_type.typtype whereever practical. Tom Dunstan, with some kibitzing from Tom Lane.
Diffstat (limited to 'src/include/utils')
-rw-r--r--src/include/utils/builtins.h23
-rw-r--r--src/include/utils/lsyscache.h3
-rw-r--r--src/include/utils/syscache.h38
3 files changed, 44 insertions, 20 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index b2a55bbbb98..d93599a9ae5 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.290 2007/03/20 05:45:00 neilc Exp $
+ * $PostgreSQL: pgsql/src/include/utils/builtins.h,v 1.291 2007/04/02 03:49:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -103,6 +103,25 @@ extern Datum char_text(PG_FUNCTION_ARGS);
extern Datum domain_in(PG_FUNCTION_ARGS);
extern Datum domain_recv(PG_FUNCTION_ARGS);
+/* enum.c */
+extern Datum enum_in(PG_FUNCTION_ARGS);
+extern Datum enum_out(PG_FUNCTION_ARGS);
+extern Datum enum_lt(PG_FUNCTION_ARGS);
+extern Datum enum_le(PG_FUNCTION_ARGS);
+extern Datum enum_eq(PG_FUNCTION_ARGS);
+extern Datum enum_ne(PG_FUNCTION_ARGS);
+extern Datum enum_ge(PG_FUNCTION_ARGS);
+extern Datum enum_gt(PG_FUNCTION_ARGS);
+extern Datum enum_cmp(PG_FUNCTION_ARGS);
+extern Datum enum_text(PG_FUNCTION_ARGS);
+extern Datum text_enum(PG_FUNCTION_ARGS);
+extern Datum enum_smaller(PG_FUNCTION_ARGS);
+extern Datum enum_larger(PG_FUNCTION_ARGS);
+extern Datum enum_first(PG_FUNCTION_ARGS);
+extern Datum enum_last(PG_FUNCTION_ARGS);
+extern Datum enum_range_bounds(PG_FUNCTION_ARGS);
+extern Datum enum_range_all(PG_FUNCTION_ARGS);
+
/* int.c */
extern Datum int2in(PG_FUNCTION_ARGS);
extern Datum int2out(PG_FUNCTION_ARGS);
@@ -450,6 +469,8 @@ extern Datum anyarray_in(PG_FUNCTION_ARGS);
extern Datum anyarray_out(PG_FUNCTION_ARGS);
extern Datum anyarray_recv(PG_FUNCTION_ARGS);
extern Datum anyarray_send(PG_FUNCTION_ARGS);
+extern Datum anyenum_in(PG_FUNCTION_ARGS);
+extern Datum anyenum_out(PG_FUNCTION_ARGS);
extern Datum void_in(PG_FUNCTION_ARGS);
extern Datum void_out(PG_FUNCTION_ARGS);
extern Datum trigger_in(PG_FUNCTION_ARGS);
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h
index 78c45891fa4..25782e322e9 100644
--- a/src/include/utils/lsyscache.h
+++ b/src/include/utils/lsyscache.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.117 2007/02/14 01:58:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.118 2007/04/02 03:49:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -105,6 +105,7 @@ extern char get_typstorage(Oid typid);
extern Node *get_typdefault(Oid typid);
extern char get_typtype(Oid typid);
extern bool type_is_rowtype(Oid typid);
+extern bool type_is_enum(Oid typid);
extern Oid get_typ_typrelid(Oid typid);
extern Oid get_element_type(Oid typid);
extern Oid get_array_type(Oid typid);
diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h
index c6967251ce1..12cd9a72f22 100644
--- a/src/include/utils/syscache.h
+++ b/src/include/utils/syscache.h
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.68 2007/02/14 01:58:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.69 2007/04/02 03:49:41 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -48,23 +48,25 @@
#define CONSTROID 17
#define CONVOID 18
#define DATABASEOID 19
-#define INDEXRELID 20
-#define LANGNAME 21
-#define LANGOID 22
-#define NAMESPACENAME 23
-#define NAMESPACEOID 24
-#define OPERNAMENSP 25
-#define OPEROID 26
-#define OPFAMILYAMNAMENSP 27
-#define OPFAMILYOID 28
-#define PROCNAMEARGSNSP 29
-#define PROCOID 30
-#define RELNAMENSP 31
-#define RELOID 32
-#define RULERELNAME 33
-#define STATRELATT 34
-#define TYPENAMENSP 35
-#define TYPEOID 36
+#define ENUMOID 20
+#define ENUMTYPOIDNAME 21
+#define INDEXRELID 22
+#define LANGNAME 23
+#define LANGOID 24
+#define NAMESPACENAME 25
+#define NAMESPACEOID 26
+#define OPERNAMENSP 27
+#define OPEROID 28
+#define OPFAMILYAMNAMENSP 29
+#define OPFAMILYOID 30
+#define PROCNAMEARGSNSP 31
+#define PROCOID 32
+#define RELNAMENSP 33
+#define RELOID 34
+#define RULERELNAME 35
+#define STATRELATT 36
+#define TYPENAMENSP 37
+#define TYPEOID 38
extern void InitCatalogCache(void);
extern void InitCatalogCachePhase2(void);