|
13 | 13 | *
|
14 | 14 | *
|
15 | 15 | * IDENTIFICATION
|
16 |
| - * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.67 2002/05/01 23:06:41 tgl Exp $ |
| 16 | + * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.68 2002/05/11 00:24:16 tgl Exp $ |
17 | 17 | *
|
18 | 18 | *-------------------------------------------------------------------------
|
19 | 19 | */
|
|
40 | 40 |
|
41 | 41 | staticList*stringToQualifiedNameList(constchar*string,constchar*caller);
|
42 | 42 | staticvoidparseNameAndArgTypes(constchar*string,constchar*caller,
|
43 |
| -boolallow_none, |
| 43 | +constchar*type0_spelling, |
44 | 44 | List**names,int*nargs,Oid*argtypes);
|
45 | 45 |
|
46 | 46 |
|
@@ -261,7 +261,7 @@ regprocedurein(PG_FUNCTION_ARGS)
|
261 | 261 | * datatype cannot be used for any system column that needs to receive
|
262 | 262 | * data during bootstrap.
|
263 | 263 | */
|
264 |
| -parseNameAndArgTypes(pro_name_or_oid,"regprocedurein",false, |
| 264 | +parseNameAndArgTypes(pro_name_or_oid,"regprocedurein","opaque", |
265 | 265 | &names,&nargs,argtypes);
|
266 | 266 |
|
267 | 267 | clist=FuncnameGetCandidates(names,nargs);
|
@@ -326,12 +326,16 @@ regprocedureout(PG_FUNCTION_ARGS)
|
326 | 326 | quote_qualified_identifier(nspname,proname));
|
327 | 327 | for (i=0;i<nargs;i++)
|
328 | 328 | {
|
329 |
| -appendStringInfo(&buf,"%s%s", |
330 |
| - (i>0) ?"," :"", |
331 |
| -format_type_be(procform->proargtypes[i])); |
332 |
| -} |
| 329 | +Oidthisargtype=procform->proargtypes[i]; |
333 | 330 |
|
334 |
| -appendStringInfo(&buf,")"); |
| 331 | +if (i>0) |
| 332 | +appendStringInfoChar(&buf,','); |
| 333 | +if (OidIsValid(thisargtype)) |
| 334 | +appendStringInfo(&buf,"%s",format_type_be(thisargtype)); |
| 335 | +else |
| 336 | +appendStringInfo(&buf,"opaque"); |
| 337 | +} |
| 338 | +appendStringInfoChar(&buf,')'); |
335 | 339 |
|
336 | 340 | result=buf.data;
|
337 | 341 |
|
@@ -567,7 +571,7 @@ regoperatorin(PG_FUNCTION_ARGS)
|
567 | 571 | * datatype cannot be used for any system column that needs to receive
|
568 | 572 | * data during bootstrap.
|
569 | 573 | */
|
570 |
| -parseNameAndArgTypes(opr_name_or_oid,"regoperatorin",true, |
| 574 | +parseNameAndArgTypes(opr_name_or_oid,"regoperatorin","none", |
571 | 575 | &names,&nargs,argtypes);
|
572 | 576 | if (nargs==1)
|
573 | 577 | elog(ERROR,"regoperatorin: use NONE to denote the missing argument of a unary operator");
|
@@ -1000,10 +1004,12 @@ stringToQualifiedNameList(const char *string, const char *caller)
|
1000 | 1004 | * the argtypes array should be of size FUNC_MAX_ARGS). The function or
|
1001 | 1005 | * operator name is returned to *names as a List of Strings.
|
1002 | 1006 | *
|
1003 |
| - * NONE is accepted as a placeholder for OID 0 if allow_none is true. |
| 1007 | + * If type0_spelling is not NULL, it is a name to be accepted as a |
| 1008 | + * placeholder for OID 0. |
1004 | 1009 | */
|
1005 | 1010 | staticvoid
|
1006 |
| -parseNameAndArgTypes(constchar*string,constchar*caller,boolallow_none, |
| 1011 | +parseNameAndArgTypes(constchar*string,constchar*caller, |
| 1012 | +constchar*type0_spelling, |
1007 | 1013 | List**names,int*nargs,Oid*argtypes)
|
1008 | 1014 | {
|
1009 | 1015 | char*rawname;
|
@@ -1109,9 +1115,9 @@ parseNameAndArgTypes(const char *string, const char *caller, bool allow_none,
|
1109 | 1115 | *ptr2='\0';
|
1110 | 1116 | }
|
1111 | 1117 |
|
1112 |
| -if (allow_none&&strcasecmp(typename,"none")==0) |
| 1118 | +if (type0_spelling&&strcasecmp(typename,type0_spelling)==0) |
1113 | 1119 | {
|
1114 |
| -/*Report NONE as OID 0 */ |
| 1120 | +/*Special case for OPAQUE or NONE */ |
1115 | 1121 | typeid=InvalidOid;
|
1116 | 1122 | typmod=-1;
|
1117 | 1123 | }
|
|