summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane2004-06-06 00:41:28 +0000
committerTom Lane2004-06-06 00:41:28 +0000
commitc541bb86e9ec8fed37b23df6a0df703d0bde4dfa (patch)
treeb4cff96eecc86e338274ec5d7355918efe9c149e /src/include
parentc3a153afed84e29dac664bdc6123724a9e3a906f (diff)
Infrastructure for I/O of composite types: arrange for the I/O routines
of a composite type to get that type's OID as their second parameter, in place of typelem which is useless. The actual changes are mostly centralized in getTypeInputInfo and siblings, but I had to fix a few places that were fetching pg_type.typelem for themselves instead of using the lsyscache.c routines. Also, I renamed all the related variables from 'typelem' to 'typioparam' to discourage people from assuming that they necessarily contain array element types.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/funcapi.h6
-rw-r--r--src/include/utils/array.h4
-rw-r--r--src/include/utils/lsyscache.h13
3 files changed, 12 insertions, 11 deletions
diff --git a/src/include/funcapi.h b/src/include/funcapi.h
index fd1660423e1..77b410c3fb2 100644
--- a/src/include/funcapi.h
+++ b/src/include/funcapi.h
@@ -9,7 +9,7 @@
*
* Copyright (c) 2002-2003, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/funcapi.h,v 1.11 2004/04/01 21:28:46 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/funcapi.h,v 1.12 2004/06/06 00:41:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -40,8 +40,8 @@ typedef struct AttInMetadata
/* array of attribute type input function finfo */
FmgrInfo *attinfuncs;
- /* array of attribute type typelem */
- Oid *attelems;
+ /* array of attribute type i/o parameter OIDs */
+ Oid *attioparams;
/* array of attribute typmod */
int32 *atttypmods;
diff --git a/src/include/utils/array.h b/src/include/utils/array.h
index af976a54e2c..596cf79d4d3 100644
--- a/src/include/utils/array.h
+++ b/src/include/utils/array.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/array.h,v 1.46 2003/11/29 22:41:15 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/utils/array.h,v 1.47 2004/06/06 00:41:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -59,7 +59,7 @@ typedef struct ArrayMetaState
bool typbyval;
char typalign;
char typdelim;
- Oid typelem;
+ Oid typioparam;
Oid typiofunc;
FmgrInfo proc;
} ArrayMetaState;
diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h
index bd02e132d0f..68fab871bde 100644
--- a/src/include/utils/lsyscache.h
+++ b/src/include/utils/lsyscache.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.86 2003/12/03 17:45:10 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/utils/lsyscache.h,v 1.87 2004/06/06 00:41:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -71,13 +71,14 @@ extern bool get_typbyval(Oid typid);
extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval);
extern void get_typlenbyvalalign(Oid typid, int16 *typlen, bool *typbyval,
char *typalign);
+extern Oid getTypeIOParam(HeapTuple typeTuple);
extern void get_type_io_data(Oid typid,
IOFuncSelector which_func,
int16 *typlen,
bool *typbyval,
char *typalign,
char *typdelim,
- Oid *typelem,
+ Oid *typioparam,
Oid *func);
extern char get_typstorage(Oid typid);
extern int32 get_typtypmod(Oid typid);
@@ -86,11 +87,11 @@ extern char get_typtype(Oid typid);
extern Oid get_typ_typrelid(Oid typid);
extern Oid get_element_type(Oid typid);
extern Oid get_array_type(Oid typid);
-extern void getTypeInputInfo(Oid type, Oid *typInput, Oid *typElem);
-extern void getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typElem,
+extern void getTypeInputInfo(Oid type, Oid *typInput, Oid *typIOParam);
+extern void getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typIOParam,
bool *typIsVarlena);
-extern void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typElem);
-extern void getTypeBinaryOutputInfo(Oid type, Oid *typSend, Oid *typElem,
+extern void getTypeBinaryInputInfo(Oid type, Oid *typReceive, Oid *typIOParam);
+extern void getTypeBinaryOutputInfo(Oid type, Oid *typSend, Oid *typIOParam,
bool *typIsVarlena);
extern Oid getBaseType(Oid typid);
extern int32 get_typavgwidth(Oid typid, int32 typmod);