|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.29 2000/01/26 05:56:42 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.29.2.1 2000/06/06 16:51:24 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -48,7 +48,8 @@ typeidTypeName(Oid id)
|
48 | 48 | returnNULL;
|
49 | 49 | }
|
50 | 50 | typetuple= (Form_pg_type)GETSTRUCT(tup);
|
51 |
| -returnNameStr(typetuple->typname); |
| 51 | +/* pstrdup here because result may need to outlive the syscache entry */ |
| 52 | +returnpstrdup(NameStr(typetuple->typname)); |
52 | 53 | }
|
53 | 54 |
|
54 | 55 | /* return a Type structure, given a type id */
|
@@ -119,7 +120,8 @@ typeTypeName(Type t)
|
119 | 120 | Form_pg_typetyp;
|
120 | 121 |
|
121 | 122 | typ= (Form_pg_type)GETSTRUCT(t);
|
122 |
| -returnNameStr(typ->typname); |
| 123 | +/* pstrdup here because result may need to outlive the syscache entry */ |
| 124 | +returnpstrdup(NameStr(typ->typname)); |
123 | 125 | }
|
124 | 126 |
|
125 | 127 | /* given a type, return its typetype ('c' for 'c'atalog types) */
|
|