diff options
Diffstat (limited to 'src/backend/utils/cache')
| -rw-r--r-- | src/backend/utils/cache/fcache.c | 24 | ||||
| -rw-r--r-- | src/backend/utils/cache/relcache.c | 24 |
2 files changed, 25 insertions, 23 deletions
diff --git a/src/backend/utils/cache/fcache.c b/src/backend/utils/cache/fcache.c index 867de40baa9..7e9d18c7e27 100644 --- a/src/backend/utils/cache/fcache.c +++ b/src/backend/utils/cache/fcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.32 2000/06/06 17:44:25 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.33 2000/07/05 23:11:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -70,7 +70,7 @@ init_fcache(Oid foid, Form_pg_type typeStruct; FunctionCachePtr retval; int nargs; - text *tmp; + Datum tmp; bool isNull; retval = (FunctionCachePtr) palloc(sizeof(FunctionCache)); @@ -212,14 +212,14 @@ init_fcache(Oid foid, if (procedureStruct->prolang == SQLlanguageId) { - tmp = (text *) SysCacheGetAttr(PROCOID, - procedureTuple, - Anum_pg_proc_prosrc, - &isNull); + tmp = SysCacheGetAttr(PROCOID, + procedureTuple, + Anum_pg_proc_prosrc, + &isNull); if (isNull) elog(ERROR, "init_fcache: null prosrc for procedure %u", foid); - retval->src = textout(tmp); + retval->src = DatumGetCString(DirectFunctionCall1(textout, tmp)); retval->bin = (char *) NULL; } else @@ -229,14 +229,14 @@ init_fcache(Oid foid, retval->bin = (char *) NULL; else { - tmp = (text *) SysCacheGetAttr(PROCOID, - procedureTuple, - Anum_pg_proc_probin, - &isNull); + tmp = SysCacheGetAttr(PROCOID, + procedureTuple, + Anum_pg_proc_probin, + &isNull); if (isNull) elog(ERROR, "init_fcache: null probin for procedure %u", foid); - retval->bin = textout(tmp); + retval->bin = DatumGetCString(DirectFunctionCall1(textout, tmp)); } } diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index dc69a0e508f..c1cc688e8f6 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.105 2000/06/30 07:04:10 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.106 2000/07/05 23:11:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1901,7 +1901,7 @@ AttrDefaultFetch(Relation relation) IndexScanDesc sd = (IndexScanDesc) NULL; HeapScanDesc adscan = (HeapScanDesc) NULL; RetrieveIndexResult indexRes; - struct varlena *val; + Datum val; bool isnull; int found; int i; @@ -1959,16 +1959,17 @@ AttrDefaultFetch(Relation relation) NameStr(relation->rd_att->attrs[adform->adnum - 1]->attname), RelationGetRelationName(relation)); - val = (struct varlena *) fastgetattr(htup, - Anum_pg_attrdef_adbin, - adrel->rd_att, &isnull); + val = fastgetattr(htup, + Anum_pg_attrdef_adbin, + adrel->rd_att, &isnull); if (isnull) elog(NOTICE, "AttrDefaultFetch: adbin IS NULL for attr %s in rel %s", NameStr(relation->rd_att->attrs[adform->adnum - 1]->attname), RelationGetRelationName(relation)); else attrdef[i].adbin = MemoryContextStrdup(CacheMemoryContext, - textout(val)); + DatumGetCString(DirectFunctionCall1(textout, + val))); break; } if (hasindex) @@ -2008,7 +2009,7 @@ RelCheckFetch(Relation relation) HeapScanDesc rcscan = (HeapScanDesc) NULL; RetrieveIndexResult indexRes; Name rcname; - struct varlena *val; + Datum val; bool isnull; int found; bool hasindex; @@ -2066,14 +2067,15 @@ RelCheckFetch(Relation relation) RelationGetRelationName(relation)); check[found].ccname = MemoryContextStrdup(CacheMemoryContext, NameStr(*rcname)); - val = (struct varlena *) fastgetattr(htup, - Anum_pg_relcheck_rcbin, - rcrel->rd_att, &isnull); + val = fastgetattr(htup, + Anum_pg_relcheck_rcbin, + rcrel->rd_att, &isnull); if (isnull) elog(ERROR, "RelCheckFetch: rcbin IS NULL for rel %s", RelationGetRelationName(relation)); check[found].ccbin = MemoryContextStrdup(CacheMemoryContext, - textout(val)); + DatumGetCString(DirectFunctionCall1(textout, + val))); found++; if (hasindex) ReleaseBuffer(buffer); |
