diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/utils/fmgr/funcapi.c | 11 | ||||
-rw-r--r-- | src/include/funcapi.h | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c index 3ecb59eec8e..43afc693221 100644 --- a/src/backend/utils/fmgr/funcapi.c +++ b/src/backend/utils/fmgr/funcapi.c @@ -7,7 +7,7 @@ * Copyright (c) 2002-2005, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.22 2005/05/28 05:10:47 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/fmgr/funcapi.c,v 1.23 2005/05/30 23:09:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -822,6 +822,10 @@ build_function_result_tupdesc_d(Datum proallargtypes, * RelationNameGetTupleDesc * * Given a (possibly qualified) relation name, build a TupleDesc. + * + * Note: while this works as advertised, it's seldom the best way to + * build a tupdesc for a function's result type. It's kept around + * only for backwards compatibility with existing user-written code. */ TupleDesc RelationNameGetTupleDesc(const char *relname) @@ -844,7 +848,10 @@ RelationNameGetTupleDesc(const char *relname) /* * TypeGetTupleDesc * - * Given a type Oid, build a TupleDesc. + * Given a type Oid, build a TupleDesc. (In most cases you should be + * using get_call_result_type or one of its siblings instead of this + * routine, so that you can handle OUT parameters, RECORD result type, + * and polymorphic results.) * * If the type is composite, *and* a colaliases List is provided, *and* * the List is of natts length, use the aliases instead of the relation diff --git a/src/include/funcapi.h b/src/include/funcapi.h index 2b4bfa28c4d..8acbf3aa3b9 100644 --- a/src/include/funcapi.h +++ b/src/include/funcapi.h @@ -9,7 +9,7 @@ * * Copyright (c) 2002-2005, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/funcapi.h,v 1.17 2005/04/05 06:22:15 tgl Exp $ + * $PostgreSQL: pgsql/src/include/funcapi.h,v 1.18 2005/05/30 23:09:07 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -181,11 +181,6 @@ extern TupleDesc build_function_result_tupdesc_t(HeapTuple procTuple); * Support to ease writing functions returning composite types * * External declarations: - * TupleDesc RelationNameGetTupleDesc(const char *relname) - Use to get a - * TupleDesc based on a specified relation. - * TupleDesc TypeGetTupleDesc(Oid typeoid, List *colaliases) - Use to get a - * TupleDesc based on a type OID. This can be used to get - * a TupleDesc for a base (scalar) or composite (relation) type. * TupleDesc BlessTupleDesc(TupleDesc tupdesc) - "Bless" a completed tuple * descriptor so that it can be used to return properly labeled tuples. * You need to call this if you are going to use heap_formtuple directly. @@ -203,6 +198,10 @@ extern TupleDesc build_function_result_tupdesc_t(HeapTuple procTuple); * HeapTupleGetDatum(HeapTuple tuple) - convert a HeapTuple to a Datum. * * Obsolete routines and macros: + * TupleDesc RelationNameGetTupleDesc(const char *relname) - Use to get a + * TupleDesc based on a named relation. + * TupleDesc TypeGetTupleDesc(Oid typeoid, List *colaliases) - Use to get a + * TupleDesc based on a type OID. * TupleTableSlot *TupleDescGetSlot(TupleDesc tupdesc) - Builds a * TupleTableSlot, which is not needed anymore. * TupleGetDatum(TupleTableSlot *slot, HeapTuple tuple) - get a Datum |