diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-05 23:12:09 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-07-05 23:12:09 +0000 |
commit | 40f64064ff56c3118d156ba83df72b1779415a8a (patch) | |
tree | d318bf6c8e6e85a15d2cd6e997ee02bf233dd181 /src/backend/utils/cache/relcache.c | |
parent | 282713a836d5dfe3dcefeaa6a6cedf5f000bdb09 (diff) | |
download | postgresql-40f64064ff56c3118d156ba83df72b1779415a8a.tar.gz postgresql-40f64064ff56c3118d156ba83df72b1779415a8a.zip |
Update textin() and textout() to new fmgr style. This is just phase
one of updating the whole text datatype, but there are so dang many
calls of these two routines that it seems worth a separate commit.
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r-- | src/backend/utils/cache/relcache.c | 24 |
1 files changed, 13 insertions, 11 deletions
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); |