diff options
author | Tom Lane | 2002-08-22 00:01:51 +0000 |
---|---|---|
committer | Tom Lane | 2002-08-22 00:01:51 +0000 |
commit | b663f3443ba096a06970214c3e83e79f6e570b84 (patch) | |
tree | 049e26c1b02535c12bee6e60ba89cf1d42a41a72 /src | |
parent | 606c9b9d4fafe9300d039c044edc9727c0ed43c9 (diff) |
Add a bunch of pseudo-types to replace the behavior formerly associated
with OPAQUE, as per recent pghackers discussion. I still want to do some
more work on the 'cstring' pseudo-type, but I'm going to commit the bulk
of the changes now before the tree starts shifting under me ...
Diffstat (limited to 'src')
82 files changed, 1488 insertions, 847 deletions
diff --git a/src/backend/access/common/printtup.c b/src/backend/access/common/printtup.c index a8a8f0da2f1..6fbce87be7c 100644 --- a/src/backend/access/common/printtup.c +++ b/src/backend/access/common/printtup.c @@ -9,7 +9,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.62 2002/06/20 20:29:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/common/printtup.c,v 1.63 2002/08/22 00:01:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -17,10 +17,10 @@ #include "access/heapam.h" #include "access/printtup.h" -#include "catalog/pg_type.h" #include "libpq/libpq.h" #include "libpq/pqformat.h" -#include "utils/syscache.h" +#include "utils/lsyscache.h" + static void printtup_setup(DestReceiver *self, int operation, const char *portalName, TupleDesc typeinfo); @@ -34,31 +34,6 @@ static void printtup_cleanup(DestReceiver *self); */ /* ---------------- - * getTypeOutputInfo -- get info needed for printing values of a type - * ---------------- - */ -bool -getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typElem, - bool *typIsVarlena) -{ - HeapTuple typeTuple; - Form_pg_type pt; - - typeTuple = SearchSysCache(TYPEOID, - ObjectIdGetDatum(type), - 0, 0, 0); - if (!HeapTupleIsValid(typeTuple)) - elog(ERROR, "getTypeOutputInfo: Cache lookup of type %u failed", type); - pt = (Form_pg_type) GETSTRUCT(typeTuple); - - *typOutput = pt->typoutput; - *typElem = pt->typelem; - *typIsVarlena = (!pt->typbyval) && (pt->typlen == -1); - ReleaseSysCache(typeTuple); - return OidIsValid(*typOutput); -} - -/* ---------------- * Private state for a printtup destination object * ---------------- */ diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c index f8bf95ddc66..f7dc8e5d014 100644 --- a/src/backend/catalog/aclchk.c +++ b/src/backend/catalog/aclchk.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.74 2002/08/07 21:45:01 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.75 2002/08/22 00:01:41 tgl Exp $ * * NOTES * See acl.h. @@ -376,7 +376,7 @@ ExecuteGrantStmt_Function(GrantStmt *stmt) char replaces[Natts_pg_proc]; oid = LookupFuncNameTypeNames(func->funcname, func->funcargs, - true, stmt->is_grant ? "GRANT" : "REVOKE"); + stmt->is_grant ? "GRANT" : "REVOKE"); relation = heap_openr(ProcedureRelationName, RowExclusiveLock); tuple = SearchSysCache(PROCOID, diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c index 2f9f83dc78f..719d229b8d5 100644 --- a/src/backend/catalog/pg_aggregate.c +++ b/src/backend/catalog/pg_aggregate.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.53 2002/08/05 03:29:16 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.54 2002/08/22 00:01:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -67,13 +67,13 @@ AggregateCreate(const char *aggName, /* handle transfn */ MemSet(fnArgs, 0, FUNC_MAX_ARGS * sizeof(Oid)); fnArgs[0] = aggTransType; - if (OidIsValid(aggBaseType)) + if (aggBaseType == ANYOID) + nargs = 1; + else { fnArgs[1] = aggBaseType; nargs = 2; } - else - nargs = 1; transfn = LookupFuncName(aggtransfnName, nargs, fnArgs); if (!OidIsValid(transfn)) func_error("AggregateCreate", aggtransfnName, nargs, fnArgs, NULL); diff --git a/src/backend/catalog/pg_operator.c b/src/backend/catalog/pg_operator.c index 620ec7360cf..8c6174608ff 100644 --- a/src/backend/catalog/pg_operator.c +++ b/src/backend/catalog/pg_operator.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.75 2002/08/05 03:29:16 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.76 2002/08/22 00:01:41 tgl Exp $ * * NOTES * these routines moved here from commands/define.c and somewhat cleaned up. @@ -464,9 +464,9 @@ OperatorCreate(const char *operatorName, if (restrictionName) { MemSet(typeId, 0, FUNC_MAX_ARGS * sizeof(Oid)); - typeId[0] = 0; /* Query (opaque type) */ + typeId[0] = INTERNALOID; /* Query */ typeId[1] = OIDOID; /* operator OID */ - typeId[2] = 0; /* args list (opaque type) */ + typeId[2] = INTERNALOID; /* args list */ typeId[3] = INT4OID; /* varRelid */ restOid = LookupFuncName(restrictionName, 4, typeId); @@ -482,9 +482,9 @@ OperatorCreate(const char *operatorName, if (joinName) { MemSet(typeId, 0, FUNC_MAX_ARGS * sizeof(Oid)); - typeId[0] = 0; /* Query (opaque type) */ + typeId[0] = INTERNALOID; /* Query */ typeId[1] = OIDOID; /* operator OID */ - typeId[2] = 0; /* args list (opaque type) */ + typeId[2] = INTERNALOID; /* args list */ joinOid = LookupFuncName(joinName, 3, typeId); if (!OidIsValid(joinOid)) diff --git a/src/backend/catalog/pg_proc.c b/src/backend/catalog/pg_proc.c index f1b437be8d1..9f14f780994 100644 --- a/src/backend/catalog/pg_proc.c +++ b/src/backend/catalog/pg_proc.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.88 2002/08/05 03:29:16 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.89 2002/08/22 00:01:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -502,7 +502,8 @@ fmgr_internal_validator(PG_FUNCTION_ARGS) elog(ERROR, "there is no built-in function named \"%s\"", prosrc); ReleaseSysCache(tuple); - PG_RETURN_BOOL(true); + + PG_RETURN_VOID(); } @@ -545,9 +546,9 @@ fmgr_c_validator(PG_FUNCTION_ARGS) (void) fetch_finfo_record(libraryhandle, prosrc); ReleaseSysCache(tuple); - PG_RETURN_BOOL(true); -} + PG_RETURN_VOID(); +} /* @@ -567,6 +568,7 @@ fmgr_sql_validator(PG_FUNCTION_ARGS) Datum tmp; char *prosrc; char functyptype; + int i; tuple = SearchSysCache(PROCOID, funcoid, 0, 0, 0); if (!HeapTupleIsValid(tuple)) @@ -574,8 +576,19 @@ fmgr_sql_validator(PG_FUNCTION_ARGS) proc = (Form_pg_proc) GETSTRUCT(tuple); - if (!OidIsValid(proc->prorettype)) - elog(ERROR, "SQL functions cannot return type \"opaque\""); + /* Disallow pseudotypes in arguments and result */ + /* except that return type can be RECORD */ + if (get_typtype(proc->prorettype) == 'p' && + proc->prorettype != RECORDOID) + elog(ERROR, "SQL functions cannot return type %s", + format_type_be(proc->prorettype)); + + for (i = 0; i < proc->pronargs; i++) + { + if (get_typtype(proc->proargtypes[i]) == 'p') + elog(ERROR, "SQL functions cannot have arguments of type %s", + format_type_be(proc->proargtypes[i])); + } tmp = SysCacheGetAttr(PROCOID, tuple, Anum_pg_proc_prosrc, &isnull); if (isnull) @@ -590,5 +603,6 @@ fmgr_sql_validator(PG_FUNCTION_ARGS) checkretval(proc->prorettype, functyptype, querytree_list); ReleaseSysCache(tuple); - PG_RETURN_BOOL(true); + + PG_RETURN_VOID(); } diff --git a/src/backend/commands/aggregatecmds.c b/src/backend/commands/aggregatecmds.c index 1b83f03f481..85ee9e3f537 100644 --- a/src/backend/commands/aggregatecmds.c +++ b/src/backend/commands/aggregatecmds.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/aggregatecmds.c,v 1.3 2002/07/12 18:43:15 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/aggregatecmds.c,v 1.4 2002/08/22 00:01:41 tgl Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -28,6 +28,7 @@ #include "catalog/namespace.h" #include "catalog/pg_aggregate.h" #include "catalog/pg_proc.h" +#include "catalog/pg_type.h" #include "commands/defrem.h" #include "miscadmin.h" #include "parser/parse_func.h" @@ -104,29 +105,23 @@ DefineAggregate(List *names, List *parameters) elog(ERROR, "Define: \"sfunc\" unspecified"); /* - * Handle the aggregate's base type (input data type). This can be - * specified as 'ANY' for a data-independent transition function, such - * as COUNT(*). + * look up the aggregate's base type (input datatype) and transtype. + * + * We have historically allowed the command to look like basetype = 'ANY' + * so we must do a case-insensitive comparison for the name ANY. Ugh. + * + * basetype can be a pseudo-type, but transtype can't, since we need + * to be able to store values of the transtype. */ - baseTypeId = LookupTypeName(baseType); - if (OidIsValid(baseTypeId)) - { - /* no need to allow aggregates on as-yet-undefined types */ - if (!get_typisdefined(baseTypeId)) - elog(ERROR, "Type \"%s\" is only a shell", - TypeNameToString(baseType)); - } + if (strcasecmp(TypeNameToString(baseType), "ANY") == 0) + baseTypeId = ANYOID; else - { - char *typnam = TypeNameToString(baseType); - - if (strcasecmp(typnam, "ANY") != 0) - elog(ERROR, "Type \"%s\" does not exist", typnam); - baseTypeId = InvalidOid; - } + baseTypeId = typenameTypeId(baseType); - /* handle transtype --- no special cases here */ transTypeId = typenameTypeId(transType); + if (get_typtype(transTypeId) == 'p') + elog(ERROR, "Aggregate transition datatype cannot be %s", + format_type_be(transTypeId)); /* * Most of the argument-checking is done inside of AggregateCreate @@ -159,14 +154,13 @@ RemoveAggregate(RemoveAggrStmt *stmt) * if a basetype is passed in, then attempt to find an aggregate for * that specific type. * - * else if the basetype is blank, then attempt to find an aggregate with - * a basetype of zero. This is valid. It means that the aggregate is - * to apply to all basetypes (eg, COUNT). + * else attempt to find an aggregate with a basetype of ANYOID. + * This means that the aggregate is to apply to all basetypes (eg, COUNT). */ if (aggType) basetypeID = typenameTypeId(aggType); else - basetypeID = InvalidOid; + basetypeID = ANYOID; procOid = find_aggregate_func("RemoveAggregate", aggName, basetypeID); diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c index 41ef71960de..ce489280182 100644 --- a/src/backend/commands/comment.c +++ b/src/backend/commands/comment.c @@ -7,7 +7,7 @@ * Copyright (c) 1996-2001, PostgreSQL Global Development Group * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/comment.c,v 1.56 2002/08/09 16:45:14 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/comment.c,v 1.57 2002/08/22 00:01:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -24,6 +24,7 @@ #include "catalog/pg_operator.h" #include "catalog/pg_rewrite.h" #include "catalog/pg_trigger.h" +#include "catalog/pg_type.h" #include "commands/comment.h" #include "commands/dbcommands.h" #include "miscadmin.h" @@ -628,7 +629,7 @@ CommentAggregate(List *aggregate, List *arguments, char *comment) if (aggtype) baseoid = typenameTypeId(aggtype); else - baseoid = InvalidOid; + baseoid = ANYOID; /* Now, attempt to find the actual tuple in pg_proc */ @@ -661,7 +662,7 @@ CommentProc(List *function, List *arguments, char *comment) /* Look up the procedure */ oid = LookupFuncNameTypeNames(function, arguments, - true, "CommentProc"); + "CommentProc"); /* Now, validate the user's ability to comment on this function */ diff --git a/src/backend/commands/conversioncmds.c b/src/backend/commands/conversioncmds.c index a8785d76862..7d65a1a7854 100644 --- a/src/backend/commands/conversioncmds.c +++ b/src/backend/commands/conversioncmds.c @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------- * - * conversionmacmds.c + * conversioncmds.c * conversion creation command support code * * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/conversioncmds.c,v 1.2 2002/07/25 10:07:11 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/conversioncmds.c,v 1.3 2002/08/22 00:01:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -45,7 +45,7 @@ CreateConversionCommand(CreateConversionStmt *stmt) const char *to_encoding_name = stmt->to_encoding_name; List *func_name = stmt->func_name; - static Oid funcargs[] = {INT4OID, INT4OID, 0, 0, INT4OID}; + static Oid funcargs[] = {INT4OID, INT4OID, CSTRINGOID, CSTRINGOID, INT4OID}; /* Convert list of names to a name and namespace */ namespaceId = QualifiedNameGetCreationNamespace(stmt->conversion_name, &conversion_name); diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index 2751fe01d9e..e0bbe7560bb 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.165 2002/08/19 15:08:46 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.166 2002/08/22 00:01:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -37,6 +37,7 @@ #include "utils/acl.h" #include "utils/builtins.h" #include "utils/relcache.h" +#include "utils/lsyscache.h" #include "utils/syscache.h" #ifdef MULTIBYTE diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index 51d003600bb..6d6ad94a4ed 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.17 2002/08/11 17:44:12 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.18 2002/08/22 00:01:42 tgl Exp $ * * DESCRIPTION * These routines take the parse tree and pick out the @@ -61,7 +61,9 @@ * allow a shell type to be used, or even created if the specified return type * doesn't exist yet. (Without this, there's no way to define the I/O procs * for a new type.) But SQL function creation won't cope, so error out if - * the target language is SQL. + * the target language is SQL. (We do this here, not in the SQL-function + * validator, so as not to produce a WARNING and then an ERROR for the same + * condition.) */ static void compute_return_type(TypeName *returnType, Oid languageOid, @@ -76,7 +78,8 @@ compute_return_type(TypeName *returnType, Oid languageOid, if (!get_typisdefined(rettype)) { if (languageOid == SQLlanguageId) - elog(ERROR, "SQL functions cannot return shell types"); + elog(ERROR, "SQL function cannot return shell type \"%s\"", + TypeNameToString(returnType)); else elog(WARNING, "Return type \"%s\" is only a shell", TypeNameToString(returnType)); @@ -85,29 +88,32 @@ compute_return_type(TypeName *returnType, Oid languageOid, else { char *typnam = TypeNameToString(returnType); + Oid namespaceId; + AclResult aclresult; + char *typname; - if (strcmp(typnam, "opaque") == 0) - rettype = InvalidOid; - else - { - Oid namespaceId; - AclResult aclresult; - char *typname; - - if (languageOid == SQLlanguageId) - elog(ERROR, "Type \"%s\" does not exist", typnam); - elog(WARNING, "ProcedureCreate: type %s is not yet defined", - typnam); - namespaceId = QualifiedNameGetCreationNamespace(returnType->names, - &typname); - aclresult = pg_namespace_aclcheck(namespaceId, GetUserId(), - ACL_CREATE); - if (aclresult != ACLCHECK_OK) - aclcheck_error(aclresult, get_namespace_name(namespaceId)); - rettype = TypeShellMake(typname, namespaceId); - if (!OidIsValid(rettype)) - elog(ERROR, "could not create type %s", typnam); - } + /* + * Only C-coded functions can be I/O functions. We enforce this + * restriction here mainly to prevent littering the catalogs with + * shell types due to simple typos in user-defined function + * definitions. + */ + if (languageOid != INTERNALlanguageId && + languageOid != ClanguageId) + elog(ERROR, "Type \"%s\" does not exist", typnam); + + /* Otherwise, go ahead and make a shell type */ + elog(WARNING, "ProcedureCreate: type %s is not yet defined", + typnam); + namespaceId = QualifiedNameGetCreationNamespace(returnType->names, + &typname); + aclresult = pg_namespace_aclcheck(namespaceId, GetUserId(), + ACL_CREATE); + if (aclresult != ACLCHECK_OK) + aclcheck_error(aclresult, get_namespace_name(namespaceId)); + rettype = TypeShellMake(typname, namespaceId); + if (!OidIsValid(rettype)) + elog(ERROR, "could not create type %s", typnam); } *prorettype_p = rettype; @@ -138,25 +144,24 @@ compute_parameter_types(List *argTypes, Oid languageOid, if (OidIsValid(toid)) { if (!get_typisdefined(toid)) - elog(WARNING, "Argument type \"%s\" is only a shell", - TypeNameToString(t)); - } - else - { - char *typnam = TypeNameToString(t); - - if (strcmp(typnam, "opaque") == 0) { + /* As above, hard error if language is SQL */ if (languageOid == SQLlanguageId) - elog(ERROR, "SQL functions cannot have arguments of type \"opaque\""); - toid = InvalidOid; + elog(ERROR, "SQL function cannot accept shell type \"%s\"", + TypeNameToString(t)); + else + elog(WARNING, "Argument type \"%s\" is only a shell", + TypeNameToString(t)); } - else - elog(ERROR, "Type \"%s\" does not exist", typnam); + } + else + { + elog(ERROR, "Type \"%s\" does not exist", + TypeNameToString(t)); } if (t->setof) - elog(ERROR, "functions cannot accept set arguments"); + elog(ERROR, "Functions cannot accept set arguments"); parameterTypes[parameterCount++] = toid; } @@ -492,7 +497,7 @@ RemoveFunction(RemoveFuncStmt *stmt) * Find the function, do permissions and validity checks */ funcOid = LookupFuncNameTypeNames(functionName, argTypes, - true, "RemoveFunction"); + "RemoveFunction"); tup = SearchSysCache(PROCOID, ObjectIdGetDatum(funcOid), @@ -621,6 +626,23 @@ CreateCast(CreateCastStmt *stmt) if (sourcetypeid == targettypeid) elog(ERROR, "source data type and target data type are the same"); + /* No shells, no pseudo-types allowed */ + if (!get_typisdefined(sourcetypeid)) + elog(ERROR, "source data type %s is only a shell", + TypeNameToString(stmt->sourcetype)); + + if (!get_typisdefined(targettypeid)) + elog(ERROR, "target data type %s is only a shell", + TypeNameToString(stmt->targettype)); + + if (get_typtype(sourcetypeid) == 'p') + elog(ERROR, "source data type %s is a pseudo-type", + TypeNameToString(stmt->sourcetype)); + + if (get_typtype(targettypeid) == 'p') + elog(ERROR, "target data type %s is a pseudo-type", + TypeNameToString(stmt->targettype)); + if (!pg_type_ownercheck(sourcetypeid, GetUserId()) && !pg_type_ownercheck(targettypeid, GetUserId())) elog(ERROR, "must be owner of type %s or type %s", @@ -642,7 +664,6 @@ CreateCast(CreateCastStmt *stmt) { funcid = LookupFuncNameTypeNames(stmt->func->funcname, stmt->func->funcargs, - false, "CreateCast"); tuple = SearchSysCache(PROCOID, ObjectIdGetDatum(funcid), 0, 0, 0); diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c index f544dc9886c..a0430a8786b 100644 --- a/src/backend/commands/opclasscmds.c +++ b/src/backend/commands/opclasscmds.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/opclasscmds.c,v 1.3 2002/08/05 03:29:16 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/opclasscmds.c,v 1.4 2002/08/22 00:01:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -177,7 +177,7 @@ DefineOpClass(CreateOpClassStmt *stmt) elog(ERROR, "DefineOpClass: procedure number %d appears more than once", item->number); funcOid = LookupFuncNameTypeNames(item->name, item->args, - true, "DefineOpClass"); + "DefineOpClass"); /* Caller must have execute permission on functions */ aclresult = pg_proc_aclcheck(funcOid, GetUserId(), ACL_EXECUTE); diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c index 9672e74ea9b..8aa2addc512 100644 --- a/src/backend/commands/proclang.c +++ b/src/backend/commands/proclang.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.40 2002/08/13 17:22:08 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.41 2002/08/22 00:01:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -71,17 +71,18 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) elog(ERROR, "Language %s already exists", languageName); /* - * Lookup the PL handler function and check that it is of return type - * Opaque + * Lookup the PL handler function and check that it is of the expected + * return type */ MemSet(typev, 0, sizeof(typev)); procOid = LookupFuncName(stmt->plhandler, 0, typev); if (!OidIsValid(procOid)) elog(ERROR, "function %s() doesn't exist", NameListToString(stmt->plhandler)); - if (get_func_rettype(procOid) != InvalidOid) - elog(ERROR, "function %s() does not return type \"opaque\"", - NameListToString(stmt->plhandler)); + if (get_func_rettype(procOid) != LANGUAGE_HANDLEROID) + elog(ERROR, "function %s() does not return type %s", + NameListToString(stmt->plhandler), + format_type_be(LANGUAGE_HANDLEROID)); /* validate the validator function */ if (stmt->plvalidator) @@ -91,6 +92,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt) if (!OidIsValid(valProcOid)) elog(ERROR, "function %s(oid) doesn't exist", NameListToString(stmt->plvalidator)); + /* return value is ignored, so we don't check the type */ } else valProcOid = InvalidOid; diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 312bad43525..82feb9333d7 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.127 2002/08/18 11:20:05 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.128 2002/08/22 00:01:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -23,6 +23,7 @@ #include "catalog/pg_language.h" #include "catalog/pg_proc.h" #include "catalog/pg_trigger.h" +#include "catalog/pg_type.h" #include "commands/trigger.h" #include "executor/executor.h" #include "miscadmin.h" @@ -222,9 +223,15 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint) if (!HeapTupleIsValid(tuple)) elog(ERROR, "CreateTrigger: function %s() does not exist", NameListToString(stmt->funcname)); - if (((Form_pg_proc) GETSTRUCT(tuple))->prorettype != 0) - elog(ERROR, "CreateTrigger: function %s() must return OPAQUE", - NameListToString(stmt->funcname)); + if (((Form_pg_proc) GETSTRUCT(tuple))->prorettype != TRIGGEROID) + { + /* OPAQUE is deprecated, but allowed for backwards compatibility */ + if (((Form_pg_proc) GETSTRUCT(tuple))->prorettype == OPAQUEOID) + elog(NOTICE, "CreateTrigger: OPAQUE is deprecated, use type TRIGGER instead to define trigger functions"); + else + elog(ERROR, "CreateTrigger: function %s() must return TRIGGER", + NameListToString(stmt->funcname)); + } ReleaseSysCache(tuple); /* diff --git a/src/backend/commands/typecmds.c b/src/backend/commands/typecmds.c index f9f27d58676..bfca9c7c8f2 100644 --- a/src/backend/commands/typecmds.c +++ b/src/backend/commands/typecmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.9 2002/08/15 16:36:02 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.10 2002/08/22 00:01:42 tgl Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -49,7 +49,7 @@ #include "utils/syscache.h" -static Oid findTypeIOFunction(List *procname, bool isOutput); +static Oid findTypeIOFunction(List *procname, Oid typeOid, bool isOutput); /* * DefineType @@ -75,6 +75,7 @@ DefineType(List *names, List *parameters) char *shadow_type; List *pl; Oid typoid; + Oid resulttype; /* Convert list of names to a name and namespace */ typeNamespace = QualifiedNameGetCreationNamespace(names, &typeName); @@ -116,7 +117,13 @@ DefineType(List *names, List *parameters) delimiter = p[0]; } else if (strcasecmp(defel->defname, "element") == 0) + { elemType = typenameTypeId(defGetTypeName(defel)); + /* disallow arrays of pseudotypes */ + if (get_typtype(elemType) == 'p') + elog(ERROR, "Array element type cannot be %s", + format_type_be(elemType)); + } else if (strcasecmp(defel->defname, "default") == 0) defaultValue = defGetString(defel); else if (strcasecmp(defel->defname, "passedbyvalue") == 0) @@ -179,9 +186,36 @@ DefineType(List *names, List *parameters) if (outputName == NIL) elog(ERROR, "Define: \"output\" unspecified"); - /* Convert I/O proc names to OIDs */ - inputOid = findTypeIOFunction(inputName, false); - outputOid = findTypeIOFunction(outputName, true); + /* + * Look to see if type already exists (presumably as a shell; if not, + * TypeCreate will complain). If it does then the declarations of the + * I/O functions might use it. + */ + typoid = GetSysCacheOid(TYPENAMENSP, + CStringGetDatum(typeName), + ObjectIdGetDatum(typeNamespace), + 0, 0); + + /* + * Convert I/O proc names to OIDs + */ + inputOid = findTypeIOFunction(inputName, typoid, false); + outputOid = findTypeIOFunction(outputName, typoid, true); + + /* + * Verify that I/O procs return the expected thing. OPAQUE is an allowed + * (but deprecated) alternative to the fully type-safe choices. + */ + resulttype = get_func_rettype(inputOid); + if (!((OidIsValid(typoid) && resulttype == typoid) || + resulttype == OPAQUEOID)) + elog(ERROR, "Type input function %s must return %s or OPAQUE", + NameListToString(inputName), typeName); + resulttype = get_func_rettype(outputOid); + if (!(resulttype == CSTRINGOID || + resulttype == OPAQUEOID)) + elog(ERROR, "Type output function %s must return CSTRING or OPAQUE", + NameListToString(outputName)); /* * now have TypeCreate do all the real work. @@ -377,10 +411,9 @@ DefineDomain(CreateDomainStmt *stmt) basetypeoid = HeapTupleGetOid(typeTup); /* - * What we really don't want is domains of domains. This could cause all sorts - * of neat issues if we allow that. - * - * With testing, we may determine complex types should be allowed + * Base type must be a plain base type. Domains over pseudo types would + * create a security hole. Domains of domains might be made to work in + * the future, but not today. Ditto for domains over complex types. */ typtype = baseType->typtype; if (typtype != 'b') @@ -621,52 +654,109 @@ RemoveDomain(List *names, DropBehavior behavior) /* * Find a suitable I/O function for a type. + * + * typeOid is the type's OID, if it already exists as a shell type, + * otherwise InvalidOid. */ static Oid -findTypeIOFunction(List *procname, bool isOutput) +findTypeIOFunction(List *procname, Oid typeOid, bool isOutput) { Oid argList[FUNC_MAX_ARGS]; - int nargs; Oid procOid; - /* - * First look for a 1-argument func with all argtypes 0. This is - * valid for all kinds of procedure. - */ - MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid)); - - procOid = LookupFuncName(procname, 1, argList); - - if (!OidIsValid(procOid)) + if (isOutput) { /* - * Alternatively, input procedures may take 3 args (data - * value, element OID, atttypmod); the pg_proc argtype - * signature is 0,OIDOID,INT4OID. Output procedures may - * take 2 args (data value, element OID). + * Output functions can take a single argument of the type, + * or two arguments (data value, element OID). The signature + * may use OPAQUE in place of the actual type name; this is the + * only possibility if the type doesn't yet exist as a shell. */ - if (isOutput) - { - /* output proc */ - nargs = 2; - argList[1] = OIDOID; - } - else + if (OidIsValid(typeOid)) { - /* input proc */ - nargs = 3; + MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid)); + + argList[0] = typeOid; + + procOid = LookupFuncName(procname, 1, argList); + if (OidIsValid(procOid)) + return procOid; + argList[1] = OIDOID; - argList[2] = INT4OID; + + procOid = LookupFuncName(procname, 2, argList); + if (OidIsValid(procOid)) + return procOid; + } - procOid = LookupFuncName(procname, nargs, argList); - if (!OidIsValid(procOid)) - func_error("TypeCreate", procname, 1, argList, NULL); + MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid)); + + argList[0] = OPAQUEOID; + + procOid = LookupFuncName(procname, 1, argList); + if (OidIsValid(procOid)) + return procOid; + + argList[1] = OIDOID; + + procOid = LookupFuncName(procname, 2, argList); + if (OidIsValid(procOid)) + return procOid; + + /* Prefer type name over OPAQUE in the failure message. */ + if (OidIsValid(typeOid)) + argList[0] = typeOid; + + func_error("TypeCreate", procname, 1, argList, NULL); } + else + { + /* + * Input functions can take a single argument of type CSTRING, + * or three arguments (string, element OID, typmod). The signature + * may use OPAQUE in place of CSTRING. + */ + MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid)); + + argList[0] = CSTRINGOID; + + procOid = LookupFuncName(procname, 1, argList); + if (OidIsValid(procOid)) + return procOid; - return procOid; + argList[1] = OIDOID; + argList[2] = INT4OID; + + procOid = LookupFuncName(procname, 3, argList); + if (OidIsValid(procOid)) + return procOid; + + MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid)); + + argList[0] = OPAQUEOID; + + procOid = LookupFuncName(procname, 1, argList); + if (OidIsValid(procOid)) + return procOid; + + argList[1] = OIDOID; + argList[2] = INT4OID; + + procOid = LookupFuncName(procname, 3, argList); + if (OidIsValid(procOid)) + return procOid; + + /* Use CSTRING (preferred) in the error message */ + argList[0] = CSTRINGOID; + + func_error("TypeCreate", procname, 1, argList, NULL); + } + + return InvalidOid; /* keep compiler quiet */ } + /*------------------------------------------------------------------- * DefineCompositeType * diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c index b4725055885..1016c782d29 100644 --- a/src/backend/parser/parse_coerce.c +++ b/src/backend/parser/parse_coerce.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.79 2002/07/20 05:29:01 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.80 2002/08/22 00:01:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -47,7 +47,6 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, Node *result; if (targetTypeId == inputTypeId || - targetTypeId == InvalidOid || node == NULL) { /* no conversion needed, but constraints may need to be applied */ @@ -97,6 +96,12 @@ coerce_type(ParseState *pstate, Node *node, Oid inputTypeId, if (targetTypeId != baseTypeId) result = (Node *) TypeConstraints(result, targetTypeId); } + else if (targetTypeId == ANYOID || + targetTypeId == ANYARRAYOID) + { + /* assume can_coerce_type verified that implicit coercion is okay */ + result = node; + } else if (IsBinaryCompatible(inputTypeId, targetTypeId)) { /* @@ -213,18 +218,10 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids, if (inputTypeId == targetTypeId) continue; - /* - * one of the known-good transparent conversions? then drop - * through... - */ - if (IsBinaryCompatible(inputTypeId, targetTypeId)) - continue; - - /* don't know what to do for the output type? then quit... */ - if (targetTypeId == InvalidOid) + /* don't choke on references to no-longer-existing types */ + if (!typeidIsValid(inputTypeId)) return false; - /* don't know what to do for the input type? then quit... */ - if (inputTypeId == InvalidOid) + if (!typeidIsValid(targetTypeId)) return false; /* @@ -238,18 +235,44 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids, continue; } + /* accept if target is ANY */ + if (targetTypeId == ANYOID) + continue; + + /* if target is ANYARRAY and source is a varlena array type, accept */ + if (targetTypeId == ANYARRAYOID) + { + Oid typOutput; + Oid typElem; + bool typIsVarlena; + + if (getTypeOutputInfo(inputTypeId, &typOutput, &typElem, + &typIsVarlena)) + { + if (OidIsValid(typElem) && typIsVarlena) + continue; + } + /* + * Otherwise reject; this assumes there are no explicit coercions + * to ANYARRAY. If we don't reject then parse_coerce would have + * to repeat the above test. + */ + return false; + } + + /* + * one of the known-good transparent conversions? then drop + * through... + */ + if (IsBinaryCompatible(inputTypeId, targetTypeId)) + continue; + /* * If input is a class type that inherits from target, no problem */ if (typeInheritsFrom(inputTypeId, targetTypeId)) continue; - /* don't choke on references to no-longer-existing types */ - if (!typeidIsValid(inputTypeId)) - return false; - if (!typeidIsValid(targetTypeId)) - return false; - /* * Else, try for run-time conversion using functions: look for a * single-argument function named with the target type name and diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index edd0e810957..87e432b7cf3 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.134 2002/08/08 01:44:30 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.135 2002/08/22 00:01:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1264,10 +1264,7 @@ func_error(const char *caller, List *funcname, { if (i) appendStringInfo(&argbuf, ", "); - if (OidIsValid(argtypes[i])) - appendStringInfo(&argbuf, format_type_be(argtypes[i])); - else - appendStringInfo(&argbuf, "opaque"); + appendStringInfo(&argbuf, format_type_be(argtypes[i])); } if (caller == NULL) @@ -1289,7 +1286,7 @@ func_error(const char *caller, List *funcname, * Convenience routine to check that a function exists and is an * aggregate. * - * Note: basetype is InvalidOid if we are looking for an aggregate on + * Note: basetype is ANYOID if we are looking for an aggregate on * all types. */ Oid @@ -1303,7 +1300,7 @@ find_aggregate_func(const char *caller, List *aggname, Oid basetype) if (!OidIsValid(oid)) { - if (basetype == InvalidOid) + if (basetype == ANYOID) elog(ERROR, "%s: aggregate %s(*) does not exist", caller, NameListToString(aggname)); else @@ -1322,7 +1319,7 @@ find_aggregate_func(const char *caller, List *aggname, Oid basetype) if (!pform->proisagg) { - if (basetype == InvalidOid) + if (basetype == ANYOID) elog(ERROR, "%s: function %s(*) is not an aggregate", caller, NameListToString(aggname)); else @@ -1366,12 +1363,9 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes) * Like LookupFuncName, but the argument types are specified by a * list of TypeName nodes. Also, if we fail to find the function * and caller is not NULL, then an error is reported via func_error. - * - * "opaque" is accepted as a typename only if opaqueOK is true. */ Oid -LookupFuncNameTypeNames(List *funcname, List *argtypes, bool opaqueOK, - const char *caller) +LookupFuncNameTypeNames(List *funcname, List *argtypes, const char *caller) { Oid funcoid; Oid argoids[FUNC_MAX_ARGS]; @@ -1389,15 +1383,10 @@ LookupFuncNameTypeNames(List *funcname, List *argtypes, bool opaqueOK, TypeName *t = (TypeName *) lfirst(argtypes); argoids[i] = LookupTypeName(t); - if (!OidIsValid(argoids[i])) - { - char *typnam = TypeNameToString(t); - if (opaqueOK && strcmp(typnam, "opaque") == 0) - argoids[i] = InvalidOid; - else - elog(ERROR, "Type \"%s\" does not exist", typnam); - } + if (!OidIsValid(argoids[i])) + elog(ERROR, "Type \"%s\" does not exist", + TypeNameToString(t)); argtypes = lnext(argtypes); } diff --git a/src/backend/utils/adt/Makefile b/src/backend/utils/adt/Makefile index 3cbd1a8fa58..0685daa5045 100644 --- a/src/backend/utils/adt/Makefile +++ b/src/backend/utils/adt/Makefile @@ -1,7 +1,7 @@ # # Makefile for utils/adt # -# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.52 2002/08/17 13:04:15 momjian Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/adt/Makefile,v 1.53 2002/08/22 00:01:43 tgl Exp $ # subdir = src/backend/utils/adt @@ -19,7 +19,7 @@ OBJS = acl.o arrayfuncs.o arrayutils.o bool.o cash.o char.o \ date.o datetime.o datum.o float.o format_type.o \ geo_ops.o geo_selfuncs.o int.o int8.o like.o lockfuncs.o \ misc.o nabstime.o name.o not_in.o numeric.o numutils.o \ - oid.o oracle_compat.o \ + oid.o oracle_compat.o pseudotypes.o \ regexp.o regproc.o ruleutils.o selfuncs.o sets.o \ tid.o timestamp.o varbit.o varchar.o varlena.o version.o \ network.o mac.o inet_net_ntop.o inet_net_pton.o \ diff --git a/src/backend/utils/adt/int.c b/src/backend/utils/adt/int.c index c228e85ae8e..859e78b58cb 100644 --- a/src/backend/utils/adt/int.c +++ b/src/backend/utils/adt/int.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.51 2002/06/20 20:29:37 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/int.c,v 1.52 2002/08/22 00:01:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -144,59 +144,6 @@ int2vectoreq(PG_FUNCTION_ARGS) PG_RETURN_BOOL(memcmp(arg1, arg2, INDEX_MAX_KEYS * sizeof(int16)) == 0); } -/* - * Type int44 has no real-world use, but the regression tests use it. - * It's a four-element vector of int4's. - */ - -/* - * int44in - converts "num num ..." to internal form - * - * Note: Fills any missing positions with zeroes. - */ -Datum -int44in(PG_FUNCTION_ARGS) -{ - char *input_string = PG_GETARG_CSTRING(0); - int32 *result = (int32 *) palloc(4 * sizeof(int32)); - int i; - - i = sscanf(input_string, - "%d, %d, %d, %d", - &result[0], - &result[1], - &result[2], - &result[3]); - while (i < 4) - result[i++] = 0; - - PG_RETURN_POINTER(result); -} - -/* - * int44out - converts internal form to "num num ..." - */ -Datum -int44out(PG_FUNCTION_ARGS) -{ - int32 *an_array = (int32 *) PG_GETARG_POINTER(0); - char *result = (char *) palloc(16 * 4); /* Allow 14 digits + - * sign */ - int i; - char *walk; - - walk = result; - for (i = 0; i < 4; i++) - { - pg_ltoa(an_array[i], walk); - while (*++walk != '\0') - ; - *walk++ = ' '; - } - *--walk = '\0'; - PG_RETURN_CSTRING(result); -} - /***************************************************************************** * PUBLIC ROUTINES * diff --git a/src/backend/utils/adt/pseudotypes.c b/src/backend/utils/adt/pseudotypes.c new file mode 100644 index 00000000000..7e5cd2950d8 --- /dev/null +++ b/src/backend/utils/adt/pseudotypes.c @@ -0,0 +1,234 @@ +/*------------------------------------------------------------------------- + * + * pseudotypes.c + * Functions for the system pseudo-types. + * + * A pseudo-type isn't really a type and never has any operations, but + * we do need to supply input and output functions to satisfy the links + * in the pseudo-type's entry in pg_type. In most cases the functions + * just throw an error if invoked. (XXX the error messages here cover + * the most common case, but might be confusing in some contexts. Can + * we do better?) + * + * + * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/backend/utils/adt/pseudotypes.c,v 1.1 2002/08/22 00:01:43 tgl Exp $ + * + *------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "utils/builtins.h" + + +/* + * record_in - input routine for pseudo-type RECORD. + */ +Datum +record_in(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot accept a constant of type %s", "RECORD"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * record_out - output routine for pseudo-type RECORD. + */ +Datum +record_out(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot display a value of type %s", "RECORD"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * cstring_in - input routine for pseudo-type CSTRING. + */ +Datum +cstring_in(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot accept a constant of type %s", "CSTRING"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * cstring_out - output routine for pseudo-type CSTRING. + */ +Datum +cstring_out(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot display a value of type %s", "CSTRING"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * any_in - input routine for pseudo-type ANY. + */ +Datum +any_in(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot accept a constant of type %s", "ANY"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * any_out - output routine for pseudo-type ANY. + */ +Datum +any_out(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot display a value of type %s", "ANY"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * anyarray_in - input routine for pseudo-type ANYARRAY. + */ +Datum +anyarray_in(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot accept a constant of type %s", "ANYARRAY"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * anyarray_out - output routine for pseudo-type ANYARRAY. + */ +Datum +anyarray_out(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot display a value of type %s", "ANYARRAY"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * void_in - input routine for pseudo-type VOID. + * + * We allow this so that PL functions can return VOID without any special + * hack in the PL handler. Whatever value the PL thinks it's returning + * will just be ignored. + */ +Datum +void_in(PG_FUNCTION_ARGS) +{ + PG_RETURN_VOID(); /* you were expecting something different? */ +} + +/* + * void_out - output routine for pseudo-type VOID. + * + * We allow this so that "SELECT function_returning_void(...)" works. + */ +Datum +void_out(PG_FUNCTION_ARGS) +{ + PG_RETURN_CSTRING(pstrdup("")); +} + + +/* + * trigger_in - input routine for pseudo-type TRIGGER. + */ +Datum +trigger_in(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot accept a constant of type %s", "TRIGGER"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * trigger_out - output routine for pseudo-type TRIGGER. + */ +Datum +trigger_out(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot display a value of type %s", "TRIGGER"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * language_handler_in - input routine for pseudo-type LANGUAGE_HANDLER. + */ +Datum +language_handler_in(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot accept a constant of type %s", "LANGUAGE_HANDLER"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * language_handler_out - output routine for pseudo-type LANGUAGE_HANDLER. + */ +Datum +language_handler_out(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot display a value of type %s", "LANGUAGE_HANDLER"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * internal_in - input routine for pseudo-type INTERNAL. + */ +Datum +internal_in(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot accept a constant of type %s", "INTERNAL"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * internal_out - output routine for pseudo-type INTERNAL. + */ +Datum +internal_out(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot display a value of type %s", "INTERNAL"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + + +/* + * opaque_in - input routine for pseudo-type OPAQUE. + */ +Datum +opaque_in(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot accept a constant of type %s", "OPAQUE"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} + +/* + * opaque_out - output routine for pseudo-type OPAQUE. + */ +Datum +opaque_out(PG_FUNCTION_ARGS) +{ + elog(ERROR, "Cannot display a value of type %s", "OPAQUE"); + + PG_RETURN_VOID(); /* keep compiler quiet */ +} diff --git a/src/backend/utils/adt/regproc.c b/src/backend/utils/adt/regproc.c index 42dd50ccd70..c99685d675f 100644 --- a/src/backend/utils/adt/regproc.c +++ b/src/backend/utils/adt/regproc.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.72 2002/07/29 22:14:11 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.73 2002/08/22 00:01:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -38,7 +38,7 @@ #include "utils/syscache.h" static void parseNameAndArgTypes(const char *string, const char *caller, - const char *type0_spelling, + bool allowNone, List **names, int *nargs, Oid *argtypes); @@ -260,7 +260,7 @@ regprocedurein(PG_FUNCTION_ARGS) * datatype cannot be used for any system column that needs to receive * data during bootstrap. */ - parseNameAndArgTypes(pro_name_or_oid, "regprocedurein", "opaque", + parseNameAndArgTypes(pro_name_or_oid, "regprocedurein", false, &names, &nargs, argtypes); clist = FuncnameGetCandidates(names, nargs); @@ -325,10 +325,7 @@ format_procedure(Oid procedure_oid) if (i > 0) appendStringInfoChar(&buf, ','); - if (OidIsValid(thisargtype)) - appendStringInfo(&buf, "%s", format_type_be(thisargtype)); - else - appendStringInfo(&buf, "opaque"); + appendStringInfo(&buf, "%s", format_type_be(thisargtype)); } appendStringInfoChar(&buf, ')'); @@ -584,7 +581,7 @@ regoperatorin(PG_FUNCTION_ARGS) * datatype cannot be used for any system column that needs to receive * data during bootstrap. */ - parseNameAndArgTypes(opr_name_or_oid, "regoperatorin", "none", + parseNameAndArgTypes(opr_name_or_oid, "regoperatorin", true, &names, &nargs, argtypes); if (nargs == 1) elog(ERROR, "regoperatorin: use NONE to denote the missing argument of a unary operator"); @@ -1036,12 +1033,12 @@ stringToQualifiedNameList(const char *string, const char *caller) * the argtypes array should be of size FUNC_MAX_ARGS). The function or * operator name is returned to *names as a List of Strings. * - * If type0_spelling is not NULL, it is a name to be accepted as a - * placeholder for OID 0. + * If allowNone is TRUE, accept "NONE" and return it as InvalidOid (this is + * for unary operators). */ static void parseNameAndArgTypes(const char *string, const char *caller, - const char *type0_spelling, + bool allowNone, List **names, int *nargs, Oid *argtypes) { char *rawname; @@ -1147,9 +1144,9 @@ parseNameAndArgTypes(const char *string, const char *caller, *ptr2 = '\0'; } - if (type0_spelling && strcasecmp(typename, type0_spelling) == 0) + if (allowNone && strcasecmp(typename, "none") == 0) { - /* Special case for OPAQUE or NONE */ + /* Special case for NONE */ typeid = InvalidOid; typmod = -1; } diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c index 10fc2d29e03..986c7659f2c 100644 --- a/src/backend/utils/adt/selfuncs.c +++ b/src/backend/utils/adt/selfuncs.c @@ -15,7 +15,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.112 2002/06/20 20:29:38 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.113 2002/08/22 00:01:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,7 +53,7 @@ * * This is represented at the SQL level (in pg_proc) as * - * float8 oprrest (opaque, oid, opaque, int4); + * float8 oprrest (internal, oid, internal, int4); * * The call convention for a join estimator (oprjoin function) is similar * except that varRelid is not needed: @@ -62,7 +62,7 @@ * Oid operator, * List *args); * - * float8 oprjoin (opaque, oid, opaque); + * float8 oprjoin (internal, oid, internal); *---------- */ diff --git a/src/backend/utils/cache/lsyscache.c b/src/backend/utils/cache/lsyscache.c index 4c2838e7af7..a916dc94012 100644 --- a/src/backend/utils/cache/lsyscache.c +++ b/src/backend/utils/cache/lsyscache.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.78 2002/08/05 02:30:50 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/lsyscache.c,v 1.79 2002/08/22 00:01:44 tgl Exp $ * * NOTES * Eventually, the index information should go through here, too. @@ -1166,6 +1166,34 @@ get_typtype(Oid typid) return '\0'; } +/* + * getTypeOutputInfo + * + * Get info needed for printing values of a type + * + * Returns true if data valid (a false result probably means it's a shell type) + */ +bool +getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typElem, + bool *typIsVarlena) +{ + HeapTuple typeTuple; + Form_pg_type pt; + + typeTuple = SearchSysCache(TYPEOID, + ObjectIdGetDatum(type), + 0, 0, 0); + if (!HeapTupleIsValid(typeTuple)) + elog(ERROR, "getTypeOutputInfo: Cache lookup of type %u failed", type); + pt = (Form_pg_type) GETSTRUCT(typeTuple); + + *typOutput = pt->typoutput; + *typElem = pt->typelem; + *typIsVarlena = (!pt->typbyval) && (pt->typlen == -1); + ReleaseSysCache(typeTuple); + return OidIsValid(*typOutput); +} + /* ---------- STATISTICS CACHE ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/Makefile b/src/backend/utils/mb/conversion_procs/Makefile index 75436d5dee9..8e843bf44f5 100644 --- a/src/backend/utils/mb/conversion_procs/Makefile +++ b/src/backend/utils/mb/conversion_procs/Makefile @@ -4,7 +4,7 @@ # Makefile for utils/mb/conversion_procs # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.4 2002/08/14 02:45:10 ishii Exp $ +# $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/Makefile,v 1.5 2002/08/22 00:01:44 tgl Exp $ # #------------------------------------------------------------------------- @@ -153,7 +153,7 @@ $(SQLSCRIPT): Makefile func=$$1; shift; \ obj=$$1; shift; \ echo "-- $$se --> $$de"; \ - echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, OPAQUE, OPAQUE, INTEGER) RETURNS INTEGER AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c';"; \ + echo "CREATE OR REPLACE FUNCTION $$func (INTEGER, INTEGER, CSTRING, CSTRING, INTEGER) RETURNS VOID AS '$$"libdir"/$$obj', '$$func' LANGUAGE 'c';"; \ echo "DROP CONVERSION pg_catalog.$$name;"; \ echo "CREATE DEFAULT CONVERSION pg_catalog.$$name FOR '$$se' TO '$$de' FROM $$func;"; \ done > $@ diff --git a/src/backend/utils/mb/conversion_procs/ascii_and_mic/ascii_and_mic.c b/src/backend/utils/mb/conversion_procs/ascii_and_mic/ascii_and_mic.c index ed00f189091..2c827e8990d 100644 --- a/src/backend/utils/mb/conversion_procs/ascii_and_mic/ascii_and_mic.c +++ b/src/backend/utils/mb/conversion_procs/ascii_and_mic/ascii_and_mic.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/ascii_and_mic/ascii_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/ascii_and_mic/ascii_and_mic.c,v 1.2 2002/08/22 00:01:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -25,10 +25,10 @@ extern Datum mic_to_ascii(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c b/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c index b336504edea..a870deec87f 100644 --- a/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c +++ b/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/cyrillic_and_mic/cyrillic_and_mic.c,v 1.2 2002/08/22 00:01:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -63,10 +63,10 @@ extern Datum alt_to_iso(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c b/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c index 29b1442b607..c443aa8a235 100644 --- a/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c +++ b/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_cn_and_mic/euc_cn_and_mic.c,v 1.2 2002/08/22 00:01:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -25,10 +25,10 @@ extern Datum mic_to_euc_cn(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c index a5ae4c6ac68..cc98298986f 100644 --- a/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c +++ b/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_jp_and_sjis/euc_jp_and_sjis.c,v 1.2 2002/08/22 00:01:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -47,10 +47,10 @@ extern Datum mic_to_sjis(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c b/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c index 4c0d09758b5..43e69f7a070 100644 --- a/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c +++ b/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_kr_and_mic/euc_kr_and_mic.c,v 1.2 2002/08/22 00:01:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -25,10 +25,10 @@ extern Datum mic_to_euc_kr(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c index 591f7f38b93..112bdc1a4a7 100644 --- a/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c +++ b/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/euc_tw_and_big5/euc_tw_and_big5.c,v 1.2 2002/08/22 00:01:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -35,10 +35,10 @@ extern Datum mic_to_big5(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c b/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c index 1f75394d04c..f3a6476d4ca 100644 --- a/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c +++ b/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/latin2_and_win1250/latin2_and_win1250.c,v 1.2 2002/08/22 00:01:44 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -35,10 +35,10 @@ extern Datum win1250_to_latin2(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c b/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c index a019fc274ff..e6122f49ae9 100644 --- a/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c +++ b/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/latin_and_mic/latin_and_mic.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -33,10 +33,10 @@ extern Datum mic_to_latin4(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c b/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c index db84f9f05dc..581cebbb5d2 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_ascii/utf8_and_ascii.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -25,10 +25,10 @@ extern Datum utf8_to_ascii(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c b/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c index b40db46665e..7b6c16ac309 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_big5/utf8_and_big5.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_big5(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c b/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c index cc16a46aca8..3135d150331 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_cyrillic/utf8_and_cyrillic.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -39,10 +39,10 @@ extern Datum alt_to_utf8(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c index e5edd24b7bd..b0213011940 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_cn/utf8_and_euc_cn.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_euc_cn(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c index 8d702f391c2..d71af151318 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_jp/utf8_and_euc_jp.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_euc_jp(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c index 9f2761134b5..7833950010e 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_kr/utf8_and_euc_kr.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_euc_kr(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c b/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c index bafa218167e..7a8bff0cb58 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_euc_tw/utf8_and_euc_tw.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_euc_tw(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c b/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c index 4587448a90c..034651501ea 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gb18030/utf8_and_gb18030.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_gb18030(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c b/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c index d81c4d7a187..a6ec76c9eed 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_gbk(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c index 5f270aadb4a..6c373bfa51a 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859/utf8_and_iso8859.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -51,10 +51,10 @@ extern Datum utf8_to_iso8859(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c index 80c91a067db..e66de79ba15 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c,v 1.1 2002/07/16 09:25:05 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -25,10 +25,10 @@ extern Datum utf8_to_iso8859_1(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c b/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c index e05e30e858c..4dbd33fdd0c 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c,v 1.1 2002/07/16 09:25:06 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_johab/utf8_and_johab.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_johab(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c b/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c index 50739f9f093..a460768f216 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c,v 1.1 2002/07/16 09:25:06 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_sjis/utf8_and_sjis.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_sjis(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/utf8_and_tcvn.c b/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/utf8_and_tcvn.c index 7486bcad732..6847458df4c 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/utf8_and_tcvn.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/utf8_and_tcvn.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/Attic/utf8_and_tcvn.c,v 1.1 2002/07/16 09:25:06 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_tcvn/Attic/utf8_and_tcvn.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_tcvn(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c b/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c index 8a8f479c75b..d30f3de3a34 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c,v 1.1 2002/07/16 09:25:06 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_uhc/utf8_and_uhc.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum utf8_to_uhc(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ Datum diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c b/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c index 8e61fce00cb..6b32fe78e2a 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_win1250/utf8_and_win1250.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1250/Attic/utf8_and_win1250.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1250/Attic/utf8_and_win1250.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum win1250_to_utf(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c b/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c index 55818f40bbe..4014330b0a3 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_win1256/utf8_and_win1256.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1256/Attic/utf8_and_win1256.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win1256/Attic/utf8_and_win1256.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum win1256_to_utf(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c b/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c index f343dba6860..9192db3ccf3 100644 --- a/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c +++ b/src/backend/utils/mb/conversion_procs/utf8_and_win874/utf8_and_win874.c @@ -6,7 +6,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win874/Attic/utf8_and_win874.c,v 1.1 2002/08/14 02:45:10 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/mb/conversion_procs/utf8_and_win874/Attic/utf8_and_win874.c,v 1.2 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,10 +27,10 @@ extern Datum win874_to_utf(PG_FUNCTION_ARGS); * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id - * OPAQUE, -- source string (null terminated C string) - * OPAQUE, -- destination string (null terminated C string) + * CSTRING, -- source string (null terminated C string) + * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length - * ) returns INTEGER; -- dummy. returns nothing, actually. + * ) returns VOID; * ---------- */ diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 692087d5efd..b25d466feb6 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -22,7 +22,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.288 2002/08/20 17:54:44 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.289 2002/08/22 00:01:45 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1899,6 +1899,7 @@ getAggregates(int *numAggs) write_msg(NULL, "WARNING: owner of aggregate function \"%s\" appears to be invalid\n", agginfo[i].aggname); agginfo[i].aggacl = strdup(PQgetvalue(res, i, i_aggacl)); + agginfo[i].anybasetype = false; /* computed when it's dumped */ agginfo[i].fmtbasetype = NULL; /* computed when it's dumped */ } @@ -3044,7 +3045,7 @@ dumpOneBaseType(Archive *fout, TypeInfo *tinfo, /* DROP must be fully qualified in case same name appears in pg_catalog */ appendPQExpBuffer(delq, "DROP TYPE %s.", fmtId(tinfo->typnamespace->nspname)); - appendPQExpBuffer(delq, "%s;\n", + appendPQExpBuffer(delq, "%s CASCADE;\n", fmtId(tinfo->typname)); appendPQExpBuffer(q, @@ -4502,7 +4503,6 @@ static char * format_aggregate_signature(AggInfo *agginfo, Archive *fout, bool honor_quotes) { PQExpBufferData buf; - bool anybasetype; initPQExpBuffer(&buf); if (honor_quotes) @@ -4511,19 +4511,17 @@ format_aggregate_signature(AggInfo *agginfo, Archive *fout, bool honor_quotes) else appendPQExpBuffer(&buf, "%s", agginfo->aggname); - anybasetype = (strcmp(agginfo->aggbasetype, "0") == 0); - /* If using regtype or format_type, fmtbasetype is already quoted */ if (fout->remoteVersion >= 70100) { - if (anybasetype) + if (agginfo->anybasetype) appendPQExpBuffer(&buf, "(*)"); else appendPQExpBuffer(&buf, "(%s)", agginfo->fmtbasetype); } else { - if (anybasetype) + if (agginfo->anybasetype) appendPQExpBuffer(&buf, "(*)"); else appendPQExpBuffer(&buf, "(%s)", @@ -4568,6 +4566,7 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) int i_aggfinalfn; int i_aggtranstype; int i_agginitval; + int i_anybasetype; int i_fmtbasetype; int i_convertok; const char *aggtransfn; @@ -4575,7 +4574,6 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) const char *aggtranstype; const char *agginitval; bool convertok; - bool anybasetype; /* Make sure we are in proper schema */ selectSourceSchema(agginfo->aggnamespace->nspname); @@ -4586,6 +4584,7 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) appendPQExpBuffer(query, "SELECT aggtransfn, " "aggfinalfn, aggtranstype::pg_catalog.regtype, " "agginitval, " + "proargtypes[0] = 'pg_catalog.\"any\"'::pg_catalog.regtype as anybasetype, " "proargtypes[0]::pg_catalog.regtype as fmtbasetype, " "'t'::boolean as convertok " "from pg_catalog.pg_aggregate a, pg_catalog.pg_proc p " @@ -4598,6 +4597,7 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) appendPQExpBuffer(query, "SELECT aggtransfn, aggfinalfn, " "format_type(aggtranstype, NULL) as aggtranstype, " "agginitval, " + "aggbasetype = 0 as anybasetype, " "CASE WHEN aggbasetype = 0 THEN '-' " "ELSE format_type(aggbasetype, NULL) END as fmtbasetype, " "'t'::boolean as convertok " @@ -4611,6 +4611,7 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) "aggfinalfn, " "(select typname from pg_type where oid = aggtranstype1) as aggtranstype, " "agginitval1 as agginitval, " + "aggbasetype = 0 as anybasetype, " "(select typname from pg_type where oid = aggbasetype) as fmtbasetype, " "(aggtransfn2 = 0 and aggtranstype2 = 0 and agginitval2 is null) as convertok " "from pg_aggregate " @@ -4640,6 +4641,7 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) i_aggfinalfn = PQfnumber(res, "aggfinalfn"); i_aggtranstype = PQfnumber(res, "aggtranstype"); i_agginitval = PQfnumber(res, "agginitval"); + i_anybasetype = PQfnumber(res, "anybasetype"); i_fmtbasetype = PQfnumber(res, "fmtbasetype"); i_convertok = PQfnumber(res, "convertok"); @@ -4647,6 +4649,8 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) aggfinalfn = PQgetvalue(res, 0, i_aggfinalfn); aggtranstype = PQgetvalue(res, 0, i_aggtranstype); agginitval = PQgetvalue(res, 0, i_agginitval); + /* we save anybasetype so that dumpAggACL can use it later */ + agginfo->anybasetype = (PQgetvalue(res, 0, i_anybasetype)[0] == 't'); /* we save fmtbasetype so that dumpAggACL can use it later */ agginfo->fmtbasetype = strdup(PQgetvalue(res, 0, i_fmtbasetype)); convertok = (PQgetvalue(res, 0, i_convertok)[0] == 't'); @@ -4669,13 +4673,12 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) return; } - anybasetype = (strcmp(agginfo->aggbasetype, "0") == 0); - if (g_fout->remoteVersion >= 70300) { /* If using 7.3's regproc or regtype, data is already quoted */ appendPQExpBuffer(details, " BASETYPE = %s,\n SFUNC = %s,\n STYPE = %s", - anybasetype ? "'any'" : agginfo->fmtbasetype, + agginfo->anybasetype ? "'any'" : + agginfo->fmtbasetype, aggtransfn, aggtranstype); } @@ -4683,7 +4686,8 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) { /* format_type quotes, regproc does not */ appendPQExpBuffer(details, " BASETYPE = %s,\n SFUNC = %s,\n STYPE = %s", - anybasetype ? "'any'" : agginfo->fmtbasetype, + agginfo->anybasetype ? "'any'" : + agginfo->fmtbasetype, fmtId(aggtransfn), aggtranstype); } @@ -4691,7 +4695,7 @@ dumpOneAgg(Archive *fout, AggInfo *agginfo) { /* need quotes all around */ appendPQExpBuffer(details, " BASETYPE = %s,\n", - anybasetype ? "'any'" : + agginfo->anybasetype ? "'any'" : fmtId(agginfo->fmtbasetype)); appendPQExpBuffer(details, " SFUNC = %s,\n", fmtId(aggtransfn)); diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h index 060c4396b42..d89a06c1866 100644 --- a/src/bin/pg_dump/pg_dump.h +++ b/src/bin/pg_dump/pg_dump.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_dump.h,v 1.97 2002/08/19 19:33:35 tgl Exp $ + * $Id: pg_dump.h,v 1.98 2002/08/22 00:01:46 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -74,6 +74,7 @@ typedef struct _aggInfo NamespaceInfo *aggnamespace; /* link to containing namespace */ char *usename; char *aggacl; + bool anybasetype; /* is the basetype "any"? */ char *fmtbasetype; /* formatted type name */ } AggInfo; diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 9ba7bcc36fe..538672954ea 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3,7 +3,7 @@ * * Copyright 2000-2002 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.62 2002/08/16 23:01:19 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.63 2002/08/22 00:01:47 tgl Exp $ */ #include "postgres_fe.h" #include "describe.h" @@ -68,13 +68,14 @@ describeAggregates(const char *pattern, bool verbose) /* * There are two kinds of aggregates: ones that work on particular - * types and ones that work on all (denoted by input type = 0) + * types and ones that work on all (denoted by input type = "any") */ printfPQExpBuffer(&buf, "SELECT n.nspname as \"%s\",\n" " p.proname AS \"%s\",\n" " CASE p.proargtypes[0]\n" - " WHEN 0 THEN CAST('%s' AS pg_catalog.text)\n" + " WHEN 'pg_catalog.\"any\"'::pg_catalog.regtype\n" + " THEN CAST('%s' AS pg_catalog.text)\n" " ELSE pg_catalog.format_type(p.proargtypes[0], NULL)\n" " END AS \"%s\",\n" " pg_catalog.obj_description(p.oid, 'pg_proc') as \"%s\"\n" @@ -146,12 +147,11 @@ describeFunctions(const char *pattern, bool verbose) "\n LEFT JOIN pg_catalog.pg_user u ON u.usesysid = p.proowner\n"); /* - * we skip in/out funcs by excluding functions that take some - * arguments, but have no types defined for those arguments + * we skip in/out funcs by excluding functions that take or return cstring */ appendPQExpBuffer(&buf, - "WHERE p.prorettype <> 0\n" - " AND (p.pronargs = 0 OR pg_catalog.oidvectortypes(p.proargtypes) <> '')\n" + "WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype\n" + " AND p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype\n" " AND NOT p.proisagg\n"); processNamePattern(&buf, pattern, true, false, @@ -436,7 +436,10 @@ objectDescription(const char *pattern) " CAST('%s' AS pg_catalog.text) as object\n" " FROM pg_catalog.pg_proc p\n" " LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n" - " WHERE (p.pronargs = 0 or pg_catalog.oidvectortypes(p.proargtypes) <> '') AND NOT p.proisagg\n", + + " WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype\n" + " AND p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype\n" + " AND NOT p.proisagg\n", _("function")); processNamePattern(&buf, pattern, true, false, "n.nspname", "p.proname", NULL, diff --git a/src/bin/scripts/createlang.sh b/src/bin/scripts/createlang.sh index d7a9e98064f..3f0009224d2 100644 --- a/src/bin/scripts/createlang.sh +++ b/src/bin/scripts/createlang.sh @@ -7,7 +7,7 @@ # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.37 2002/08/10 16:57:32 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.38 2002/08/22 00:01:47 tgl Exp $ # #------------------------------------------------------------------------- @@ -270,7 +270,7 @@ fi # Create the call handler and the language # ---------- if [ "$handlerexists" = no ]; then - sqlcmd="CREATE FUNCTION \"$handler\" () RETURNS OPAQUE AS '$PGLIB/${object}' LANGUAGE C;" + sqlcmd="CREATE FUNCTION \"$handler\" () RETURNS LANGUAGE_HANDLER AS '$PGLIB/${object}' LANGUAGE C;" if [ "$showsql" = yes ]; then echo "$sqlcmd" fi diff --git a/src/include/access/printtup.h b/src/include/access/printtup.h index 48c605df744..8eed08bc1bf 100644 --- a/src/include/access/printtup.h +++ b/src/include/access/printtup.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: printtup.h,v 1.20 2002/06/20 20:29:43 momjian Exp $ + * $Id: printtup.h,v 1.21 2002/08/22 00:01:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -27,7 +27,4 @@ extern void debugtup(HeapTuple tuple, TupleDesc typeinfo, extern void spi_printtup(HeapTuple tuple, TupleDesc tupdesc, DestReceiver *self); -extern bool getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typElem, - bool *typIsVarlena); - #endif /* PRINTTUP_H */ diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 979bc6ed033..2eba70c5fd2 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -37,7 +37,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: catversion.h,v 1.150 2002/08/17 13:04:15 momjian Exp $ + * $Id: catversion.h,v 1.151 2002/08/22 00:01:47 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 200208171 +#define CATALOG_VERSION_NO 200208201 #endif diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 6bb82f6a34e..a9fe521845d 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_proc.h,v 1.259 2002/08/20 19:23:07 tgl Exp $ + * $Id: pg_proc.h,v 1.260 2002/08/22 00:01:47 tgl Exp $ * * NOTES * The script catalog/genbki.sh reads this file and generates .bki @@ -93,57 +93,57 @@ typedef FormData_pg_proc *Form_pg_proc; /* OIDS 1 - 99 */ -DATA(insert OID = 1242 ( boolin PGNSP PGUID 12 f f t f i 1 16 "0" boolin - _null_ )); +DATA(insert OID = 1242 ( boolin PGNSP PGUID 12 f f t f i 1 16 "2275" boolin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1243 ( boolout PGNSP PGUID 12 f f t f i 1 23 "0" boolout - _null_ )); +DATA(insert OID = 1243 ( boolout PGNSP PGUID 12 f f t f i 1 2275 "16" boolout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1244 ( byteain PGNSP PGUID 12 f f t f i 1 17 "0" byteain - _null_ )); +DATA(insert OID = 1244 ( byteain PGNSP PGUID 12 f f t f i 1 17 "2275" byteain - _null_ )); DESCR("(internal)"); -DATA(insert OID = 31 ( byteaout PGNSP PGUID 12 f f t f i 1 23 "0" byteaout - _null_ )); +DATA(insert OID = 31 ( byteaout PGNSP PGUID 12 f f t f i 1 2275 "17" byteaout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1245 ( charin PGNSP PGUID 12 f f t f i 1 18 "0" charin - _null_ )); +DATA(insert OID = 1245 ( charin PGNSP PGUID 12 f f t f i 1 18 "2275" charin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 33 ( charout PGNSP PGUID 12 f f t f i 1 23 "0" charout - _null_ )); +DATA(insert OID = 33 ( charout PGNSP PGUID 12 f f t f i 1 2275 "18" charout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 34 ( namein PGNSP PGUID 12 f f t f i 1 19 "0" namein - _null_ )); +DATA(insert OID = 34 ( namein PGNSP PGUID 12 f f t f i 1 19 "2275" namein - _null_ )); DESCR("(internal)"); -DATA(insert OID = 35 ( nameout PGNSP PGUID 12 f f t f i 1 23 "0" nameout - _null_ )); +DATA(insert OID = 35 ( nameout PGNSP PGUID 12 f f t f i 1 2275 "19" nameout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 38 ( int2in PGNSP PGUID 12 f f t f i 1 21 "0" int2in - _null_ )); +DATA(insert OID = 38 ( int2in PGNSP PGUID 12 f f t f i 1 21 "2275" int2in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 39 ( int2out PGNSP PGUID 12 f f t f i 1 23 "0" int2out - _null_ )); +DATA(insert OID = 39 ( int2out PGNSP PGUID 12 f f t f i 1 2275 "21" int2out - _null_ )); DESCR("(internal)"); -DATA(insert OID = 40 ( int2vectorin PGNSP PGUID 12 f f t f i 1 22 "0" int2vectorin - _null_ )); +DATA(insert OID = 40 ( int2vectorin PGNSP PGUID 12 f f t f i 1 22 "2275" int2vectorin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 41 ( int2vectorout PGNSP PGUID 12 f f t f i 1 23 "0" int2vectorout - _null_ )); +DATA(insert OID = 41 ( int2vectorout PGNSP PGUID 12 f f t f i 1 2275 "22" int2vectorout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 42 ( int4in PGNSP PGUID 12 f f t f i 1 23 "0" int4in - _null_ )); +DATA(insert OID = 42 ( int4in PGNSP PGUID 12 f f t f i 1 23 "2275" int4in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 43 ( int4out PGNSP PGUID 12 f f t f i 1 23 "0" int4out - _null_ )); +DATA(insert OID = 43 ( int4out PGNSP PGUID 12 f f t f i 1 2275 "23" int4out - _null_ )); DESCR("(internal)"); -DATA(insert OID = 44 ( regprocin PGNSP PGUID 12 f f t f s 1 24 "0" regprocin - _null_ )); +DATA(insert OID = 44 ( regprocin PGNSP PGUID 12 f f t f s 1 24 "2275" regprocin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 45 ( regprocout PGNSP PGUID 12 f f t f s 1 23 "0" regprocout - _null_ )); +DATA(insert OID = 45 ( regprocout PGNSP PGUID 12 f f t f s 1 2275 "24" regprocout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 46 ( textin PGNSP PGUID 12 f f t f i 1 25 "0" textin - _null_ )); +DATA(insert OID = 46 ( textin PGNSP PGUID 12 f f t f i 1 25 "2275" textin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 47 ( textout PGNSP PGUID 12 f f t f i 1 23 "0" textout - _null_ )); +DATA(insert OID = 47 ( textout PGNSP PGUID 12 f f t f i 1 2275 "25" textout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 48 ( tidin PGNSP PGUID 12 f f t f i 1 27 "0" tidin - _null_ )); +DATA(insert OID = 48 ( tidin PGNSP PGUID 12 f f t f i 1 27 "2275" tidin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 49 ( tidout PGNSP PGUID 12 f f t f i 1 23 "0" tidout - _null_ )); +DATA(insert OID = 49 ( tidout PGNSP PGUID 12 f f t f i 1 2275 "27" tidout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 50 ( xidin PGNSP PGUID 12 f f t f i 1 28 "0" xidin - _null_ )); +DATA(insert OID = 50 ( xidin PGNSP PGUID 12 f f t f i 1 28 "2275" xidin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 51 ( xidout PGNSP PGUID 12 f f t f i 1 23 "0" xidout - _null_ )); +DATA(insert OID = 51 ( xidout PGNSP PGUID 12 f f t f i 1 2275 "28" xidout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 52 ( cidin PGNSP PGUID 12 f f t f i 1 29 "0" cidin - _null_ )); +DATA(insert OID = 52 ( cidin PGNSP PGUID 12 f f t f i 1 29 "2275" cidin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 53 ( cidout PGNSP PGUID 12 f f t f i 1 23 "0" cidout - _null_ )); +DATA(insert OID = 53 ( cidout PGNSP PGUID 12 f f t f i 1 2275 "29" cidout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 54 ( oidvectorin PGNSP PGUID 12 f f t f i 1 30 "0" oidvectorin - _null_ )); +DATA(insert OID = 54 ( oidvectorin PGNSP PGUID 12 f f t f i 1 30 "2275" oidvectorin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 55 ( oidvectorout PGNSP PGUID 12 f f t f i 1 23 "0" oidvectorout - _null_ )); +DATA(insert OID = 55 ( oidvectorout PGNSP PGUID 12 f f t f i 1 2275 "30" oidvectorout - _null_ )); DESCR("(internal)"); DATA(insert OID = 56 ( boollt PGNSP PGUID 12 f f t f i 2 16 "16 16" boollt - _null_ )); DESCR("less-than"); @@ -210,26 +210,26 @@ DESCR("PostgreSQL version string"); DATA(insert OID = 100 ( int8fac PGNSP PGUID 12 f f t f i 1 20 "20" int8fac - _null_ )); DESCR("factorial"); -DATA(insert OID = 101 ( eqsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" eqsel - _null_ )); +DATA(insert OID = 101 ( eqsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" eqsel - _null_ )); DESCR("restriction selectivity of = and related operators"); -DATA(insert OID = 102 ( neqsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" neqsel - _null_ )); +DATA(insert OID = 102 ( neqsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" neqsel - _null_ )); DESCR("restriction selectivity of <> and related operators"); -DATA(insert OID = 103 ( scalarltsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" scalarltsel - _null_ )); +DATA(insert OID = 103 ( scalarltsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" scalarltsel - _null_ )); DESCR("restriction selectivity of < and related operators on scalar datatypes"); -DATA(insert OID = 104 ( scalargtsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" scalargtsel - _null_ )); +DATA(insert OID = 104 ( scalargtsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" scalargtsel - _null_ )); DESCR("restriction selectivity of > and related operators on scalar datatypes"); -DATA(insert OID = 105 ( eqjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" eqjoinsel - _null_ )); +DATA(insert OID = 105 ( eqjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" eqjoinsel - _null_ )); DESCR("join selectivity of = and related operators"); -DATA(insert OID = 106 ( neqjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" neqjoinsel - _null_ )); +DATA(insert OID = 106 ( neqjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" neqjoinsel - _null_ )); DESCR("join selectivity of <> and related operators"); -DATA(insert OID = 107 ( scalarltjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" scalarltjoinsel - _null_ )); +DATA(insert OID = 107 ( scalarltjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" scalarltjoinsel - _null_ )); DESCR("join selectivity of < and related operators on scalar datatypes"); -DATA(insert OID = 108 ( scalargtjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" scalargtjoinsel - _null_ )); +DATA(insert OID = 108 ( scalargtjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" scalargtjoinsel - _null_ )); DESCR("join selectivity of > and related operators on scalar datatypes"); -DATA(insert OID = 109 ( unknownin PGNSP PGUID 12 f f t f i 1 705 "0" unknownin - _null_ )); +DATA(insert OID = 109 ( unknownin PGNSP PGUID 12 f f t f i 1 705 "2275" unknownin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 110 ( unknownout PGNSP PGUID 12 f f t f i 1 23 "0" unknownout - _null_ )); +DATA(insert OID = 110 ( unknownout PGNSP PGUID 12 f f t f i 1 2275 "705" unknownout - _null_ )); DESCR("(internal)"); DATA(insert OID = 112 ( text PGNSP PGUID 12 f f t f i 1 25 "23" int4_text - _null_ )); @@ -244,21 +244,21 @@ DESCR("is above"); DATA(insert OID = 116 ( box_below PGNSP PGUID 12 f f t f i 2 16 "603 603" box_below - _null_ )); DESCR("is below"); -DATA(insert OID = 117 ( point_in PGNSP PGUID 12 f f t f i 1 600 "0" point_in - _null_ )); +DATA(insert OID = 117 ( point_in PGNSP PGUID 12 f f t f i 1 600 "2275" point_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 118 ( point_out PGNSP PGUID 12 f f t f i 1 23 "600" point_out - _null_ )); +DATA(insert OID = 118 ( point_out PGNSP PGUID 12 f f t f i 1 2275 "600" point_out - _null_ )); DESCR("(internal)"); -DATA(insert OID = 119 ( lseg_in PGNSP PGUID 12 f f t f i 1 601 "0" lseg_in - _null_ )); +DATA(insert OID = 119 ( lseg_in PGNSP PGUID 12 f f t f i 1 601 "2275" lseg_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 120 ( lseg_out PGNSP PGUID 12 f f t f i 1 23 "0" lseg_out - _null_ )); +DATA(insert OID = 120 ( lseg_out PGNSP PGUID 12 f f t f i 1 2275 "601" lseg_out - _null_ )); DESCR("(internal)"); -DATA(insert OID = 121 ( path_in PGNSP PGUID 12 f f t f i 1 602 "0" path_in - _null_ )); +DATA(insert OID = 121 ( path_in PGNSP PGUID 12 f f t f i 1 602 "2275" path_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 122 ( path_out PGNSP PGUID 12 f f t f i 1 23 "0" path_out - _null_ )); +DATA(insert OID = 122 ( path_out PGNSP PGUID 12 f f t f i 1 2275 "602" path_out - _null_ )); DESCR("(internal)"); -DATA(insert OID = 123 ( box_in PGNSP PGUID 12 f f t f i 1 603 "0" box_in - _null_ )); +DATA(insert OID = 123 ( box_in PGNSP PGUID 12 f f t f i 1 603 "2275" box_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 124 ( box_out PGNSP PGUID 12 f f t f i 1 23 "0" box_out - _null_ )); +DATA(insert OID = 124 ( box_out PGNSP PGUID 12 f f t f i 1 2275 "603" box_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 125 ( box_overlap PGNSP PGUID 12 f f t f i 2 16 "603 603" box_overlap - _null_ )); DESCR("overlaps"); @@ -288,9 +288,9 @@ DATA(insert OID = 137 ( on_ppath PGNSP PGUID 12 f f t f i 2 16 "600 602" o DESCR("contained in"); DATA(insert OID = 138 ( box_center PGNSP PGUID 12 f f t f i 1 600 "603" box_center - _null_ )); DESCR("center of"); -DATA(insert OID = 139 ( areasel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" areasel - _null_ )); +DATA(insert OID = 139 ( areasel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" areasel - _null_ )); DESCR("restriction selectivity for area-comparison operators"); -DATA(insert OID = 140 ( areajoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" areajoinsel - _null_ )); +DATA(insert OID = 140 ( areajoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" areajoinsel - _null_ )); DESCR("join selectivity for area-comparison operators"); DATA(insert OID = 141 ( int4mul PGNSP PGUID 12 f f t f i 2 23 "23 23" int4mul - _null_ )); DESCR("multiply"); @@ -411,9 +411,9 @@ DESCR("r-tree"); /* OIDS 200 - 299 */ -DATA(insert OID = 200 ( float4in PGNSP PGUID 12 f f t f i 1 700 "0" float4in - _null_ )); +DATA(insert OID = 200 ( float4in PGNSP PGUID 12 f f t f i 1 700 "2275" float4in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 201 ( float4out PGNSP PGUID 12 f f t f i 1 23 "700" float4out - _null_ )); +DATA(insert OID = 201 ( float4out PGNSP PGUID 12 f f t f i 1 2275 "700" float4out - _null_ )); DESCR("(internal)"); DATA(insert OID = 202 ( float4mul PGNSP PGUID 12 f f t f i 2 700 "700 700" float4mul - _null_ )); DESCR("multiply"); @@ -439,9 +439,9 @@ DESCR("negate"); DATA(insert OID = 213 ( int2um PGNSP PGUID 12 f f t f i 1 21 "21" int2um - _null_ )); DESCR("negate"); -DATA(insert OID = 214 ( float8in PGNSP PGUID 12 f f t f i 1 701 "0" float8in - _null_ )); +DATA(insert OID = 214 ( float8in PGNSP PGUID 12 f f t f i 1 701 "2275" float8in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 215 ( float8out PGNSP PGUID 12 f f t f i 1 23 "701" float8out - _null_ )); +DATA(insert OID = 215 ( float8out PGNSP PGUID 12 f f t f i 1 2275 "701" float8out - _null_ )); DESCR("(internal)"); DATA(insert OID = 216 ( float8mul PGNSP PGUID 12 f f t f i 2 701 "701 701" float8mul - _null_ )); DESCR("multiply"); @@ -494,27 +494,27 @@ DESCR("convert float4 to int2"); DATA(insert OID = 239 ( line_distance PGNSP PGUID 12 f f t f i 2 701 "628 628" line_distance - _null_ )); DESCR("distance between"); -DATA(insert OID = 240 ( nabstimein PGNSP PGUID 12 f f t f s 1 702 "0" nabstimein - _null_ )); +DATA(insert OID = 240 ( nabstimein PGNSP PGUID 12 f f t f s 1 702 "2275" nabstimein - _null_ )); DESCR("(internal)"); -DATA(insert OID = 241 ( nabstimeout PGNSP PGUID 12 f f t f s 1 23 "0" nabstimeout - _null_ )); +DATA(insert OID = 241 ( nabstimeout PGNSP PGUID 12 f f t f s 1 2275 "702" nabstimeout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 242 ( reltimein PGNSP PGUID 12 f f t f s 1 703 "0" reltimein - _null_ )); +DATA(insert OID = 242 ( reltimein PGNSP PGUID 12 f f t f s 1 703 "2275" reltimein - _null_ )); DESCR("(internal)"); -DATA(insert OID = 243 ( reltimeout PGNSP PGUID 12 f f t f s 1 23 "0" reltimeout - _null_ )); +DATA(insert OID = 243 ( reltimeout PGNSP PGUID 12 f f t f s 1 2275 "703" reltimeout - _null_ )); DESCR("(internal)"); DATA(insert OID = 244 ( timepl PGNSP PGUID 12 f f t f i 2 702 "702 703" timepl - _null_ )); DESCR("add"); DATA(insert OID = 245 ( timemi PGNSP PGUID 12 f f t f i 2 702 "702 703" timemi - _null_ )); DESCR("subtract"); -DATA(insert OID = 246 ( tintervalin PGNSP PGUID 12 f f t f s 1 704 "0" tintervalin - _null_ )); +DATA(insert OID = 246 ( tintervalin PGNSP PGUID 12 f f t f s 1 704 "2275" tintervalin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 247 ( tintervalout PGNSP PGUID 12 f f t f s 1 23 "0" tintervalout - _null_ )); +DATA(insert OID = 247 ( tintervalout PGNSP PGUID 12 f f t f s 1 2275 "704" tintervalout - _null_ )); DESCR("(internal)"); DATA(insert OID = 248 ( intinterval PGNSP PGUID 12 f f t f i 2 16 "702 704" intinterval - _null_ )); DESCR("abstime in tinterval"); DATA(insert OID = 249 ( tintervalrel PGNSP PGUID 12 f f t f i 1 703 "704" tintervalrel - _null_ )); DESCR(""); -DATA(insert OID = 250 ( timenow PGNSP PGUID 12 f f t f s 0 702 "0" timenow - _null_ )); +DATA(insert OID = 250 ( timenow PGNSP PGUID 12 f f t f s 0 702 "" timenow - _null_ )); DESCR("Current date and time (abstime)"); DATA(insert OID = 251 ( abstimeeq PGNSP PGUID 12 f f t f i 2 16 "702 702" abstimeeq - _null_ )); DESCR("equal"); @@ -562,7 +562,7 @@ DATA(insert OID = 272 ( tintervalstart PGNSP PGUID 12 f f t f i 1 702 "704" DESCR("start of interval"); DATA(insert OID = 273 ( tintervalend PGNSP PGUID 12 f f t f i 1 702 "704" tintervalend - _null_ )); DESCR(""); -DATA(insert OID = 274 ( timeofday PGNSP PGUID 12 f f t f v 0 25 "0" timeofday - _null_ )); +DATA(insert OID = 274 ( timeofday PGNSP PGUID 12 f f t f v 0 25 "" timeofday - _null_ )); DESCR("Current date and time - increments during transactions"); DATA(insert OID = 275 ( isfinite PGNSP PGUID 12 f f t f i 1 16 "702" abstime_finite - _null_ )); DESCR(""); @@ -665,46 +665,46 @@ DESCR("convert int4 to float4"); DATA(insert OID = 319 ( int4 PGNSP PGUID 12 f f t f i 1 23 "700" ftoi4 - _null_ )); DESCR("convert float4 to int4"); -DATA(insert OID = 320 ( rtinsert PGNSP PGUID 12 f f t f v 6 23 "0 0 0 0 0 0" rtinsert - _null_ )); +DATA(insert OID = 320 ( rtinsert PGNSP PGUID 12 f f t f v 6 23 "2281 2281 2281 2281 2281 2281" rtinsert - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 322 ( rtgettuple PGNSP PGUID 12 f f t f v 2 23 "0 0" rtgettuple - _null_ )); +DATA(insert OID = 322 ( rtgettuple PGNSP PGUID 12 f f t f v 2 23 "2281 2281" rtgettuple - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 323 ( rtbuild PGNSP PGUID 12 f f t f v 3 23 "0 0 0" rtbuild - _null_ )); +DATA(insert OID = 323 ( rtbuild PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" rtbuild - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 324 ( rtbeginscan PGNSP PGUID 12 f f t f v 3 23 "0 0 0" rtbeginscan - _null_ )); +DATA(insert OID = 324 ( rtbeginscan PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" rtbeginscan - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 325 ( rtendscan PGNSP PGUID 12 f f t f v 1 23 "0" rtendscan - _null_ )); +DATA(insert OID = 325 ( rtendscan PGNSP PGUID 12 f f t f v 1 23 "2281" rtendscan - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 326 ( rtmarkpos PGNSP PGUID 12 f f t f v 1 23 "0" rtmarkpos - _null_ )); +DATA(insert OID = 326 ( rtmarkpos PGNSP PGUID 12 f f t f v 1 23 "2281" rtmarkpos - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 327 ( rtrestrpos PGNSP PGUID 12 f f t f v 1 23 "0" rtrestrpos - _null_ )); +DATA(insert OID = 327 ( rtrestrpos PGNSP PGUID 12 f f t f v 1 23 "2281" rtrestrpos - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 328 ( rtrescan PGNSP PGUID 12 f f t f v 2 23 "0 0" rtrescan - _null_ )); +DATA(insert OID = 328 ( rtrescan PGNSP PGUID 12 f f t f v 2 23 "2281 2281" rtrescan - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 321 ( rtbulkdelete PGNSP PGUID 12 f f t f v 3 23 "0 0 0" rtbulkdelete - _null_ )); +DATA(insert OID = 321 ( rtbulkdelete PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" rtbulkdelete - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 1265 ( rtcostestimate PGNSP PGUID 12 f f t f v 8 0 "0 0 0 0 0 0 0 0" rtcostestimate - _null_ )); +DATA(insert OID = 1265 ( rtcostestimate PGNSP PGUID 12 f f t f v 8 2278 "2281 2281 2281 2281 2281 2281 2281 2281" rtcostestimate - _null_ )); DESCR("r-tree(internal)"); -DATA(insert OID = 330 ( btgettuple PGNSP PGUID 12 f f t f v 2 23 "0 0" btgettuple - _null_ )); +DATA(insert OID = 330 ( btgettuple PGNSP PGUID 12 f f t f v 2 23 "2281 2281" btgettuple - _null_ )); DESCR("btree(internal)"); -DATA(insert OID = 331 ( btinsert PGNSP PGUID 12 f f t f v 6 23 "0 0 0 0 0 0" btinsert - _null_ )); +DATA(insert OID = 331 ( btinsert PGNSP PGUID 12 f f t f v 6 23 "2281 2281 2281 2281 2281 2281" btinsert - _null_ )); DESCR("btree(internal)"); -DATA(insert OID = 333 ( btbeginscan PGNSP PGUID 12 f f t f v 3 23 "0 0 0" btbeginscan - _null_ )); +DATA(insert OID = 333 ( btbeginscan PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" btbeginscan - _null_ )); DESCR("btree(internal)"); -DATA(insert OID = 334 ( btrescan PGNSP PGUID 12 f f t f v 2 23 "0 0" btrescan - _null_ )); +DATA(insert OID = 334 ( btrescan PGNSP PGUID 12 f f t f v 2 23 "2281 2281" btrescan - _null_ )); DESCR("btree(internal)"); -DATA(insert OID = 335 ( btendscan PGNSP PGUID 12 f f t f v 1 23 "0" btendscan - _null_ )); +DATA(insert OID = 335 ( btendscan PGNSP PGUID 12 f f t f v 1 23 "2281" btendscan - _null_ )); DESCR("btree(internal)"); -DATA(insert OID = 336 ( btmarkpos PGNSP PGUID 12 f f t f v 1 23 "0" btmarkpos - _null_ )); +DATA(insert OID = 336 ( btmarkpos PGNSP PGUID 12 f f t f v 1 23 "2281" btmarkpos - _null_ )); DESCR("btree(internal)"); -DATA(insert OID = 337 ( btrestrpos PGNSP PGUID 12 f f t f v 1 23 "0" btrestrpos - _null_ )); +DATA(insert OID = 337 ( btrestrpos PGNSP PGUID 12 f f t f v 1 23 "2281" btrestrpos - _null_ )); DESCR("btree(internal)"); -DATA(insert OID = 338 ( btbuild PGNSP PGUID 12 f f t f v 3 23 "0 0 0" btbuild - _null_ )); +DATA(insert OID = 338 ( btbuild PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" btbuild - _null_ )); DESCR("btree(internal)"); -DATA(insert OID = 332 ( btbulkdelete PGNSP PGUID 12 f f t f v 3 23 "0 0 0" btbulkdelete - _null_ )); +DATA(insert OID = 332 ( btbulkdelete PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" btbulkdelete - _null_ )); DESCR("btree(internal)"); -DATA(insert OID = 1268 ( btcostestimate PGNSP PGUID 12 f f t f v 8 0 "0 0 0 0 0 0 0 0" btcostestimate - _null_ )); +DATA(insert OID = 1268 ( btcostestimate PGNSP PGUID 12 f f t f v 8 2278 "2281 2281 2281 2281 2281 2281 2281 2281" btcostestimate - _null_ )); DESCR("btree(internal)"); DATA(insert OID = 339 ( poly_same PGNSP PGUID 12 f f t f i 2 16 "604 604" poly_same - _null_ )); @@ -723,9 +723,9 @@ DATA(insert OID = 345 ( poly_contained PGNSP PGUID 12 f f t f i 2 16 "604 60 DESCR("contained in"); DATA(insert OID = 346 ( poly_overlap PGNSP PGUID 12 f f t f i 2 16 "604 604" poly_overlap - _null_ )); DESCR("overlaps"); -DATA(insert OID = 347 ( poly_in PGNSP PGUID 12 f f t f i 1 604 "0" poly_in - _null_ )); +DATA(insert OID = 347 ( poly_in PGNSP PGUID 12 f f t f i 1 604 "2275" poly_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 348 ( poly_out PGNSP PGUID 12 f f t f i 1 23 "0" poly_out - _null_ )); +DATA(insert OID = 348 ( poly_out PGNSP PGUID 12 f f t f i 1 2275 "604" poly_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 350 ( btint2cmp PGNSP PGUID 12 f f t f i 2 23 "21 21" btint2cmp - _null_ )); @@ -789,25 +789,25 @@ DESCR("convert name to char()"); DATA(insert OID = 409 ( name PGNSP PGUID 12 f f t f i 1 19 "1042" bpchar_name - _null_ )); DESCR("convert char() to name"); -DATA(insert OID = 440 ( hashgettuple PGNSP PGUID 12 f f t f v 2 23 "0 0" hashgettuple - _null_ )); +DATA(insert OID = 440 ( hashgettuple PGNSP PGUID 12 f f t f v 2 23 "2281 2281" hashgettuple - _null_ )); DESCR("hash(internal)"); -DATA(insert OID = 441 ( hashinsert PGNSP PGUID 12 f f t f v 6 23 "0 0 0 0 0 0" hashinsert - _null_ )); +DATA(insert OID = 441 ( hashinsert PGNSP PGUID 12 f f t f v 6 23 "2281 2281 2281 2281 2281 2281" hashinsert - _null_ )); DESCR("hash(internal)"); -DATA(insert OID = 443 ( hashbeginscan PGNSP PGUID 12 f f t f v 3 23 "0 0 0" hashbeginscan - _null_ )); +DATA(insert OID = 443 ( hashbeginscan PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" hashbeginscan - _null_ )); DESCR("hash(internal)"); -DATA(insert OID = 444 ( hashrescan PGNSP PGUID 12 f f t f v 2 23 "0 0" hashrescan - _null_ )); +DATA(insert OID = 444 ( hashrescan PGNSP PGUID 12 f f t f v 2 23 "2281 2281" hashrescan - _null_ )); DESCR("hash(internal)"); -DATA(insert OID = 445 ( hashendscan PGNSP PGUID 12 f f t f v 1 23 "0" hashendscan - _null_ )); +DATA(insert OID = 445 ( hashendscan PGNSP PGUID 12 f f t f v 1 23 "2281" hashendscan - _null_ )); DESCR("hash(internal)"); -DATA(insert OID = 446 ( hashmarkpos PGNSP PGUID 12 f f t f v 1 23 "0" hashmarkpos - _null_ )); +DATA(insert OID = 446 ( hashmarkpos PGNSP PGUID 12 f f t f v 1 23 "2281" hashmarkpos - _null_ )); DESCR("hash(internal)"); -DATA(insert OID = 447 ( hashrestrpos PGNSP PGUID 12 f f t f v 1 23 "0" hashrestrpos - _null_ )); +DATA(insert OID = 447 ( hashrestrpos PGNSP PGUID 12 f f t f v 1 23 "2281" hashrestrpos - _null_ )); DESCR("hash(internal)"); -DATA(insert OID = 448 ( hashbuild PGNSP PGUID 12 f f t f v 3 23 "0 0 0" hashbuild - _null_ )); +DATA(insert OID = 448 ( hashbuild PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" hashbuild - _null_ )); DESCR("hash(internal)"); -DATA(insert OID = 442 ( hashbulkdelete PGNSP PGUID 12 f f t f v 3 23 "0 0 0" hashbulkdelete - _null_ )); +DATA(insert OID = 442 ( hashbulkdelete PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" hashbulkdelete - _null_ )); DESCR("hash(internal)"); -DATA(insert OID = 438 ( hashcostestimate PGNSP PGUID 12 f f t f v 8 0 "0 0 0 0 0 0 0 0" hashcostestimate - _null_ )); +DATA(insert OID = 438 ( hashcostestimate PGNSP PGUID 12 f f t f v 8 2278 "2281 2281 2281 2281 2281 2281 2281 2281" hashcostestimate - _null_ )); DESCR("hash(internal)"); DATA(insert OID = 449 ( hashint2 PGNSP PGUID 12 f f t f i 1 23 "21" hashint2 - _null_ )); @@ -826,7 +826,7 @@ DATA(insert OID = 454 ( hashchar PGNSP PGUID 12 f f t f i 1 23 "18" hashch DESCR("hash"); DATA(insert OID = 455 ( hashname PGNSP PGUID 12 f f t f i 1 23 "19" hashname - _null_ )); DESCR("hash"); -DATA(insert OID = 456 ( hashvarlena PGNSP PGUID 12 f f t f i 1 23 "0" hashvarlena - _null_ )); +DATA(insert OID = 456 ( hashvarlena PGNSP PGUID 12 f f t f i 1 23 "2281" hashvarlena - _null_ )); DESCR("hash any varlena type"); DATA(insert OID = 457 ( hashoidvector PGNSP PGUID 12 f f t f i 1 23 "30" hashoidvector - _null_ )); DESCR("hash"); @@ -837,9 +837,9 @@ DESCR("larger of two"); DATA(insert OID = 459 ( text_smaller PGNSP PGUID 12 f f t f i 2 25 "25 25" text_smaller - _null_ )); DESCR("smaller of two"); -DATA(insert OID = 460 ( int8in PGNSP PGUID 12 f f t f i 1 20 "0" int8in - _null_ )); +DATA(insert OID = 460 ( int8in PGNSP PGUID 12 f f t f i 1 20 "2275" int8in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 461 ( int8out PGNSP PGUID 12 f f t f i 1 23 "0" int8out - _null_ )); +DATA(insert OID = 461 ( int8out PGNSP PGUID 12 f f t f i 1 2275 "20" int8out - _null_ )); DESCR("(internal)"); DATA(insert OID = 462 ( int8um PGNSP PGUID 12 f f t f i 1 20 "20" int8um - _null_ )); DESCR("negate"); @@ -899,10 +899,6 @@ DATA(insert OID = 1285 ( int4notin PGNSP PGUID 12 f f t f s 2 16 "23 25" in DESCR("not in"); DATA(insert OID = 1286 ( oidnotin PGNSP PGUID 12 f f t f s 2 16 "26 25" oidnotin - _null_ )); DESCR("not in"); -DATA(insert OID = 1287 ( int44in PGNSP PGUID 12 f f t f i 1 22 "0" int44in - _null_ )); -DESCR("(internal)"); -DATA(insert OID = 653 ( int44out PGNSP PGUID 12 f f t f i 1 23 "0" int44out - _null_ )); -DESCR("(internal)"); DATA(insert OID = 655 ( namelt PGNSP PGUID 12 f f t f i 2 16 "19 19" namelt - _null_ )); DESCR("less-than"); DATA(insert OID = 656 ( namele PGNSP PGUID 12 f f t f i 2 16 "19 19" namele - _null_ )); @@ -935,7 +931,7 @@ DATA(insert OID = 681 ( oidvectorgt PGNSP PGUID 12 f f t f i 2 16 "30 30" oi DESCR("greater-than"); /* OIDS 700 - 799 */ -DATA(insert OID = 710 ( getpgusername PGNSP PGUID 12 f f t f s 0 19 "0" current_user - _null_ )); +DATA(insert OID = 710 ( getpgusername PGNSP PGUID 12 f f t f s 0 19 "" current_user - _null_ )); DESCR("deprecated -- use current_user"); DATA(insert OID = 711 ( userfntest PGNSP PGUID 12 f f t f i 1 23 "23" userfntest - _null_ )); DESCR(""); @@ -979,24 +975,24 @@ DESCR("greater-than"); DATA(insert OID = 743 ( text_ge PGNSP PGUID 12 f f t f i 2 16 "25 25" text_ge - _null_ )); DESCR("greater-than-or-equal"); -DATA(insert OID = 744 ( array_eq PGNSP PGUID 12 f f t f i 2 16 "0 0" array_eq - _null_ )); +DATA(insert OID = 744 ( array_eq PGNSP PGUID 12 f f t f i 2 16 "2277 2277" array_eq - _null_ )); DESCR("array equal"); -DATA(insert OID = 745 ( current_user PGNSP PGUID 12 f f t f s 0 19 "0" current_user - _null_ )); +DATA(insert OID = 745 ( current_user PGNSP PGUID 12 f f t f s 0 19 "" current_user - _null_ )); DESCR("current user name"); -DATA(insert OID = 746 ( session_user PGNSP PGUID 12 f f t f s 0 19 "0" session_user - _null_ )); +DATA(insert OID = 746 ( session_user PGNSP PGUID 12 f f t f s 0 19 "" session_user - _null_ )); DESCR("session user name"); -DATA(insert OID = 747 ( array_dims PGNSP PGUID 12 f f t f i 1 25 "0" array_dims - _null_ )); +DATA(insert OID = 747 ( array_dims PGNSP PGUID 12 f f t f i 1 25 "2277" array_dims - _null_ )); DESCR("array dimensions"); -DATA(insert OID = 750 ( array_in PGNSP PGUID 12 f f t f i 3 23 "0 26 23" array_in - _null_ )); +DATA(insert OID = 750 ( array_in PGNSP PGUID 12 f f t f i 3 2277 "2275 26 23" array_in - _null_ )); DESCR("array"); -DATA(insert OID = 751 ( array_out PGNSP PGUID 12 f f t f i 2 23 "0 26" array_out - _null_ )); +DATA(insert OID = 751 ( array_out PGNSP PGUID 12 f f t f i 2 2275 "2281 26" array_out - _null_ )); DESCR("array"); -DATA(insert OID = 760 ( smgrin PGNSP PGUID 12 f f t f s 1 210 "0" smgrin - _null_ )); +DATA(insert OID = 760 ( smgrin PGNSP PGUID 12 f f t f s 1 210 "2275" smgrin - _null_ )); DESCR("storage manager(internal)"); -DATA(insert OID = 761 ( smgrout PGNSP PGUID 12 f f t f s 1 23 "0" smgrout - _null_ )); +DATA(insert OID = 761 ( smgrout PGNSP PGUID 12 f f t f s 1 2275 "210" smgrout - _null_ )); DESCR("storage manager(internal)"); DATA(insert OID = 762 ( smgreq PGNSP PGUID 12 f f t f i 2 16 "210 210" smgreq - _null_ )); DESCR("storage manager"); @@ -1019,25 +1015,25 @@ DESCR("larger of two"); DATA(insert OID = 771 ( int2smaller PGNSP PGUID 12 f f t f i 2 21 "21 21" int2smaller - _null_ )); DESCR("smaller of two"); -DATA(insert OID = 774 ( gistgettuple PGNSP PGUID 12 f f t f v 2 23 "0 0" gistgettuple - _null_ )); +DATA(insert OID = 774 ( gistgettuple PGNSP PGUID 12 f f t f v 2 23 "2281 2281" gistgettuple - _null_ )); DESCR("gist(internal)"); -DATA(insert OID = 775 ( gistinsert PGNSP PGUID 12 f f t f v 6 23 "0 0 0 0 0 0" gistinsert - _null_ )); +DATA(insert OID = 775 ( gistinsert PGNSP PGUID 12 f f t f v 6 23 "2281 2281 2281 2281 2281 2281" gistinsert - _null_ )); DESCR("gist(internal)"); -DATA(insert OID = 777 ( gistbeginscan PGNSP PGUID 12 f f t f v 3 23 "0 0 0" gistbeginscan - _null_ )); +DATA(insert OID = 777 ( gistbeginscan PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" gistbeginscan - _null_ )); DESCR("gist(internal)"); -DATA(insert OID = 778 ( gistrescan PGNSP PGUID 12 f f t f v 2 23 "0 0" gistrescan - _null_ )); +DATA(insert OID = 778 ( gistrescan PGNSP PGUID 12 f f t f v 2 23 "2281 2281" gistrescan - _null_ )); DESCR("gist(internal)"); -DATA(insert OID = 779 ( gistendscan PGNSP PGUID 12 f f t f v 1 23 "0" gistendscan - _null_ )); +DATA(insert OID = 779 ( gistendscan PGNSP PGUID 12 f f t f v 1 23 "2281" gistendscan - _null_ )); DESCR("gist(internal)"); -DATA(insert OID = 780 ( gistmarkpos PGNSP PGUID 12 f f t f v 1 23 "0" gistmarkpos - _null_ )); +DATA(insert OID = 780 ( gistmarkpos PGNSP PGUID 12 f f t f v 1 23 "2281" gistmarkpos - _null_ )); DESCR("gist(internal)"); -DATA(insert OID = 781 ( gistrestrpos PGNSP PGUID 12 f f t f v 1 23 "0" gistrestrpos - _null_ )); +DATA(insert OID = 781 ( gistrestrpos PGNSP PGUID 12 f f t f v 1 23 "2281" gistrestrpos - _null_ )); DESCR("gist(internal)"); -DATA(insert OID = 782 ( gistbuild PGNSP PGUID 12 f f t f v 3 23 "0 0 0" gistbuild - _null_ )); +DATA(insert OID = 782 ( gistbuild PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" gistbuild - _null_ )); DESCR("gist(internal)"); -DATA(insert OID = 776 ( gistbulkdelete PGNSP PGUID 12 f f t f v 3 23 "0 0 0" gistbulkdelete - _null_ )); +DATA(insert OID = 776 ( gistbulkdelete PGNSP PGUID 12 f f t f v 3 23 "2281 2281 2281" gistbulkdelete - _null_ )); DESCR("gist(internal)"); -DATA(insert OID = 772 ( gistcostestimate PGNSP PGUID 12 f f t f v 8 0 "0 0 0 0 0 0 0 0" gistcostestimate - _null_ )); +DATA(insert OID = 772 ( gistcostestimate PGNSP PGUID 12 f f t f v 8 2278 "2281 2281 2281 2281 2281 2281 2281 2281" gistcostestimate - _null_ )); DESCR("gist(internal)"); DATA(insert OID = 784 ( tintervaleq PGNSP PGUID 12 f f t f i 2 16 "704 704" tintervaleq - _null_ )); @@ -1106,7 +1102,7 @@ DESCR("does not match LIKE expression"); DATA(insert OID = 860 ( bpchar PGNSP PGUID 12 f f t f i 1 1042 "18" char_bpchar - _null_ )); DESCR("convert char to char()"); -DATA(insert OID = 861 ( current_database PGNSP PGUID 12 f f t f i 0 19 "0" current_database - _null_ )); +DATA(insert OID = 861 ( current_database PGNSP PGUID 12 f f t f i 0 19 "" current_database - _null_ )); DESCR("returns the current database"); DATA(insert OID = 862 ( int4_mul_cash PGNSP PGUID 12 f f t f i 2 790 "23 790" int4_mul_cash - _null_ )); @@ -1122,9 +1118,9 @@ DESCR("multiply"); DATA(insert OID = 867 ( cash_div_int2 PGNSP PGUID 12 f f t f i 2 790 "790 21" cash_div_int2 - _null_ )); DESCR("divide"); -DATA(insert OID = 886 ( cash_in PGNSP PGUID 12 f f t f i 1 790 "0" cash_in - _null_ )); +DATA(insert OID = 886 ( cash_in PGNSP PGUID 12 f f t f i 1 790 "2275" cash_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 887 ( cash_out PGNSP PGUID 12 f f t f i 1 23 "0" cash_out - _null_ )); +DATA(insert OID = 887 ( cash_out PGNSP PGUID 12 f f t f i 1 2275 "790" cash_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 888 ( cash_eq PGNSP PGUID 12 f f t f i 2 16 "790 790" cash_eq - _null_ )); DESCR("equal"); @@ -1279,13 +1275,13 @@ DESCR("convert timetz to text"); DATA(insert OID = 1026 ( timezone PGNSP PGUID 12 f f t f s 2 1186 "1186 1184" timestamptz_izone - _null_ )); DESCR("time zone"); -DATA(insert OID = 1029 ( nullvalue PGNSP PGUID 12 f f f f i 1 16 "0" nullvalue - _null_ )); +DATA(insert OID = 1029 ( nullvalue PGNSP PGUID 12 f f f f i 1 16 "2276" nullvalue - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1030 ( nonnullvalue PGNSP PGUID 12 f f f f i 1 16 "0" nonnullvalue - _null_ )); +DATA(insert OID = 1030 ( nonnullvalue PGNSP PGUID 12 f f f f i 1 16 "2276" nonnullvalue - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1031 ( aclitemin PGNSP PGUID 12 f f t f s 1 1033 "0" aclitemin - _null_ )); +DATA(insert OID = 1031 ( aclitemin PGNSP PGUID 12 f f t f s 1 1033 "2275" aclitemin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1032 ( aclitemout PGNSP PGUID 12 f f t f s 1 23 "1033" aclitemout - _null_ )); +DATA(insert OID = 1032 ( aclitemout PGNSP PGUID 12 f f t f s 1 2275 "1033" aclitemout - _null_ )); DESCR("(internal)"); DATA(insert OID = 1035 ( aclinsert PGNSP PGUID 12 f f t f s 2 1034 "1034 1033" aclinsert - _null_ )); DESCR("add/update ACL item"); @@ -1295,13 +1291,13 @@ DATA(insert OID = 1037 ( aclcontains PGNSP PGUID 12 f f t f s 2 16 "1034 103 DESCR("does ACL contain item?"); DATA(insert OID = 1038 ( seteval PGNSP PGUID 12 f f t t v 1 23 "26" seteval - _null_ )); DESCR("internal function supporting PostQuel-style sets"); -DATA(insert OID = 1044 ( bpcharin PGNSP PGUID 12 f f t f i 3 1042 "0 26 23" bpcharin - _null_ )); +DATA(insert OID = 1044 ( bpcharin PGNSP PGUID 12 f f t f i 3 1042 "2275 26 23" bpcharin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1045 ( bpcharout PGNSP PGUID 12 f f t f i 1 23 "0" bpcharout - _null_ )); +DATA(insert OID = 1045 ( bpcharout PGNSP PGUID 12 f f t f i 1 2275 "1042" bpcharout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1046 ( varcharin PGNSP PGUID 12 f f t f i 3 1043 "0 26 23" varcharin - _null_ )); +DATA(insert OID = 1046 ( varcharin PGNSP PGUID 12 f f t f i 3 1043 "2275 26 23" varcharin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1047 ( varcharout PGNSP PGUID 12 f f t f i 1 23 "0" varcharout - _null_ )); +DATA(insert OID = 1047 ( varcharout PGNSP PGUID 12 f f t f i 1 2275 "1043" varcharout - _null_ )); DESCR("(internal)"); DATA(insert OID = 1048 ( bpchareq PGNSP PGUID 12 f f t f i 2 16 "1042 1042" bpchareq - _null_ )); DESCR("equal"); @@ -1335,9 +1331,9 @@ DATA(insert OID = 1080 ( hashbpchar PGNSP PGUID 12 f f t f i 1 23 "1042" ha DESCR("hash"); DATA(insert OID = 1081 ( format_type PGNSP PGUID 12 f f f f s 2 25 "26 23" format_type - _null_ )); DESCR("format a type oid and atttypmod to canonical SQL"); -DATA(insert OID = 1084 ( date_in PGNSP PGUID 12 f f t f s 1 1082 "0" date_in - _null_ )); +DATA(insert OID = 1084 ( date_in PGNSP PGUID 12 f f t f s 1 1082 "2275" date_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1085 ( date_out PGNSP PGUID 12 f f t f s 1 23 "0" date_out - _null_ )); +DATA(insert OID = 1085 ( date_out PGNSP PGUID 12 f f t f s 1 2275 "1082" date_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1086 ( date_eq PGNSP PGUID 12 f f t f i 2 16 "1082 1082" date_eq - _null_ )); DESCR("equal"); @@ -1378,9 +1374,9 @@ DATA(insert OID = 1141 ( date_pli PGNSP PGUID 12 f f t f i 2 1082 "1082 23" DESCR("add"); DATA(insert OID = 1142 ( date_mii PGNSP PGUID 12 f f t f i 2 1082 "1082 23" date_mii - _null_ )); DESCR("subtract"); -DATA(insert OID = 1143 ( time_in PGNSP PGUID 12 f f t f s 1 1083 "0" time_in - _null_ )); +DATA(insert OID = 1143 ( time_in PGNSP PGUID 12 f f t f s 1 1083 "2275" time_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1144 ( time_out PGNSP PGUID 12 f f t f i 1 23 "0" time_out - _null_ )); +DATA(insert OID = 1144 ( time_out PGNSP PGUID 12 f f t f i 1 2275 "1083" time_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1145 ( time_eq PGNSP PGUID 12 f f t f i 2 16 "1083 1083" time_eq - _null_ )); DESCR("equal"); @@ -1394,9 +1390,9 @@ DESCR("multiply"); DATA(insert OID = 1149 ( circle_div_pt PGNSP PGUID 12 f f t f i 2 718 "718 600" circle_div_pt - _null_ )); DESCR("divide"); -DATA(insert OID = 1150 ( timestamptz_in PGNSP PGUID 12 f f t f s 1 1184 "0" timestamptz_in - _null_ )); +DATA(insert OID = 1150 ( timestamptz_in PGNSP PGUID 12 f f t f s 1 1184 "2275" timestamptz_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1151 ( timestamptz_out PGNSP PGUID 12 f f t f s 1 23 "0" timestamptz_out - _null_ )); +DATA(insert OID = 1151 ( timestamptz_out PGNSP PGUID 12 f f t f s 1 2275 "1184" timestamptz_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1152 ( timestamptz_eq PGNSP PGUID 12 f f t f i 2 16 "1184 1184" timestamp_eq - _null_ )); DESCR("equal"); @@ -1413,9 +1409,9 @@ DESCR("greater-than"); DATA(insert OID = 1159 ( timezone PGNSP PGUID 12 f f t f s 2 1114 "25 1184" timestamptz_zone - _null_ )); DESCR("timestamp at a specified time zone"); -DATA(insert OID = 1160 ( interval_in PGNSP PGUID 12 f f t f s 1 1186 "0" interval_in - _null_ )); +DATA(insert OID = 1160 ( interval_in PGNSP PGUID 12 f f t f s 1 1186 "2275" interval_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1161 ( interval_out PGNSP PGUID 12 f f t f i 1 23 "0" interval_out - _null_ )); +DATA(insert OID = 1161 ( interval_out PGNSP PGUID 12 f f t f i 1 2275 "1186" interval_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1162 ( interval_eq PGNSP PGUID 12 f f t f i 2 16 "1186 1186" interval_eq - _null_ )); DESCR("equal"); @@ -1569,18 +1565,18 @@ DATA(insert OID = 1297 ( datetimetz_pl PGNSP PGUID 12 f f t f i 2 1184 "1082 DESCR("convert date and time with time zone to timestamp with time zone"); DATA(insert OID = 1298 ( timetzdate_pl PGNSP PGUID 14 f f t f i 2 1184 "1266 1082" "select ($2 + $1)" - _null_ )); DESCR("convert time with time zone and date to timestamp"); -DATA(insert OID = 1299 ( now PGNSP PGUID 12 f f t f s 0 1184 "0" now - _null_ )); +DATA(insert OID = 1299 ( now PGNSP PGUID 12 f f t f s 0 1184 "" now - _null_ )); DESCR("current transaction time"); /* OIDS 1300 - 1399 */ -DATA(insert OID = 1300 ( positionsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" positionsel - _null_ )); +DATA(insert OID = 1300 ( positionsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" positionsel - _null_ )); DESCR("restriction selectivity for position-comparison operators"); -DATA(insert OID = 1301 ( positionjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" positionjoinsel - _null_ )); +DATA(insert OID = 1301 ( positionjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" positionjoinsel - _null_ )); DESCR("join selectivity for position-comparison operators"); -DATA(insert OID = 1302 ( contsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" contsel - _null_ )); +DATA(insert OID = 1302 ( contsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" contsel - _null_ )); DESCR("restriction selectivity for containment comparison operators"); -DATA(insert OID = 1303 ( contjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" contjoinsel - _null_ )); +DATA(insert OID = 1303 ( contjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" contjoinsel - _null_ )); DESCR("join selectivity for containment comparison operators"); DATA(insert OID = 1304 ( overlaps PGNSP PGUID 12 f f f f i 4 16 "1184 1184 1184 1184" overlaps_timestamp - _null_ )); @@ -1601,9 +1597,9 @@ DESCR("SQL92 interval comparison"); DATA(insert OID = 1311 ( overlaps PGNSP PGUID 14 f f f f i 4 16 "1083 1186 1083 1083" "select ($1, ($1 + $2)) overlaps ($3, $4)" - _null_ )); DESCR("SQL92 interval comparison"); -DATA(insert OID = 1312 ( timestamp_in PGNSP PGUID 12 f f t f s 1 1114 "0" timestamp_in - _null_ )); +DATA(insert OID = 1312 ( timestamp_in PGNSP PGUID 12 f f t f s 1 1114 "2275" timestamp_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1313 ( timestamp_out PGNSP PGUID 12 f f t f s 1 23 "0" timestamp_out - _null_ )); +DATA(insert OID = 1313 ( timestamp_out PGNSP PGUID 12 f f t f s 1 2275 "1114" timestamp_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1314 ( timestamptz_cmp PGNSP PGUID 12 f f t f i 2 23 "1184 1184" timestamp_cmp - _null_ )); DESCR("less-equal-greater"); @@ -1651,9 +1647,9 @@ DATA(insert OID = 1349 ( oidvectortypes PGNSP PGUID 12 f f t f s 1 25 "30" oi DESCR("print type names of oidvector field"); -DATA(insert OID = 1350 ( timetz_in PGNSP PGUID 12 f f t f s 1 1266 "0" timetz_in - _null_ )); +DATA(insert OID = 1350 ( timetz_in PGNSP PGUID 12 f f t f s 1 1266 "2275" timetz_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1351 ( timetz_out PGNSP PGUID 12 f f t f i 1 23 "0" timetz_out - _null_ )); +DATA(insert OID = 1351 ( timetz_out PGNSP PGUID 12 f f t f i 1 2275 "1266" timetz_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1352 ( timetz_eq PGNSP PGUID 12 f f t f i 2 16 "1266 1266" timetz_eq - _null_ )); DESCR("equal"); @@ -1752,7 +1748,7 @@ DESCR("convert varchar to name"); DATA(insert OID = 1401 ( varchar PGNSP PGUID 12 f f t f i 1 1043 "19" name_text - _null_ )); DESCR("convert name to varchar"); -DATA(insert OID = 1402 ( current_schema PGNSP PGUID 12 f f t f s 0 19 "0" current_schema - _null_ )); +DATA(insert OID = 1402 ( current_schema PGNSP PGUID 12 f f t f s 0 19 "" current_schema - _null_ )); DESCR("current schema name"); DATA(insert OID = 1403 ( current_schemas PGNSP PGUID 12 f f t f s 1 1003 "16" current_schemas - _null_ )); DESCR("current schema search list"); @@ -1858,9 +1854,9 @@ DESCR("convert box to polygon"); DATA(insert OID = 1449 ( polygon PGNSP PGUID 12 f f t f i 1 604 "602" path_poly - _null_ )); DESCR("convert path to polygon"); -DATA(insert OID = 1450 ( circle_in PGNSP PGUID 12 f f t f i 1 718 "0" circle_in - _null_ )); +DATA(insert OID = 1450 ( circle_in PGNSP PGUID 12 f f t f i 1 718 "2275" circle_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1451 ( circle_out PGNSP PGUID 12 f f t f i 1 23 "718" circle_out - _null_ )); +DATA(insert OID = 1451 ( circle_out PGNSP PGUID 12 f f t f i 1 2275 "718" circle_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1452 ( circle_same PGNSP PGUID 12 f f t f i 2 16 "718 718" circle_same - _null_ )); DESCR("same as"); @@ -1940,9 +1936,9 @@ DESCR("closest point to line on line segment"); DATA(insert OID = 1489 ( close_lseg PGNSP PGUID 12 f f t f i 2 600 "601 601" close_lseg - _null_ )); DESCR("closest point to line segment on line segment"); -DATA(insert OID = 1490 ( line_in PGNSP PGUID 12 f f t f i 1 628 "0" line_in - _null_ )); +DATA(insert OID = 1490 ( line_in PGNSP PGUID 12 f f t f i 1 628 "2275" line_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1491 ( line_out PGNSP PGUID 12 f f t f i 1 23 "628" line_out - _null_ )); +DATA(insert OID = 1491 ( line_out PGNSP PGUID 12 f f t f i 1 2275 "628" line_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1492 ( line_eq PGNSP PGUID 12 f f t f i 2 16 "628 628" line_eq - _null_ )); DESCR("lines equal?"); @@ -1990,9 +1986,9 @@ DESCR("# points in path"); DATA(insert OID = 1556 ( npoints PGNSP PGUID 12 f f t f i 1 23 "604" poly_npoints - _null_ )); DESCR("number of points in polygon"); -DATA(insert OID = 1564 ( bit_in PGNSP PGUID 12 f f t f i 1 1560 "0" bit_in - _null_ )); +DATA(insert OID = 1564 ( bit_in PGNSP PGUID 12 f f t f i 1 1560 "2275" bit_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1565 ( bit_out PGNSP PGUID 12 f f t f i 1 23 "0" bit_out - _null_ )); +DATA(insert OID = 1565 ( bit_out PGNSP PGUID 12 f f t f i 1 2275 "1560" bit_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1569 ( like PGNSP PGUID 12 f f t f i 2 16 "25 25" textlike - _null_ )); @@ -2015,9 +2011,9 @@ DESCR("set sequence value"); DATA(insert OID = 1765 ( setval PGNSP PGUID 12 f f t f v 3 20 "25 20 16" setval_and_iscalled - _null_ )); DESCR("set sequence value and iscalled status"); -DATA(insert OID = 1579 ( varbit_in PGNSP PGUID 12 f f t f i 1 1562 "0" varbit_in - _null_ )); +DATA(insert OID = 1579 ( varbit_in PGNSP PGUID 12 f f t f i 1 1562 "2275" varbit_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1580 ( varbit_out PGNSP PGUID 12 f f t f i 1 23 "0" varbit_out - _null_ )); +DATA(insert OID = 1580 ( varbit_out PGNSP PGUID 12 f f t f i 1 2275 "1562" varbit_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1581 ( biteq PGNSP PGUID 12 f f t f i 2 16 "1560 1560" biteq - _null_ )); @@ -2035,7 +2031,7 @@ DESCR("less than"); DATA(insert OID = 1596 ( bitcmp PGNSP PGUID 12 f f t f i 2 23 "1560 1560" bitcmp - _null_ )); DESCR("compare"); -DATA(insert OID = 1598 ( random PGNSP PGUID 12 f f t f v 0 701 "0" drandom - _null_ )); +DATA(insert OID = 1598 ( random PGNSP PGUID 12 f f t f v 0 701 "" drandom - _null_ )); DESCR("random value"); DATA(insert OID = 1599 ( setseed PGNSP PGUID 12 f f t f v 1 23 "701" setseed - _null_ )); DESCR("set random seed"); @@ -2062,7 +2058,7 @@ DATA(insert OID = 1608 ( degrees PGNSP PGUID 12 f f t f i 1 701 "701" degrees DESCR("radians to degrees"); DATA(insert OID = 1609 ( radians PGNSP PGUID 12 f f t f i 1 701 "701" radians - _null_ )); DESCR("degrees to radians"); -DATA(insert OID = 1610 ( pi PGNSP PGUID 12 f f t f i 0 701 "0" dpi - _null_ )); +DATA(insert OID = 1610 ( pi PGNSP PGUID 12 f f t f i 0 701 "" dpi - _null_ )); DESCR("PI"); DATA(insert OID = 1618 ( interval_mul PGNSP PGUID 12 f f t f i 2 1186 "1186 701" interval_mul - _null_ )); @@ -2092,7 +2088,7 @@ DESCR("does not match LIKE expression, case-insensitive"); DATA(insert OID = 1637 ( like_escape PGNSP PGUID 12 f f t f i 2 25 "25 25" like_escape - _null_ )); DESCR("convert match pattern to use backslash escapes"); -DATA(insert OID = 1689 ( update_pg_pwd_and_pg_group PGNSP PGUID 12 f f t f v 0 0 "" update_pg_pwd_and_pg_group - _null_ )); +DATA(insert OID = 1689 ( update_pg_pwd_and_pg_group PGNSP PGUID 12 f f t f v 0 2279 "" update_pg_pwd_and_pg_group - _null_ )); DESCR("update pg_pwd and pg_group files"); /* Oracle Compatibility Related Functions - By Edmund Mergl <E.Mergl@bawue.de> */ @@ -2139,11 +2135,11 @@ DESCR("return portion of string"); /* for multi-byte support */ /* return database encoding name */ -DATA(insert OID = 1039 ( getdatabaseencoding PGNSP PGUID 12 f f t f s 0 19 "0" getdatabaseencoding - _null_ )); +DATA(insert OID = 1039 ( getdatabaseencoding PGNSP PGUID 12 f f t f s 0 19 "" getdatabaseencoding - _null_ )); DESCR("encoding name of current database"); /* return client encoding name i.e. session encoding */ -DATA(insert OID = 810 ( pg_client_encoding PGNSP PGUID 12 f f t f s 0 19 "0" pg_client_encoding - _null_ )); +DATA(insert OID = 810 ( pg_client_encoding PGNSP PGUID 12 f f t f s 0 19 "" pg_client_encoding - _null_ )); DESCR("encoding name of current database"); DATA(insert OID = 1717 ( convert PGNSP PGUID 12 f f t f s 2 25 "25 19" pg_convert - _null_ )); @@ -2184,29 +2180,29 @@ DESCR("deparse an encoded expression"); /* Generic referential integrity constraint triggers */ -DATA(insert OID = 1644 ( RI_FKey_check_ins PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_check_ins - _null_ )); +DATA(insert OID = 1644 ( RI_FKey_check_ins PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_check_ins - _null_ )); DESCR("referential integrity FOREIGN KEY ... REFERENCES"); -DATA(insert OID = 1645 ( RI_FKey_check_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_check_upd - _null_ )); +DATA(insert OID = 1645 ( RI_FKey_check_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_check_upd - _null_ )); DESCR("referential integrity FOREIGN KEY ... REFERENCES"); -DATA(insert OID = 1646 ( RI_FKey_cascade_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_cascade_del - _null_ )); +DATA(insert OID = 1646 ( RI_FKey_cascade_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_cascade_del - _null_ )); DESCR("referential integrity ON DELETE CASCADE"); -DATA(insert OID = 1647 ( RI_FKey_cascade_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_cascade_upd - _null_ )); +DATA(insert OID = 1647 ( RI_FKey_cascade_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_cascade_upd - _null_ )); DESCR("referential integrity ON UPDATE CASCADE"); -DATA(insert OID = 1648 ( RI_FKey_restrict_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_restrict_del - _null_ )); +DATA(insert OID = 1648 ( RI_FKey_restrict_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_restrict_del - _null_ )); DESCR("referential integrity ON DELETE RESTRICT"); -DATA(insert OID = 1649 ( RI_FKey_restrict_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_restrict_upd - _null_ )); +DATA(insert OID = 1649 ( RI_FKey_restrict_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_restrict_upd - _null_ )); DESCR("referential integrity ON UPDATE RESTRICT"); -DATA(insert OID = 1650 ( RI_FKey_setnull_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_setnull_del - _null_ )); +DATA(insert OID = 1650 ( RI_FKey_setnull_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_setnull_del - _null_ )); DESCR("referential integrity ON DELETE SET NULL"); -DATA(insert OID = 1651 ( RI_FKey_setnull_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_setnull_upd - _null_ )); +DATA(insert OID = 1651 ( RI_FKey_setnull_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_setnull_upd - _null_ )); DESCR("referential integrity ON UPDATE SET NULL"); -DATA(insert OID = 1652 ( RI_FKey_setdefault_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_setdefault_del - _null_ )); +DATA(insert OID = 1652 ( RI_FKey_setdefault_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_setdefault_del - _null_ )); DESCR("referential integrity ON DELETE SET DEFAULT"); -DATA(insert OID = 1653 ( RI_FKey_setdefault_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_setdefault_upd - _null_ )); +DATA(insert OID = 1653 ( RI_FKey_setdefault_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_setdefault_upd - _null_ )); DESCR("referential integrity ON UPDATE SET DEFAULT"); -DATA(insert OID = 1654 ( RI_FKey_noaction_del PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_noaction_del - _null_ )); +DATA(insert OID = 1654 ( RI_FKey_noaction_del PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_noaction_del - _null_ )); DESCR("referential integrity ON DELETE NO ACTION"); -DATA(insert OID = 1655 ( RI_FKey_noaction_upd PGNSP PGUID 12 f f t f v 0 0 "" RI_FKey_noaction_upd - _null_ )); +DATA(insert OID = 1655 ( RI_FKey_noaction_upd PGNSP PGUID 12 f f t f v 0 2279 "" RI_FKey_noaction_upd - _null_ )); DESCR("referential integrity ON UPDATE NO ACTION"); DATA(insert OID = 1666 ( varbiteq PGNSP PGUID 12 f f t f i 2 16 "1562 1562" biteq - _null_ )); @@ -2265,9 +2261,9 @@ DESCR("return portion of bitstring"); /* for mac type support */ -DATA(insert OID = 436 ( macaddr_in PGNSP PGUID 12 f f t f i 1 829 "0" macaddr_in - _null_ )); +DATA(insert OID = 436 ( macaddr_in PGNSP PGUID 12 f f t f i 1 829 "2275" macaddr_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 437 ( macaddr_out PGNSP PGUID 12 f f t f i 1 23 "0" macaddr_out - _null_ )); +DATA(insert OID = 437 ( macaddr_out PGNSP PGUID 12 f f t f i 1 2275 "829" macaddr_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 752 ( text PGNSP PGUID 12 f f t f i 1 25 "829" macaddr_text - _null_ )); @@ -2293,15 +2289,15 @@ DATA(insert OID = 836 ( macaddr_cmp PGNSP PGUID 12 f f t f i 2 23 "829 829" m DESCR("less-equal-greater"); /* for inet type support */ -DATA(insert OID = 910 ( inet_in PGNSP PGUID 12 f f t f i 1 869 "0" inet_in - _null_ )); +DATA(insert OID = 910 ( inet_in PGNSP PGUID 12 f f t f i 1 869 "2275" inet_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 911 ( inet_out PGNSP PGUID 12 f f t f i 1 23 "0" inet_out - _null_ )); +DATA(insert OID = 911 ( inet_out PGNSP PGUID 12 f f t f i 1 2275 "869" inet_out - _null_ )); DESCR("(internal)"); /* for cidr type support */ -DATA(insert OID = 1267 ( cidr_in PGNSP PGUID 12 f f t f i 1 650 "0" cidr_in - _null_ )); +DATA(insert OID = 1267 ( cidr_in PGNSP PGUID 12 f f t f i 1 650 "2275" cidr_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1427 ( cidr_out PGNSP PGUID 12 f f t f i 1 23 "0" cidr_out - _null_ )); +DATA(insert OID = 1427 ( cidr_out PGNSP PGUID 12 f f t f i 1 2275 "650" cidr_out - _null_ )); DESCR("(internal)"); /* these are used for both inet and cidr */ @@ -2367,9 +2363,9 @@ DESCR("hash"); /* OID's 1700 - 1799 NUMERIC data type */ -DATA(insert OID = 1701 ( numeric_in PGNSP PGUID 12 f f t f i 3 1700 "0 26 23" numeric_in - _null_ )); +DATA(insert OID = 1701 ( numeric_in PGNSP PGUID 12 f f t f i 3 1700 "2275 26 23" numeric_in - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1702 ( numeric_out PGNSP PGUID 12 f f t f i 1 23 "0" numeric_out - _null_ )); +DATA(insert OID = 1702 ( numeric_out PGNSP PGUID 12 f f t f i 1 2275 "1700" numeric_out - _null_ )); DESCR("(internal)"); DATA(insert OID = 1703 ( numeric PGNSP PGUID 12 f f t f i 2 1700 "1700 23" numeric - _null_ )); DESCR("adjust numeric to typmod precision/scale"); @@ -2505,9 +2501,9 @@ DESCR("quote an identifier for usage in a querystring"); DATA(insert OID = 1283 ( quote_literal PGNSP PGUID 12 f f t f i 1 25 "25" quote_literal - _null_ )); DESCR("quote a literal for usage in a querystring"); -DATA(insert OID = 1798 ( oidin PGNSP PGUID 12 f f t f i 1 26 "0" oidin - _null_ )); +DATA(insert OID = 1798 ( oidin PGNSP PGUID 12 f f t f i 1 26 "2275" oidin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 1799 ( oidout PGNSP PGUID 12 f f t f i 1 23 "0" oidout - _null_ )); +DATA(insert OID = 1799 ( oidout PGNSP PGUID 12 f f t f i 1 2275 "26" oidout - _null_ )); DESCR("(internal)"); @@ -2519,37 +2515,37 @@ DATA(insert OID = 1812 ( bit_length PGNSP PGUID 14 f f t f i 1 23 "1560" "se DESCR("length in bits"); /* Selectivity estimators for LIKE and related operators */ -DATA(insert OID = 1814 ( iclikesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" iclikesel - _null_ )); +DATA(insert OID = 1814 ( iclikesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" iclikesel - _null_ )); DESCR("restriction selectivity of ILIKE"); -DATA(insert OID = 1815 ( icnlikesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" icnlikesel - _null_ )); +DATA(insert OID = 1815 ( icnlikesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" icnlikesel - _null_ )); DESCR("restriction selectivity of NOT ILIKE"); -DATA(insert OID = 1816 ( iclikejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" iclikejoinsel - _null_ )); +DATA(insert OID = 1816 ( iclikejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" iclikejoinsel - _null_ )); DESCR("join selectivity of ILIKE"); -DATA(insert OID = 1817 ( icnlikejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" icnlikejoinsel - _null_ )); +DATA(insert OID = 1817 ( icnlikejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" icnlikejoinsel - _null_ )); DESCR("join selectivity of NOT ILIKE"); -DATA(insert OID = 1818 ( regexeqsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" regexeqsel - _null_ )); +DATA(insert OID = 1818 ( regexeqsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" regexeqsel - _null_ )); DESCR("restriction selectivity of regex match"); -DATA(insert OID = 1819 ( likesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" likesel - _null_ )); +DATA(insert OID = 1819 ( likesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" likesel - _null_ )); DESCR("restriction selectivity of LIKE"); -DATA(insert OID = 1820 ( icregexeqsel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" icregexeqsel - _null_ )); +DATA(insert OID = 1820 ( icregexeqsel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" icregexeqsel - _null_ )); DESCR("restriction selectivity of case-insensitive regex match"); -DATA(insert OID = 1821 ( regexnesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" regexnesel - _null_ )); +DATA(insert OID = 1821 ( regexnesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" regexnesel - _null_ )); DESCR("restriction selectivity of regex non-match"); -DATA(insert OID = 1822 ( nlikesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" nlikesel - _null_ )); +DATA(insert OID = 1822 ( nlikesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" nlikesel - _null_ )); DESCR("restriction selectivity of NOT LIKE"); -DATA(insert OID = 1823 ( icregexnesel PGNSP PGUID 12 f f t f s 4 701 "0 26 0 23" icregexnesel - _null_ )); +DATA(insert OID = 1823 ( icregexnesel PGNSP PGUID 12 f f t f s 4 701 "2281 26 2281 23" icregexnesel - _null_ )); DESCR("restriction selectivity of case-insensitive regex non-match"); -DATA(insert OID = 1824 ( regexeqjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" regexeqjoinsel - _null_ )); +DATA(insert OID = 1824 ( regexeqjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" regexeqjoinsel - _null_ )); DESCR("join selectivity of regex match"); -DATA(insert OID = 1825 ( likejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" likejoinsel - _null_ )); +DATA(insert OID = 1825 ( likejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" likejoinsel - _null_ )); DESCR("join selectivity of LIKE"); -DATA(insert OID = 1826 ( icregexeqjoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" icregexeqjoinsel - _null_ )); +DATA(insert OID = 1826 ( icregexeqjoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" icregexeqjoinsel - _null_ )); DESCR("join selectivity of case-insensitive regex match"); -DATA(insert OID = 1827 ( regexnejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" regexnejoinsel - _null_ )); +DATA(insert OID = 1827 ( regexnejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" regexnejoinsel - _null_ )); DESCR("join selectivity of regex non-match"); -DATA(insert OID = 1828 ( nlikejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" nlikejoinsel - _null_ )); +DATA(insert OID = 1828 ( nlikejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" nlikejoinsel - _null_ )); DESCR("join selectivity of NOT LIKE"); -DATA(insert OID = 1829 ( icregexnejoinsel PGNSP PGUID 12 f f t f s 3 701 "0 26 0" icregexnejoinsel - _null_ )); +DATA(insert OID = 1829 ( icregexnejoinsel PGNSP PGUID 12 f f t f s 3 701 "2281 26 2281" icregexnejoinsel - _null_ )); DESCR("join selectivity of case-insensitive regex non-match"); /* Aggregate-related functions */ @@ -2962,7 +2958,7 @@ DATA(insert OID = 2144 ( min PGNSP PGUID 12 t f f f i 1 1186 "1186" aggrega DATA(insert OID = 2145 ( min PGNSP PGUID 12 t f f f i 1 25 "25" aggregate_dummy - _null_ )); DATA(insert OID = 2146 ( min PGNSP PGUID 12 t f f f i 1 1700 "1700" aggregate_dummy - _null_ )); -DATA(insert OID = 2147 ( count PGNSP PGUID 12 t f f f i 1 20 "0" aggregate_dummy - _null_ )); +DATA(insert OID = 2147 ( count PGNSP PGUID 12 t f f f i 1 20 "2276" aggregate_dummy - _null_ )); DATA(insert OID = 2148 ( variance PGNSP PGUID 12 t f f f i 1 1700 "20" aggregate_dummy - _null_ )); DATA(insert OID = 2149 ( variance PGNSP PGUID 12 t f f f i 1 1700 "23" aggregate_dummy - _null_ )); @@ -2979,32 +2975,32 @@ DATA(insert OID = 2158 ( stddev PGNSP PGUID 12 t f f f i 1 701 "701" aggrega DATA(insert OID = 2159 ( stddev PGNSP PGUID 12 t f f f i 1 1700 "1700" aggregate_dummy - _null_ )); -DATA(insert OID = 2212 ( regprocedurein PGNSP PGUID 12 f f t f s 1 2202 "0" regprocedurein - _null_ )); +DATA(insert OID = 2212 ( regprocedurein PGNSP PGUID 12 f f t f s 1 2202 "2275" regprocedurein - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2213 ( regprocedureout PGNSP PGUID 12 f f t f s 1 23 "0" regprocedureout - _null_ )); +DATA(insert OID = 2213 ( regprocedureout PGNSP PGUID 12 f f t f s 1 2275 "2202" regprocedureout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2214 ( regoperin PGNSP PGUID 12 f f t f s 1 2203 "0" regoperin - _null_ )); +DATA(insert OID = 2214 ( regoperin PGNSP PGUID 12 f f t f s 1 2203 "2275" regoperin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2215 ( regoperout PGNSP PGUID 12 f f t f s 1 23 "0" regoperout - _null_ )); +DATA(insert OID = 2215 ( regoperout PGNSP PGUID 12 f f t f s 1 2275 "2203" regoperout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2216 ( regoperatorin PGNSP PGUID 12 f f t f s 1 2204 "0" regoperatorin - _null_ )); +DATA(insert OID = 2216 ( regoperatorin PGNSP PGUID 12 f f t f s 1 2204 "2275" regoperatorin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2217 ( regoperatorout PGNSP PGUID 12 f f t f s 1 23 "0" regoperatorout - _null_ )); +DATA(insert OID = 2217 ( regoperatorout PGNSP PGUID 12 f f t f s 1 2275 "2204" regoperatorout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2218 ( regclassin PGNSP PGUID 12 f f t f s 1 2205 "0" regclassin - _null_ )); +DATA(insert OID = 2218 ( regclassin PGNSP PGUID 12 f f t f s 1 2205 "2275" regclassin - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2219 ( regclassout PGNSP PGUID 12 f f t f s 1 23 "0" regclassout - _null_ )); +DATA(insert OID = 2219 ( regclassout PGNSP PGUID 12 f f t f s 1 2275 "2205" regclassout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2220 ( regtypein PGNSP PGUID 12 f f t f s 1 2206 "0" regtypein - _null_ )); +DATA(insert OID = 2220 ( regtypein PGNSP PGUID 12 f f t f s 1 2206 "2275" regtypein - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2221 ( regtypeout PGNSP PGUID 12 f f t f s 1 23 "0" regtypeout - _null_ )); +DATA(insert OID = 2221 ( regtypeout PGNSP PGUID 12 f f t f s 1 2275 "2206" regtypeout - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2246 ( fmgr_internal_validator PGNSP PGUID 12 f f t f s 1 26 "23" fmgr_internal_validator - _null_ )); +DATA(insert OID = 2246 ( fmgr_internal_validator PGNSP PGUID 12 f f t f s 1 2278 "26" fmgr_internal_validator - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2247 ( fmgr_c_validator PGNSP PGUID 12 f f t f s 1 26 "23" fmgr_c_validator - _null_ )); +DATA(insert OID = 2247 ( fmgr_c_validator PGNSP PGUID 12 f f t f s 1 2278 "26" fmgr_c_validator - _null_ )); DESCR("(internal)"); -DATA(insert OID = 2248 ( fmgr_sql_validator PGNSP PGUID 12 f f t f s 1 26 "23" fmgr_sql_validator - _null_ )); +DATA(insert OID = 2248 ( fmgr_sql_validator PGNSP PGUID 12 f f t f s 1 2278 "26" fmgr_sql_validator - _null_ )); DESCR("(internal)"); DATA(insert OID = 2250 ( has_database_privilege PGNSP PGUID 12 f f t f s 3 16 "19 25 25" has_database_privilege_name_name - _null_ )); @@ -3059,6 +3055,46 @@ DESCR("current user privilege on schema by schema name"); DATA(insert OID = 2273 ( has_schema_privilege PGNSP PGUID 12 f f t f s 2 16 "26 25" has_schema_privilege_id - _null_ )); DESCR("current user privilege on schema by schema oid"); + + +DATA(insert OID = 2290 ( record_in PGNSP PGUID 12 f f t f i 1 2249 "2275" record_in - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2291 ( record_out PGNSP PGUID 12 f f t f i 1 2275 "2249" record_out - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2292 ( cstring_in PGNSP PGUID 12 f f t f i 1 2275 "2275" cstring_in - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2293 ( cstring_out PGNSP PGUID 12 f f t f i 1 2275 "2275" cstring_out - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2294 ( any_in PGNSP PGUID 12 f f t f i 1 2276 "2275" any_in - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2295 ( any_out PGNSP PGUID 12 f f t f i 1 2275 "2276" any_out - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2296 ( anyarray_in PGNSP PGUID 12 f f t f i 1 2277 "2275" anyarray_in - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2297 ( anyarray_out PGNSP PGUID 12 f f t f i 1 2275 "2277" anyarray_out - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2298 ( void_in PGNSP PGUID 12 f f t f i 1 2278 "2275" void_in - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2299 ( void_out PGNSP PGUID 12 f f t f i 1 2275 "2278" void_out - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2300 ( trigger_in PGNSP PGUID 12 f f t f i 1 2279 "2275" trigger_in - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2301 ( trigger_out PGNSP PGUID 12 f f t f i 1 2275 "2279" trigger_out - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2302 ( language_handler_in PGNSP PGUID 12 f f t f i 1 2280 "2275" language_handler_in - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2303 ( language_handler_out PGNSP PGUID 12 f f t f i 1 2275 "2280" language_handler_out - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2304 ( internal_in PGNSP PGUID 12 f f t f i 1 2281 "2275" internal_in - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2305 ( internal_out PGNSP PGUID 12 f f t f i 1 2275 "2281" internal_out - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2306 ( opaque_in PGNSP PGUID 12 f f t f i 1 2282 "2275" opaque_in - _null_ )); +DESCR("(internal)"); +DATA(insert OID = 2307 ( opaque_out PGNSP PGUID 12 f f t f i 1 2275 "2282" opaque_out - _null_ )); +DESCR("(internal)"); + + /* * Symbolic values for provolatile column: these indicate whether the result * of a function is dependent *only* on the values of its explicit arguments, diff --git a/src/include/catalog/pg_type.h b/src/include/catalog/pg_type.h index 3d026acc083..dc39ecef79e 100644 --- a/src/include/catalog/pg_type.h +++ b/src/include/catalog/pg_type.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_type.h,v 1.127 2002/08/05 02:30:50 tgl Exp $ + * $Id: pg_type.h,v 1.128 2002/08/22 00:01:48 tgl Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -505,13 +505,30 @@ DATA(insert OID = 2211 ( _regtype PGNSP PGUID -1 f b t \054 0 2206 array_in /* * pseudo-types * - * types with typtype='p' are special types that represent classes of types - * that are not easily defined in advance. Currently there is only one pseudo - * type -- record. The record type is used to specify that the value is a - * tuple, but of unknown structure until runtime. + * types with typtype='p' represent various special cases in the type system. + * + * These cannot be used to define table columns, but are valid as function + * argument and result types (if supported by the function's implementation + * language). */ -DATA(insert OID = 2249 ( record PGNSP PGUID 4 t p t \054 0 0 oidin oidout i p f 0 -1 0 _null_ _null_ )); +DATA(insert OID = 2249 ( record PGNSP PGUID 4 t p t \054 0 0 record_in record_out i p f 0 -1 0 _null_ _null_ )); #define RECORDOID 2249 +DATA(insert OID = 2275 ( cstring PGNSP PGUID 4 t p t \054 0 0 cstring_in cstring_out i p f 0 -1 0 _null_ _null_ )); +#define CSTRINGOID 2275 +DATA(insert OID = 2276 ( any PGNSP PGUID 4 t p t \054 0 0 any_in any_out i p f 0 -1 0 _null_ _null_ )); +#define ANYOID 2276 +DATA(insert OID = 2277 ( anyarray PGNSP PGUID 4 t p t \054 0 0 anyarray_in anyarray_out i p f 0 -1 0 _null_ _null_ )); +#define ANYARRAYOID 2277 +DATA(insert OID = 2278 ( void PGNSP PGUID 4 t p t \054 0 0 void_in void_out i p f 0 -1 0 _null_ _null_ )); +#define VOIDOID 2278 +DATA(insert OID = 2279 ( trigger PGNSP PGUID 4 t p t \054 0 0 trigger_in trigger_out i p f 0 -1 0 _null_ _null_ )); +#define TRIGGEROID 2279 +DATA(insert OID = 2280 ( language_handler PGNSP PGUID 4 t p t \054 0 0 language_handler_in language_handler_out i p f 0 -1 0 _null_ _null_ )); +#define LANGUAGE_HANDLEROID 2280 +DATA(insert OID = 2281 ( internal PGNSP PGUID 4 t p t \054 0 0 internal_in internal_out i p f 0 -1 0 _null_ _null_ )); +#define INTERNALOID 2281 +DATA(insert OID = 2282 ( opaque PGNSP PGUID 4 t p t \054 0 0 opaque_in opaque_out i p f 0 -1 0 _null_ _null_ )); +#define OPAQUEOID 2282 /* * prototypes for functions in pg_type.c diff --git a/src/include/parser/parse_func.h b/src/include/parser/parse_func.h index ac98fb84f6e..c600aa932dd 100644 --- a/src/include/parser/parse_func.h +++ b/src/include/parser/parse_func.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: parse_func.h,v 1.41 2002/06/20 20:29:51 momjian Exp $ + * $Id: parse_func.h,v 1.42 2002/08/22 00:01:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -58,6 +58,6 @@ extern Oid find_aggregate_func(const char *caller, List *aggname, extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes); extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes, - bool opaqueOK, const char *caller); + const char *caller); #endif /* PARSE_FUNC_H */ diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index e9937ad751e..c18a17be9ae 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: builtins.h,v 1.193 2002/08/20 04:46:00 momjian Exp $ + * $Id: builtins.h,v 1.194 2002/08/22 00:01:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -93,8 +93,6 @@ extern Datum int2out(PG_FUNCTION_ARGS); extern Datum int2vectorin(PG_FUNCTION_ARGS); extern Datum int2vectorout(PG_FUNCTION_ARGS); extern Datum int2vectoreq(PG_FUNCTION_ARGS); -extern Datum int44in(PG_FUNCTION_ARGS); -extern Datum int44out(PG_FUNCTION_ARGS); extern Datum int4in(PG_FUNCTION_ARGS); extern Datum int4out(PG_FUNCTION_ARGS); extern Datum i2toi4(PG_FUNCTION_ARGS); @@ -343,6 +341,26 @@ extern Datum oidvectorle(PG_FUNCTION_ARGS); extern Datum oidvectorge(PG_FUNCTION_ARGS); extern Datum oidvectorgt(PG_FUNCTION_ARGS); +/* pseudotypes.c */ +extern Datum record_in(PG_FUNCTION_ARGS); +extern Datum record_out(PG_FUNCTION_ARGS); +extern Datum cstring_in(PG_FUNCTION_ARGS); +extern Datum cstring_out(PG_FUNCTION_ARGS); +extern Datum any_in(PG_FUNCTION_ARGS); +extern Datum any_out(PG_FUNCTION_ARGS); +extern Datum anyarray_in(PG_FUNCTION_ARGS); +extern Datum anyarray_out(PG_FUNCTION_ARGS); +extern Datum void_in(PG_FUNCTION_ARGS); +extern Datum void_out(PG_FUNCTION_ARGS); +extern Datum trigger_in(PG_FUNCTION_ARGS); +extern Datum trigger_out(PG_FUNCTION_ARGS); +extern Datum language_handler_in(PG_FUNCTION_ARGS); +extern Datum language_handler_out(PG_FUNCTION_ARGS); +extern Datum internal_in(PG_FUNCTION_ARGS); +extern Datum internal_out(PG_FUNCTION_ARGS); +extern Datum opaque_in(PG_FUNCTION_ARGS); +extern Datum opaque_out(PG_FUNCTION_ARGS); + /* regexp.c */ extern Datum nameregexeq(PG_FUNCTION_ARGS); extern Datum nameregexne(PG_FUNCTION_ARGS); diff --git a/src/include/utils/lsyscache.h b/src/include/utils/lsyscache.h index c03e1a241e2..ccd385b7779 100644 --- a/src/include/utils/lsyscache.h +++ b/src/include/utils/lsyscache.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: lsyscache.h,v 1.57 2002/08/05 02:30:50 tgl Exp $ + * $Id: lsyscache.h,v 1.58 2002/08/22 00:01:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -52,6 +52,8 @@ extern void get_typlenbyval(Oid typid, int16 *typlen, bool *typbyval); extern char get_typstorage(Oid typid); extern Node *get_typdefault(Oid typid); extern char get_typtype(Oid typid); +extern bool getTypeOutputInfo(Oid type, Oid *typOutput, Oid *typElem, + bool *typIsVarlena); extern Oid getBaseType(Oid typid); extern Oid getBaseTypeTypeMod(Oid typid, int32 *typmod); extern int32 get_typavgwidth(Oid typid, int32 typmod); diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index 7533e578436..c617c861141 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -33,7 +33,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.31 2002/06/15 19:54:24 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.32 2002/08/22 00:01:49 tgl Exp $ * **********************************************************************/ @@ -619,15 +619,34 @@ compile_plperl_function(Oid fn_oid, bool is_trigger) { free(prodesc->proname); free(prodesc); - if (!OidIsValid(procStruct->prorettype)) - elog(ERROR, "plperl functions cannot return type \"opaque\"" - "\n\texcept when used as triggers"); - else - elog(ERROR, "plperl: cache lookup for return type %u failed", - procStruct->prorettype); + elog(ERROR, "plperl: cache lookup for return type %u failed", + procStruct->prorettype); } typeStruct = (Form_pg_type) GETSTRUCT(typeTup); + /* Disallow pseudotype result, except VOID */ + if (typeStruct->typtype == 'p') + { + if (procStruct->prorettype == VOIDOID) + /* okay */; + else if (procStruct->prorettype == TRIGGEROID || + procStruct->prorettype == OPAQUEOID) + { + free(prodesc->proname); + free(prodesc); + elog(ERROR, "plperl functions cannot return type %s" + "\n\texcept when used as triggers", + format_type_be(procStruct->prorettype)); + } + else + { + free(prodesc->proname); + free(prodesc); + elog(ERROR, "plperl functions cannot return type %s", + format_type_be(procStruct->prorettype)); + } + } + if (typeStruct->typrelid != InvalidOid) { free(prodesc->proname); @@ -657,14 +676,20 @@ compile_plperl_function(Oid fn_oid, bool is_trigger) { free(prodesc->proname); free(prodesc); - if (!OidIsValid(procStruct->proargtypes[i])) - elog(ERROR, "plperl functions cannot take type \"opaque\""); - else - elog(ERROR, "plperl: cache lookup for argument type %u failed", - procStruct->proargtypes[i]); + elog(ERROR, "plperl: cache lookup for argument type %u failed", + procStruct->proargtypes[i]); } typeStruct = (Form_pg_type) GETSTRUCT(typeTup); + /* Disallow pseudotype argument */ + if (typeStruct->typtype == 'p') + { + free(prodesc->proname); + free(prodesc); + elog(ERROR, "plperl functions cannot take type %s", + format_type_be(procStruct->proargtypes[i])); + } + if (typeStruct->typrelid != InvalidOid) prodesc->arg_is_rel[i] = 1; else diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index ebb2312dae4..c85207780f1 100644 --- a/src/pl/plpgsql/src/pl_comp.c +++ b/src/pl/plpgsql/src/pl_comp.c @@ -3,7 +3,7 @@ * procedural language * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.46 2002/08/15 16:36:08 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.47 2002/08/22 00:01:50 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -212,15 +212,25 @@ plpgsql_compile(Oid fn_oid, int functype) ObjectIdGetDatum(procStruct->prorettype), 0, 0, 0); if (!HeapTupleIsValid(typeTup)) + elog(ERROR, "cache lookup for return type %u failed", + procStruct->prorettype); + typeStruct = (Form_pg_type) GETSTRUCT(typeTup); + + /* Disallow pseudotype result, except VOID */ + if (typeStruct->typtype == 'p') { - if (!OidIsValid(procStruct->prorettype)) - elog(ERROR, "plpgsql functions cannot return type \"opaque\"" - "\n\texcept when used as triggers"); + if (procStruct->prorettype == VOIDOID) + /* okay */; + else if (procStruct->prorettype == TRIGGEROID || + procStruct->prorettype == OPAQUEOID) + elog(ERROR, "plpgsql functions cannot return type %s" + "\n\texcept when used as triggers", + format_type_be(procStruct->prorettype)); else - elog(ERROR, "cache lookup for return type %u failed", - procStruct->prorettype); + elog(ERROR, "plpgsql functions cannot return type %s", + format_type_be(procStruct->prorettype)); } - typeStruct = (Form_pg_type) GETSTRUCT(typeTup); + if (typeStruct->typrelid != InvalidOid) function->fn_retistuple = true; else @@ -248,15 +258,15 @@ plpgsql_compile(Oid fn_oid, int functype) ObjectIdGetDatum(procStruct->proargtypes[i]), 0, 0, 0); if (!HeapTupleIsValid(typeTup)) - { - if (!OidIsValid(procStruct->proargtypes[i])) - elog(ERROR, "plpgsql functions cannot take type \"opaque\""); - else - elog(ERROR, "cache lookup for argument type %u failed", - procStruct->proargtypes[i]); - } + elog(ERROR, "cache lookup for argument type %u failed", + procStruct->proargtypes[i]); typeStruct = (Form_pg_type) GETSTRUCT(typeTup); + /* Disallow pseudotype argument */ + if (typeStruct->typtype == 'p') + elog(ERROR, "plpgsql functions cannot take type %s", + format_type_be(procStruct->proargtypes[i])); + if (typeStruct->typrelid != InvalidOid) { /* diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 6d26cc75ddb..986937e5e0a 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -29,7 +29,7 @@ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.19 2002/07/20 05:16:59 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.20 2002/08/22 00:01:50 tgl Exp $ * ********************************************************************* */ @@ -447,7 +447,7 @@ plpython_call_handler(PG_FUNCTION_ARGS) * this action. MODIFY means the tuple has been modified, so update * tuple and perform action. SKIP and MODIFY assume the trigger fires * BEFORE the event and is ROW level. postgres expects the function - * to take no arguments and return an argument of type opaque. + * to take no arguments and return an argument of type trigger. */ HeapTuple PLy_trigger_handler(FunctionCallInfo fcinfo, PLyProcedure * proc) diff --git a/src/pl/plpython/plpython_function.sql b/src/pl/plpython/plpython_function.sql index 46083ab2ba2..46ab4babd35 100644 --- a/src/pl/plpython/plpython_function.sql +++ b/src/pl/plpython/plpython_function.sql @@ -92,7 +92,7 @@ return words' -- vigorously resisted all efforts at correction. they have -- since gone bankrupt... -CREATE FUNCTION users_insert() returns opaque +CREATE FUNCTION users_insert() returns trigger AS 'if TD["new"]["fname"] == None or TD["new"]["lname"] == None: return "SKIP" @@ -108,7 +108,7 @@ return rv' LANGUAGE 'plpython'; -CREATE FUNCTION users_update() returns opaque +CREATE FUNCTION users_update() returns trigger AS 'if TD["event"] == "UPDATE": if TD["old"]["fname"] != TD["new"]["fname"] and TD["old"]["fname"] == TD["args"][0]: @@ -117,7 +117,7 @@ return None' LANGUAGE 'plpython'; -CREATE FUNCTION users_delete() RETURNS opaque +CREATE FUNCTION users_delete() RETURNS trigger AS 'if TD["old"]["fname"] == TD["args"][0]: return "SKIP" diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c index 6f2080b1a43..477dd52d1fd 100644 --- a/src/pl/tcl/pltcl.c +++ b/src/pl/tcl/pltcl.c @@ -31,7 +31,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.59 2002/07/20 05:16:59 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.60 2002/08/22 00:01:50 tgl Exp $ * **********************************************************************/ @@ -1051,15 +1051,34 @@ compile_pltcl_function(Oid fn_oid, bool is_trigger) { free(prodesc->proname); free(prodesc); - if (!OidIsValid(procStruct->prorettype)) - elog(ERROR, "pltcl functions cannot return type \"opaque\"" - "\n\texcept when used as triggers"); - else - elog(ERROR, "pltcl: cache lookup for return type %u failed", - procStruct->prorettype); + elog(ERROR, "pltcl: cache lookup for return type %u failed", + procStruct->prorettype); } typeStruct = (Form_pg_type) GETSTRUCT(typeTup); + /* Disallow pseudotype result, except VOID */ + if (typeStruct->typtype == 'p') + { + if (procStruct->prorettype == VOIDOID) + /* okay */; + else if (procStruct->prorettype == TRIGGEROID || + procStruct->prorettype == OPAQUEOID) + { + free(prodesc->proname); + free(prodesc); + elog(ERROR, "pltcl functions cannot return type %s" + "\n\texcept when used as triggers", + format_type_be(procStruct->prorettype)); + } + else + { + free(prodesc->proname); + free(prodesc); + elog(ERROR, "pltcl functions cannot return type %s", + format_type_be(procStruct->prorettype)); + } + } + if (typeStruct->typrelid != InvalidOid) { free(prodesc->proname); @@ -1090,14 +1109,20 @@ compile_pltcl_function(Oid fn_oid, bool is_trigger) { free(prodesc->proname); free(prodesc); - if (!OidIsValid(procStruct->proargtypes[i])) - elog(ERROR, "pltcl functions cannot take type \"opaque\""); - else - elog(ERROR, "pltcl: cache lookup for argument type %u failed", - procStruct->proargtypes[i]); + elog(ERROR, "pltcl: cache lookup for argument type %u failed", + procStruct->proargtypes[i]); } typeStruct = (Form_pg_type) GETSTRUCT(typeTup); + /* Disallow pseudotype argument */ + if (typeStruct->typtype == 'p') + { + free(prodesc->proname); + free(prodesc); + elog(ERROR, "pltcl functions cannot take type %s", + format_type_be(procStruct->proargtypes[i])); + } + if (typeStruct->typrelid != InvalidOid) { prodesc->arg_is_rel[i] = 1; diff --git a/src/pl/tcl/test/test_setup.sql b/src/pl/tcl/test/test_setup.sql index 918e2212696..c7902386f40 100644 --- a/src/pl/tcl/test/test_setup.sql +++ b/src/pl/tcl/test/test_setup.sql @@ -58,7 +58,7 @@ create function check_pkey1_exists(int4, bpchar) returns bool as ' -- -- Trigger function on every change to T_pkey1 -- -create function trig_pkey1_before() returns opaque as ' +create function trig_pkey1_before() returns trigger as ' # # Create prepared plans on the first call # @@ -152,7 +152,7 @@ create trigger pkey1_before before insert or update or delete on T_pkey1 -- Trigger function to check for duplicate keys in T_pkey2 -- and to force key2 to be upper case only without leading whitespaces -- -create function trig_pkey2_before() returns opaque as ' +create function trig_pkey2_before() returns trigger as ' # # Prepare plan on first call # @@ -195,7 +195,7 @@ create trigger pkey2_before before insert or update on T_pkey2 -- in T_pkey2 are done so the trigger for primkey check on T_dta2 -- fired on our updates will see the new key values in T_pkey2. -- -create function trig_pkey2_after() returns opaque as ' +create function trig_pkey2_after() returns trigger as ' # # Prepare plans on first call # @@ -282,7 +282,7 @@ create trigger pkey2_after after update or delete on T_pkey2 -- -- Generic trigger function to check references in T_dta1 and T_dta2 -- -create function check_primkey() returns opaque as ' +create function check_primkey() returns trigger as ' # # For every trigger/relation pair we create # a saved plan and hold them in GD diff --git a/src/test/regress/expected/copy2.out b/src/test/regress/expected/copy2.out index 300e1744a24..fa421e40bad 100644 --- a/src/test/regress/expected/copy2.out +++ b/src/test/regress/expected/copy2.out @@ -6,13 +6,13 @@ CREATE TABLE x ( e text ); NOTICE: CREATE TABLE will create implicit sequence 'x_a_seq' for SERIAL column 'x.a' -CREATE FUNCTION fn_x_before () RETURNS OPAQUE AS ' +CREATE FUNCTION fn_x_before () RETURNS TRIGGER AS ' BEGIN NEW.e := ''before trigger fired''::text; return NEW; END; ' language 'plpgsql'; -CREATE FUNCTION fn_x_after () RETURNS OPAQUE AS ' +CREATE FUNCTION fn_x_after () RETURNS TRIGGER AS ' BEGIN UPDATE x set e=''after trigger fired'' where c=''stuff''; return NULL; diff --git a/src/test/regress/expected/create_type.out b/src/test/regress/expected/create_type.out index 68dc8fbd5e5..a177153d298 100644 --- a/src/test/regress/expected/create_type.out +++ b/src/test/regress/expected/create_type.out @@ -14,18 +14,39 @@ CREATE TYPE city_budget ( element = int4 ); -- Test type-related default values (broken in releases before PG 7.2) +-- Make dummy I/O routines using the existing internal support for int4, text +CREATE FUNCTION int42_in(cstring) + RETURNS int42 + AS 'int4in' + LANGUAGE 'internal' WITH (isStrict); +WARNING: ProcedureCreate: type int42 is not yet defined +CREATE FUNCTION int42_out(int42) + RETURNS cstring + AS 'int4out' + LANGUAGE 'internal' WITH (isStrict); +WARNING: Argument type "int42" is only a shell +CREATE FUNCTION text_w_default_in(cstring) + RETURNS text_w_default + AS 'textin' + LANGUAGE 'internal' WITH (isStrict); +WARNING: ProcedureCreate: type text_w_default is not yet defined +CREATE FUNCTION text_w_default_out(text_w_default) + RETURNS cstring + AS 'textout' + LANGUAGE 'internal' WITH (isStrict); +WARNING: Argument type "text_w_default" is only a shell CREATE TYPE int42 ( internallength = 4, - input = int4in, - output = int4out, + input = int42_in, + output = int42_out, alignment = int4, default = 42, passedbyvalue ); CREATE TYPE text_w_default ( internallength = variable, - input = textin, - output = textout, + input = text_w_default_in, + output = text_w_default_out, alignment = int4, default = 'zippo' ); diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out index cb1193b0407..efdc8c6a500 100644 --- a/src/test/regress/expected/opr_sanity.out +++ b/src/test/regress/expected/opr_sanity.out @@ -16,16 +16,23 @@ -- that test creates some bogus operators... -- **************** pg_proc **************** -- Look for illegal values in pg_proc fields. --- NOTE: currently there are a few pg_proc entries that have prorettype = 0. --- Someday that ought to be cleaned up. +-- NOTE: in reality pronargs could be more than 10, but I'm too lazy to put +-- a larger number of proargtypes check clauses in here. If we ever have +-- more-than-10-arg functions in the standard catalogs, extend this query. SELECT p1.oid, p1.proname FROM pg_proc as p1 -WHERE (p1.prolang = 0 OR p1.prorettype = 0 OR - p1.pronargs < 0 OR p1.pronargs > 16) - AND p1.proname !~ '^pl[^_]+_call_handler$' - AND p1.proname !~ '^RI_FKey_' - AND p1.proname !~ 'costestimate$' - AND p1.proname != 'update_pg_pwd_and_pg_group'; +WHERE p1.prolang = 0 OR p1.prorettype = 0 OR + p1.pronargs < 0 OR p1.pronargs > 10 OR + (p1.proargtypes[0] = 0 AND p1.pronargs > 0) OR + (p1.proargtypes[1] = 0 AND p1.pronargs > 1) OR + (p1.proargtypes[2] = 0 AND p1.pronargs > 2) OR + (p1.proargtypes[3] = 0 AND p1.pronargs > 3) OR + (p1.proargtypes[4] = 0 AND p1.pronargs > 4) OR + (p1.proargtypes[5] = 0 AND p1.pronargs > 5) OR + (p1.proargtypes[6] = 0 AND p1.pronargs > 6) OR + (p1.proargtypes[7] = 0 AND p1.pronargs > 7) OR + (p1.proargtypes[8] = 0 AND p1.pronargs > 8) OR + (p1.proargtypes[9] = 0 AND p1.pronargs > 9); oid | proname -----+--------- (0 rows) @@ -217,7 +224,7 @@ WHERE c.castfunc = 0 AND NOT c.castimplicit; SELECT * FROM pg_cast c WHERE c.castfunc = 0 AND - NOT EXISTS (SELECT * FROM pg_cast k + NOT EXISTS (SELECT 1 FROM pg_cast k WHERE k.castfunc = 0 AND k.castsource = c.casttarget AND k.casttarget = c.castsource); @@ -341,7 +348,7 @@ WHERE p1.oprlsortop != 0 AND SELECT p1.oid, p1.oprname FROM pg_operator AS p1 WHERE p1.oprlsortop != 0 AND NOT - EXISTS(SELECT * FROM pg_operator AS p2 WHERE + EXISTS(SELECT 1 FROM pg_operator AS p2 WHERE p2.oprname = '<' AND p2.oprleft = p1.oprleft AND p2.oprright = p1.oprright AND @@ -352,7 +359,7 @@ WHERE p1.oprlsortop != 0 AND NOT SELECT p1.oid, p1.oprname FROM pg_operator AS p1 WHERE p1.oprlsortop != 0 AND NOT - EXISTS(SELECT * FROM pg_operator AS p2 WHERE + EXISTS(SELECT 1 FROM pg_operator AS p2 WHERE p2.oprname = '>' AND p2.oprleft = p1.oprleft AND p2.oprright = p1.oprright AND @@ -468,15 +475,17 @@ WHERE p1.oprcode = p2.oid AND -- If oprrest is set, the operator must return boolean, -- and it must link to a proc with the right signature -- to be a restriction selectivity estimator. --- The proc signature we want is: float8 proc(opaque, oid, opaque, int4) +-- The proc signature we want is: float8 proc(internal, oid, internal, int4) SELECT p1.oid, p1.oprname, p2.oid, p2.proname FROM pg_operator AS p1, pg_proc AS p2 WHERE p1.oprrest = p2.oid AND (p1.oprresult != 'bool'::regtype OR p2.prorettype != 'float8'::regtype OR p2.proretset OR p2.pronargs != 4 OR - p2.proargtypes[0] != 0 OR p2.proargtypes[1] != 'oid'::regtype OR - p2.proargtypes[2] != 0 OR p2.proargtypes[3] != 'int4'::regtype); + p2.proargtypes[0] != 'internal'::regtype OR + p2.proargtypes[1] != 'oid'::regtype OR + p2.proargtypes[2] != 'internal'::regtype OR + p2.proargtypes[3] != 'int4'::regtype); oid | oprname | oid | proname -----+---------+-----+--------- (0 rows) @@ -484,15 +493,16 @@ WHERE p1.oprrest = p2.oid AND -- If oprjoin is set, the operator must be a binary boolean op, -- and it must link to a proc with the right signature -- to be a join selectivity estimator. --- The proc signature we want is: float8 proc(opaque, oid, opaque) +-- The proc signature we want is: float8 proc(internal, oid, internal) SELECT p1.oid, p1.oprname, p2.oid, p2.proname FROM pg_operator AS p1, pg_proc AS p2 WHERE p1.oprjoin = p2.oid AND (p1.oprkind != 'b' OR p1.oprresult != 'bool'::regtype OR p2.prorettype != 'float8'::regtype OR p2.proretset OR p2.pronargs != 3 OR - p2.proargtypes[0] != 0 OR p2.proargtypes[1] != 'oid'::regtype OR - p2.proargtypes[2] != 0); + p2.proargtypes[0] != 'internal'::regtype OR + p2.proargtypes[1] != 'oid'::regtype OR + p2.proargtypes[2] != 'internal'::regtype); oid | oprname | oid | proname -----+---------+-----+--------- (0 rows) @@ -547,7 +557,7 @@ WHERE a.aggfnoid = p.oid AND a.aggtranstype != p2.prorettype OR a.aggtranstype != p2.proargtypes[0] OR NOT ((p2.pronargs = 2 AND p.proargtypes[0] = p2.proargtypes[1]) OR - (p2.pronargs = 1 AND p.proargtypes[0] = 0))); + (p2.pronargs = 1 AND p.proargtypes[0] = '"any"'::regtype))); aggfnoid | proname | oid | proname ----------+---------+-----+------------- 2121 | max | 768 | int4larger diff --git a/src/test/regress/expected/plpgsql.out b/src/test/regress/expected/plpgsql.out index 91d7c34b663..7682be33eb7 100644 --- a/src/test/regress/expected/plpgsql.out +++ b/src/test/regress/expected/plpgsql.out @@ -74,7 +74,7 @@ create unique index PHone_name on PHone using btree (slotname bpchar_ops); -- * AFTER UPDATE on Room -- * - If room no changes let wall slots follow -- ************************************************************ -create function tg_room_au() returns opaque as ' +create function tg_room_au() returns trigger as ' begin if new.roomno != old.roomno then update WSlot set roomno = new.roomno where roomno = old.roomno; @@ -88,7 +88,7 @@ create trigger tg_room_au after update -- * AFTER DELETE on Room -- * - delete wall slots in this room -- ************************************************************ -create function tg_room_ad() returns opaque as ' +create function tg_room_ad() returns trigger as ' begin delete from WSlot where roomno = old.roomno; return old; @@ -100,7 +100,7 @@ create trigger tg_room_ad after delete -- * BEFORE INSERT or UPDATE on WSlot -- * - Check that room exists -- ************************************************************ -create function tg_wslot_biu() returns opaque as ' +create function tg_wslot_biu() returns trigger as ' begin if count(*) = 0 from Room where roomno = new.roomno then raise exception ''Room % does not exist'', new.roomno; @@ -114,7 +114,7 @@ create trigger tg_wslot_biu before insert or update -- * AFTER UPDATE on PField -- * - Let PSlots of this field follow -- ************************************************************ -create function tg_pfield_au() returns opaque as ' +create function tg_pfield_au() returns trigger as ' begin if new.name != old.name then update PSlot set pfname = new.name where pfname = old.name; @@ -128,7 +128,7 @@ create trigger tg_pfield_au after update -- * AFTER DELETE on PField -- * - Remove all slots of this patchfield -- ************************************************************ -create function tg_pfield_ad() returns opaque as ' +create function tg_pfield_ad() returns trigger as ' begin delete from PSlot where pfname = old.name; return old; @@ -140,7 +140,7 @@ create trigger tg_pfield_ad after delete -- * BEFORE INSERT or UPDATE on PSlot -- * - Ensure that our patchfield does exist -- ************************************************************ -create function tg_pslot_biu() returns opaque as ' +create function tg_pslot_biu() returns trigger as ' declare pfrec record; rename new to ps; @@ -158,7 +158,7 @@ create trigger tg_pslot_biu before insert or update -- * AFTER UPDATE on System -- * - If system name changes let interfaces follow -- ************************************************************ -create function tg_system_au() returns opaque as ' +create function tg_system_au() returns trigger as ' begin if new.name != old.name then update IFace set sysname = new.name where sysname = old.name; @@ -172,7 +172,7 @@ create trigger tg_system_au after update -- * BEFORE INSERT or UPDATE on IFace -- * - set the slotname to IF.sysname.ifname -- ************************************************************ -create function tg_iface_biu() returns opaque as ' +create function tg_iface_biu() returns trigger as ' declare sname text; sysrec record; @@ -197,7 +197,7 @@ create trigger tg_iface_biu before insert or update -- * AFTER INSERT or UPDATE or DELETE on Hub -- * - insert/delete/rename slots as required -- ************************************************************ -create function tg_hub_a() returns opaque as ' +create function tg_hub_a() returns trigger as ' declare hname text; dummy integer; @@ -250,7 +250,7 @@ end; -- * - prevent from manual manipulation -- * - set the slotname to HS.hubname.slotno -- ************************************************************ -create function tg_hslot_biu() returns opaque as ' +create function tg_hslot_biu() returns trigger as ' declare sname text; xname HSlot.slotname%TYPE; @@ -286,7 +286,7 @@ create trigger tg_hslot_biu before insert or update -- * BEFORE DELETE on HSlot -- * - prevent from manual manipulation -- ************************************************************ -create function tg_hslot_bd() returns opaque as ' +create function tg_hslot_bd() returns trigger as ' declare hubrec record; begin @@ -306,7 +306,7 @@ create trigger tg_hslot_bd before delete -- * BEFORE INSERT on all slots -- * - Check name prefix -- ************************************************************ -create function tg_chkslotname() returns opaque as ' +create function tg_chkslotname() returns trigger as ' begin if substr(new.slotname, 1, 2) != tg_argv[0] then raise exception ''slotname must begin with %'', tg_argv[0]; @@ -328,7 +328,7 @@ create trigger tg_chkslotname before insert -- * BEFORE INSERT or UPDATE on all slots with slotlink -- * - Set slotlink to empty string if NULL value given -- ************************************************************ -create function tg_chkslotlink() returns opaque as ' +create function tg_chkslotlink() returns trigger as ' begin if new.slotlink isnull then new.slotlink := ''''; @@ -350,7 +350,7 @@ create trigger tg_chkslotlink before insert or update -- * BEFORE INSERT or UPDATE on all slots with backlink -- * - Set backlink to empty string if NULL value given -- ************************************************************ -create function tg_chkbacklink() returns opaque as ' +create function tg_chkbacklink() returns trigger as ' begin if new.backlink isnull then new.backlink := ''''; @@ -368,7 +368,7 @@ create trigger tg_chkbacklink before insert or update -- * BEFORE UPDATE on PSlot -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_pslot_bu() returns opaque as ' +create function tg_pslot_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from PSlot where slotname = old.slotname; @@ -394,7 +394,7 @@ create trigger tg_pslot_bu before update -- * BEFORE UPDATE on WSlot -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_wslot_bu() returns opaque as ' +create function tg_wslot_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from WSlot where slotname = old.slotname; @@ -420,7 +420,7 @@ create trigger tg_wslot_bu before update -- * BEFORE UPDATE on PLine -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_pline_bu() returns opaque as ' +create function tg_pline_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from PLine where slotname = old.slotname; @@ -446,7 +446,7 @@ create trigger tg_pline_bu before update -- * BEFORE UPDATE on IFace -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_iface_bu() returns opaque as ' +create function tg_iface_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from IFace where slotname = old.slotname; @@ -472,7 +472,7 @@ create trigger tg_iface_bu before update -- * BEFORE UPDATE on HSlot -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_hslot_bu() returns opaque as ' +create function tg_hslot_bu() returns trigger as ' begin if new.slotname != old.slotname or new.hubname != old.hubname then delete from HSlot where slotname = old.slotname; @@ -498,7 +498,7 @@ create trigger tg_hslot_bu before update -- * BEFORE UPDATE on PHone -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_phone_bu() returns opaque as ' +create function tg_phone_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from PHone where slotname = old.slotname; @@ -522,7 +522,7 @@ create trigger tg_phone_bu before update -- * AFTER INSERT or UPDATE or DELETE on slot with backlink -- * - Ensure that the opponent correctly points back to us -- ************************************************************ -create function tg_backlink_a() returns opaque as ' +create function tg_backlink_a() returns trigger as ' declare dummy integer; begin @@ -666,7 +666,7 @@ end; -- * AFTER INSERT or UPDATE or DELETE on slot with slotlink -- * - Ensure that the opponent correctly points back to us -- ************************************************************ -create function tg_slotlink_a() returns opaque as ' +create function tg_slotlink_a() returns trigger as ' declare dummy integer; begin diff --git a/src/test/regress/expected/type_sanity.out b/src/test/regress/expected/type_sanity.out index 68abfec74f3..e0890fb01af 100644 --- a/src/test/regress/expected/type_sanity.out +++ b/src/test/regress/expected/type_sanity.out @@ -15,13 +15,12 @@ -- Look for illegal values in pg_type fields. SELECT p1.oid, p1.typname FROM pg_type as p1 -WHERE (p1.typlen <= 0 AND p1.typlen != -1) OR - p1.typtype not in('b', 'c', 'd', 'p') OR +WHERE p1.typnamespace = 0 OR + (p1.typlen <= 0 AND p1.typlen != -1) OR + (p1.typtype not in ('b', 'c', 'd', 'p')) OR NOT p1.typisdefined OR - (p1.typalign != 'c' AND p1.typalign != 's' AND - p1.typalign != 'i' AND p1.typalign != 'd') OR - (p1.typstorage != 'p' AND p1.typstorage != 'x' AND - p1.typstorage != 'e' AND p1.typstorage != 'm'); + (p1.typalign not in ('c', 's', 'i', 'd')) OR + (p1.typstorage not in ('p', 'x', 'e', 'm')); oid | typname -----+--------- (0 rows) @@ -91,27 +90,59 @@ WHERE p1.typtype != 'c' AND (0 rows) -- Check for bogus typinput routines --- FIXME: ought to check prorettype, but there are special cases that make it --- hard: prorettype might be binary-compatible with the type but not the same, --- and for array types array_in's result has nothing to do with anything. SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 -WHERE p1.typinput = p2.oid AND p1.typtype = 'b' AND - (p2.pronargs != 1 OR p2.proretset) AND - (p2.pronargs != 3 OR p2.proretset OR p2.proargtypes[2] != 'int4'::regtype); +WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT + ((p2.pronargs = 1 AND p2.proargtypes[0] = 'cstring'::regtype) OR + (p2.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND + p2.proargtypes[1] = 'oid'::regtype AND + p2.proargtypes[2] = 'int4'::regtype)); + oid | typname | oid | proname +-----+---------+-----+--------- +(0 rows) + +-- As of 7.3, this check finds SET and refcursor, which are borrowing +-- other types' I/O routines +SELECT p1.oid, p1.typname, p2.oid, p2.proname +FROM pg_type AS p1, pg_proc AS p2 +WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT + (p1.typelem != 0 AND p1.typlen < 0) AND NOT + (p2.prorettype = p1.oid AND NOT p2.proretset); + oid | typname | oid | proname +------+-----------+-----+----------- + 32 | SET | 109 | unknownin + 1790 | refcursor | 46 | textin +(2 rows) + +-- Varlena array types will point to array_in +SELECT p1.oid, p1.typname, p2.oid, p2.proname +FROM pg_type AS p1, pg_proc AS p2 +WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND + (p1.typelem != 0 AND p1.typlen < 0) AND NOT + (p2.oid = 'array_in'::regproc); oid | typname | oid | proname -----+---------+-----+--------- (0 rows) -- Check for bogus typoutput routines --- The first OR subclause detects bogus non-array cases, --- the second one detects bogus array cases. --- FIXME: ought to check prorettype, but not clear what it should be. +-- As of 7.3, this check finds SET and refcursor, which are borrowing +-- other types' I/O routines +SELECT p1.oid, p1.typname, p2.oid, p2.proname +FROM pg_type AS p1, pg_proc AS p2 +WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT + ((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR + (p2.oid = 'array_out'::regproc AND + p1.typelem != 0)); + oid | typname | oid | proname +------+-----------+-----+------------ + 32 | SET | 110 | unknownout + 1790 | refcursor | 47 | textout +(2 rows) + SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 -WHERE p1.typoutput = p2.oid AND p1.typtype = 'b' AND - (p2.pronargs != 1 OR p2.proretset) AND - (p2.pronargs != 2 OR p2.proretset OR p1.typelem = 0); +WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT + (p2.prorettype = 'cstring'::regtype AND NOT p2.proretset); oid | typname | oid | proname -----+---------+-----+--------- (0 rows) diff --git a/src/test/regress/input/create_function_1.source b/src/test/regress/input/create_function_1.source index 14ae6ff2bbb..f657e3740cd 100644 --- a/src/test/regress/input/create_function_1.source +++ b/src/test/regress/input/create_function_1.source @@ -2,38 +2,48 @@ -- CREATE_FUNCTION_1 -- -CREATE FUNCTION widget_in(opaque) +CREATE FUNCTION widget_in(cstring) RETURNS widget AS '@abs_builddir@/regress@DLSUFFIX@' LANGUAGE 'c'; -CREATE FUNCTION widget_out(opaque) - RETURNS opaque +CREATE FUNCTION widget_out(widget) + RETURNS cstring + AS '@abs_builddir@/regress@DLSUFFIX@' + LANGUAGE 'c'; + +CREATE FUNCTION int44in(cstring) + RETURNS city_budget + AS '@abs_builddir@/regress@DLSUFFIX@' + LANGUAGE 'c'; + +CREATE FUNCTION int44out(city_budget) + RETURNS cstring AS '@abs_builddir@/regress@DLSUFFIX@' LANGUAGE 'c'; CREATE FUNCTION check_primary_key () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@' LANGUAGE 'C'; CREATE FUNCTION check_foreign_key () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@' LANGUAGE 'C'; CREATE FUNCTION autoinc () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@' LANGUAGE 'C'; CREATE FUNCTION funny_dup17 () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/regress@DLSUFFIX@' LANGUAGE 'C'; CREATE FUNCTION ttdummy () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/regress@DLSUFFIX@' LANGUAGE 'C'; diff --git a/src/test/regress/output/create_function_1.source b/src/test/regress/output/create_function_1.source index 2c98b6c2eac..9632114f93c 100644 --- a/src/test/regress/output/create_function_1.source +++ b/src/test/regress/output/create_function_1.source @@ -1,33 +1,44 @@ -- -- CREATE_FUNCTION_1 -- -CREATE FUNCTION widget_in(opaque) +CREATE FUNCTION widget_in(cstring) RETURNS widget AS '@abs_builddir@/regress@DLSUFFIX@' LANGUAGE 'c'; WARNING: ProcedureCreate: type widget is not yet defined -CREATE FUNCTION widget_out(opaque) - RETURNS opaque +CREATE FUNCTION widget_out(widget) + RETURNS cstring AS '@abs_builddir@/regress@DLSUFFIX@' LANGUAGE 'c'; +WARNING: Argument type "widget" is only a shell +CREATE FUNCTION int44in(cstring) + RETURNS city_budget + AS '@abs_builddir@/regress@DLSUFFIX@' + LANGUAGE 'c'; +WARNING: ProcedureCreate: type city_budget is not yet defined +CREATE FUNCTION int44out(city_budget) + RETURNS cstring + AS '@abs_builddir@/regress@DLSUFFIX@' + LANGUAGE 'c'; +WARNING: Argument type "city_budget" is only a shell CREATE FUNCTION check_primary_key () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@' LANGUAGE 'C'; CREATE FUNCTION check_foreign_key () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@' LANGUAGE 'C'; CREATE FUNCTION autoinc () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@' LANGUAGE 'C'; CREATE FUNCTION funny_dup17 () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/regress@DLSUFFIX@' LANGUAGE 'C'; CREATE FUNCTION ttdummy () - RETURNS opaque + RETURNS trigger AS '@abs_builddir@/regress@DLSUFFIX@' LANGUAGE 'C'; CREATE FUNCTION set_ttdummy (int4) diff --git a/src/test/regress/regress.c b/src/test/regress/regress.c index 3ef2c1b6db7..2965dca69de 100644 --- a/src/test/regress/regress.c +++ b/src/test/regress/regress.c @@ -1,5 +1,5 @@ /* - * $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.50 2002/03/06 06:10:50 momjian Exp $ + * $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.51 2002/08/22 00:01:51 tgl Exp $ */ #include "postgres.h" @@ -26,6 +26,8 @@ extern Datum overpaid(PG_FUNCTION_ARGS); extern Datum boxarea(PG_FUNCTION_ARGS); extern char *reverse_name(char *string); extern int oldstyle_length(int n, text *t); +extern Datum int44in(PG_FUNCTION_ARGS); +extern Datum int44out(PG_FUNCTION_ARGS); /* ** Distance from a point to a path @@ -684,3 +686,61 @@ set_ttdummy(PG_FUNCTION_ARGS) PG_RETURN_INT32(1); } + + +/* + * Type int44 has no real-world use, but the regression tests use it. + * It's a four-element vector of int4's. + */ + +/* + * int44in - converts "num num ..." to internal form + * + * Note: Fills any missing positions with zeroes. + */ +PG_FUNCTION_INFO_V1(int44in); + +Datum +int44in(PG_FUNCTION_ARGS) +{ + char *input_string = PG_GETARG_CSTRING(0); + int32 *result = (int32 *) palloc(4 * sizeof(int32)); + int i; + + i = sscanf(input_string, + "%d, %d, %d, %d", + &result[0], + &result[1], + &result[2], + &result[3]); + while (i < 4) + result[i++] = 0; + + PG_RETURN_POINTER(result); +} + +/* + * int44out - converts internal form to "num num ..." + */ +PG_FUNCTION_INFO_V1(int44out); + +Datum +int44out(PG_FUNCTION_ARGS) +{ + int32 *an_array = (int32 *) PG_GETARG_POINTER(0); + char *result = (char *) palloc(16 * 4); /* Allow 14 digits + + * sign */ + int i; + char *walk; + + walk = result; + for (i = 0; i < 4; i++) + { + pg_ltoa(an_array[i], walk); + while (*++walk != '\0') + ; + *walk++ = ' '; + } + *--walk = '\0'; + PG_RETURN_CSTRING(result); +} diff --git a/src/test/regress/sql/copy2.sql b/src/test/regress/sql/copy2.sql index 4f0d50247f1..72c52dba113 100644 --- a/src/test/regress/sql/copy2.sql +++ b/src/test/regress/sql/copy2.sql @@ -6,14 +6,14 @@ CREATE TABLE x ( e text ); -CREATE FUNCTION fn_x_before () RETURNS OPAQUE AS ' +CREATE FUNCTION fn_x_before () RETURNS TRIGGER AS ' BEGIN NEW.e := ''before trigger fired''::text; return NEW; END; ' language 'plpgsql'; -CREATE FUNCTION fn_x_after () RETURNS OPAQUE AS ' +CREATE FUNCTION fn_x_after () RETURNS TRIGGER AS ' BEGIN UPDATE x set e=''after trigger fired'' where c=''stuff''; return NULL; diff --git a/src/test/regress/sql/create_type.sql b/src/test/regress/sql/create_type.sql index 9b37981bd49..ddcba72624e 100644 --- a/src/test/regress/sql/create_type.sql +++ b/src/test/regress/sql/create_type.sql @@ -18,10 +18,28 @@ CREATE TYPE city_budget ( -- Test type-related default values (broken in releases before PG 7.2) +-- Make dummy I/O routines using the existing internal support for int4, text +CREATE FUNCTION int42_in(cstring) + RETURNS int42 + AS 'int4in' + LANGUAGE 'internal' WITH (isStrict); +CREATE FUNCTION int42_out(int42) + RETURNS cstring + AS 'int4out' + LANGUAGE 'internal' WITH (isStrict); +CREATE FUNCTION text_w_default_in(cstring) + RETURNS text_w_default + AS 'textin' + LANGUAGE 'internal' WITH (isStrict); +CREATE FUNCTION text_w_default_out(text_w_default) + RETURNS cstring + AS 'textout' + LANGUAGE 'internal' WITH (isStrict); + CREATE TYPE int42 ( internallength = 4, - input = int4in, - output = int4out, + input = int42_in, + output = int42_out, alignment = int4, default = 42, passedbyvalue @@ -29,8 +47,8 @@ CREATE TYPE int42 ( CREATE TYPE text_w_default ( internallength = variable, - input = textin, - output = textout, + input = text_w_default_in, + output = text_w_default_out, alignment = int4, default = 'zippo' ); diff --git a/src/test/regress/sql/drop.sql b/src/test/regress/sql/drop.sql index a466e6f7c21..2b143d95bc7 100644 --- a/src/test/regress/sql/drop.sql +++ b/src/test/regress/sql/drop.sql @@ -24,9 +24,9 @@ DROP FUNCTION equipment(hobbies_r); DROP FUNCTION user_relns(); -DROP FUNCTION widget_in(opaque); +DROP FUNCTION widget_in(cstring); -DROP FUNCTION widget_out(opaque); +DROP FUNCTION widget_out(widget); DROP FUNCTION pt_in_widget(point,widget); diff --git a/src/test/regress/sql/opr_sanity.sql b/src/test/regress/sql/opr_sanity.sql index 9d08dbd5bb3..d9be98a5fd3 100644 --- a/src/test/regress/sql/opr_sanity.sql +++ b/src/test/regress/sql/opr_sanity.sql @@ -18,17 +18,24 @@ -- **************** pg_proc **************** -- Look for illegal values in pg_proc fields. --- NOTE: currently there are a few pg_proc entries that have prorettype = 0. --- Someday that ought to be cleaned up. +-- NOTE: in reality pronargs could be more than 10, but I'm too lazy to put +-- a larger number of proargtypes check clauses in here. If we ever have +-- more-than-10-arg functions in the standard catalogs, extend this query. SELECT p1.oid, p1.proname FROM pg_proc as p1 -WHERE (p1.prolang = 0 OR p1.prorettype = 0 OR - p1.pronargs < 0 OR p1.pronargs > 16) - AND p1.proname !~ '^pl[^_]+_call_handler$' - AND p1.proname !~ '^RI_FKey_' - AND p1.proname !~ 'costestimate$' - AND p1.proname != 'update_pg_pwd_and_pg_group'; +WHERE p1.prolang = 0 OR p1.prorettype = 0 OR + p1.pronargs < 0 OR p1.pronargs > 10 OR + (p1.proargtypes[0] = 0 AND p1.pronargs > 0) OR + (p1.proargtypes[1] = 0 AND p1.pronargs > 1) OR + (p1.proargtypes[2] = 0 AND p1.pronargs > 2) OR + (p1.proargtypes[3] = 0 AND p1.pronargs > 3) OR + (p1.proargtypes[4] = 0 AND p1.pronargs > 4) OR + (p1.proargtypes[5] = 0 AND p1.pronargs > 5) OR + (p1.proargtypes[6] = 0 AND p1.pronargs > 6) OR + (p1.proargtypes[7] = 0 AND p1.pronargs > 7) OR + (p1.proargtypes[8] = 0 AND p1.pronargs > 8) OR + (p1.proargtypes[9] = 0 AND p1.pronargs > 9); -- Look for conflicting proc definitions (same names and input datatypes). -- (This test should be dead code now that we have the unique index @@ -174,7 +181,7 @@ WHERE c.castfunc = 0 AND NOT c.castimplicit; SELECT * FROM pg_cast c WHERE c.castfunc = 0 AND - NOT EXISTS (SELECT * FROM pg_cast k + NOT EXISTS (SELECT 1 FROM pg_cast k WHERE k.castfunc = 0 AND k.castsource = c.casttarget AND k.casttarget = c.castsource); @@ -279,7 +286,7 @@ WHERE p1.oprlsortop != 0 AND SELECT p1.oid, p1.oprname FROM pg_operator AS p1 WHERE p1.oprlsortop != 0 AND NOT - EXISTS(SELECT * FROM pg_operator AS p2 WHERE + EXISTS(SELECT 1 FROM pg_operator AS p2 WHERE p2.oprname = '<' AND p2.oprleft = p1.oprleft AND p2.oprright = p1.oprright AND @@ -287,7 +294,7 @@ WHERE p1.oprlsortop != 0 AND NOT SELECT p1.oid, p1.oprname FROM pg_operator AS p1 WHERE p1.oprlsortop != 0 AND NOT - EXISTS(SELECT * FROM pg_operator AS p2 WHERE + EXISTS(SELECT 1 FROM pg_operator AS p2 WHERE p2.oprname = '>' AND p2.oprleft = p1.oprleft AND p2.oprright = p1.oprright AND @@ -386,7 +393,7 @@ WHERE p1.oprcode = p2.oid AND -- If oprrest is set, the operator must return boolean, -- and it must link to a proc with the right signature -- to be a restriction selectivity estimator. --- The proc signature we want is: float8 proc(opaque, oid, opaque, int4) +-- The proc signature we want is: float8 proc(internal, oid, internal, int4) SELECT p1.oid, p1.oprname, p2.oid, p2.proname FROM pg_operator AS p1, pg_proc AS p2 @@ -394,13 +401,15 @@ WHERE p1.oprrest = p2.oid AND (p1.oprresult != 'bool'::regtype OR p2.prorettype != 'float8'::regtype OR p2.proretset OR p2.pronargs != 4 OR - p2.proargtypes[0] != 0 OR p2.proargtypes[1] != 'oid'::regtype OR - p2.proargtypes[2] != 0 OR p2.proargtypes[3] != 'int4'::regtype); + p2.proargtypes[0] != 'internal'::regtype OR + p2.proargtypes[1] != 'oid'::regtype OR + p2.proargtypes[2] != 'internal'::regtype OR + p2.proargtypes[3] != 'int4'::regtype); -- If oprjoin is set, the operator must be a binary boolean op, -- and it must link to a proc with the right signature -- to be a join selectivity estimator. --- The proc signature we want is: float8 proc(opaque, oid, opaque) +-- The proc signature we want is: float8 proc(internal, oid, internal) SELECT p1.oid, p1.oprname, p2.oid, p2.proname FROM pg_operator AS p1, pg_proc AS p2 @@ -408,8 +417,9 @@ WHERE p1.oprjoin = p2.oid AND (p1.oprkind != 'b' OR p1.oprresult != 'bool'::regtype OR p2.prorettype != 'float8'::regtype OR p2.proretset OR p2.pronargs != 3 OR - p2.proargtypes[0] != 0 OR p2.proargtypes[1] != 'oid'::regtype OR - p2.proargtypes[2] != 0); + p2.proargtypes[0] != 'internal'::regtype OR + p2.proargtypes[1] != 'oid'::regtype OR + p2.proargtypes[2] != 'internal'::regtype); -- **************** pg_aggregate **************** @@ -454,7 +464,7 @@ WHERE a.aggfnoid = p.oid AND a.aggtranstype != p2.prorettype OR a.aggtranstype != p2.proargtypes[0] OR NOT ((p2.pronargs = 2 AND p.proargtypes[0] = p2.proargtypes[1]) OR - (p2.pronargs = 1 AND p.proargtypes[0] = 0))); + (p2.pronargs = 1 AND p.proargtypes[0] = '"any"'::regtype))); -- Cross-check finalfn (if present) against its entry in pg_proc. -- FIXME: what about binary-compatible types? diff --git a/src/test/regress/sql/plpgsql.sql b/src/test/regress/sql/plpgsql.sql index 618273823b3..2f967c65ce4 100644 --- a/src/test/regress/sql/plpgsql.sql +++ b/src/test/regress/sql/plpgsql.sql @@ -107,7 +107,7 @@ create unique index PHone_name on PHone using btree (slotname bpchar_ops); -- * AFTER UPDATE on Room -- * - If room no changes let wall slots follow -- ************************************************************ -create function tg_room_au() returns opaque as ' +create function tg_room_au() returns trigger as ' begin if new.roomno != old.roomno then update WSlot set roomno = new.roomno where roomno = old.roomno; @@ -124,7 +124,7 @@ create trigger tg_room_au after update -- * AFTER DELETE on Room -- * - delete wall slots in this room -- ************************************************************ -create function tg_room_ad() returns opaque as ' +create function tg_room_ad() returns trigger as ' begin delete from WSlot where roomno = old.roomno; return old; @@ -139,7 +139,7 @@ create trigger tg_room_ad after delete -- * BEFORE INSERT or UPDATE on WSlot -- * - Check that room exists -- ************************************************************ -create function tg_wslot_biu() returns opaque as ' +create function tg_wslot_biu() returns trigger as ' begin if count(*) = 0 from Room where roomno = new.roomno then raise exception ''Room % does not exist'', new.roomno; @@ -156,7 +156,7 @@ create trigger tg_wslot_biu before insert or update -- * AFTER UPDATE on PField -- * - Let PSlots of this field follow -- ************************************************************ -create function tg_pfield_au() returns opaque as ' +create function tg_pfield_au() returns trigger as ' begin if new.name != old.name then update PSlot set pfname = new.name where pfname = old.name; @@ -173,7 +173,7 @@ create trigger tg_pfield_au after update -- * AFTER DELETE on PField -- * - Remove all slots of this patchfield -- ************************************************************ -create function tg_pfield_ad() returns opaque as ' +create function tg_pfield_ad() returns trigger as ' begin delete from PSlot where pfname = old.name; return old; @@ -188,7 +188,7 @@ create trigger tg_pfield_ad after delete -- * BEFORE INSERT or UPDATE on PSlot -- * - Ensure that our patchfield does exist -- ************************************************************ -create function tg_pslot_biu() returns opaque as ' +create function tg_pslot_biu() returns trigger as ' declare pfrec record; rename new to ps; @@ -209,7 +209,7 @@ create trigger tg_pslot_biu before insert or update -- * AFTER UPDATE on System -- * - If system name changes let interfaces follow -- ************************************************************ -create function tg_system_au() returns opaque as ' +create function tg_system_au() returns trigger as ' begin if new.name != old.name then update IFace set sysname = new.name where sysname = old.name; @@ -226,7 +226,7 @@ create trigger tg_system_au after update -- * BEFORE INSERT or UPDATE on IFace -- * - set the slotname to IF.sysname.ifname -- ************************************************************ -create function tg_iface_biu() returns opaque as ' +create function tg_iface_biu() returns trigger as ' declare sname text; sysrec record; @@ -254,7 +254,7 @@ create trigger tg_iface_biu before insert or update -- * AFTER INSERT or UPDATE or DELETE on Hub -- * - insert/delete/rename slots as required -- ************************************************************ -create function tg_hub_a() returns opaque as ' +create function tg_hub_a() returns trigger as ' declare hname text; dummy integer; @@ -312,7 +312,7 @@ end; -- * - prevent from manual manipulation -- * - set the slotname to HS.hubname.slotno -- ************************************************************ -create function tg_hslot_biu() returns opaque as ' +create function tg_hslot_biu() returns trigger as ' declare sname text; xname HSlot.slotname%TYPE; @@ -351,7 +351,7 @@ create trigger tg_hslot_biu before insert or update -- * BEFORE DELETE on HSlot -- * - prevent from manual manipulation -- ************************************************************ -create function tg_hslot_bd() returns opaque as ' +create function tg_hslot_bd() returns trigger as ' declare hubrec record; begin @@ -374,7 +374,7 @@ create trigger tg_hslot_bd before delete -- * BEFORE INSERT on all slots -- * - Check name prefix -- ************************************************************ -create function tg_chkslotname() returns opaque as ' +create function tg_chkslotname() returns trigger as ' begin if substr(new.slotname, 1, 2) != tg_argv[0] then raise exception ''slotname must begin with %'', tg_argv[0]; @@ -403,7 +403,7 @@ create trigger tg_chkslotname before insert -- * BEFORE INSERT or UPDATE on all slots with slotlink -- * - Set slotlink to empty string if NULL value given -- ************************************************************ -create function tg_chkslotlink() returns opaque as ' +create function tg_chkslotlink() returns trigger as ' begin if new.slotlink isnull then new.slotlink := ''''; @@ -432,7 +432,7 @@ create trigger tg_chkslotlink before insert or update -- * BEFORE INSERT or UPDATE on all slots with backlink -- * - Set backlink to empty string if NULL value given -- ************************************************************ -create function tg_chkbacklink() returns opaque as ' +create function tg_chkbacklink() returns trigger as ' begin if new.backlink isnull then new.backlink := ''''; @@ -455,7 +455,7 @@ create trigger tg_chkbacklink before insert or update -- * BEFORE UPDATE on PSlot -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_pslot_bu() returns opaque as ' +create function tg_pslot_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from PSlot where slotname = old.slotname; @@ -484,7 +484,7 @@ create trigger tg_pslot_bu before update -- * BEFORE UPDATE on WSlot -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_wslot_bu() returns opaque as ' +create function tg_wslot_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from WSlot where slotname = old.slotname; @@ -513,7 +513,7 @@ create trigger tg_wslot_bu before update -- * BEFORE UPDATE on PLine -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_pline_bu() returns opaque as ' +create function tg_pline_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from PLine where slotname = old.slotname; @@ -542,7 +542,7 @@ create trigger tg_pline_bu before update -- * BEFORE UPDATE on IFace -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_iface_bu() returns opaque as ' +create function tg_iface_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from IFace where slotname = old.slotname; @@ -571,7 +571,7 @@ create trigger tg_iface_bu before update -- * BEFORE UPDATE on HSlot -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_hslot_bu() returns opaque as ' +create function tg_hslot_bu() returns trigger as ' begin if new.slotname != old.slotname or new.hubname != old.hubname then delete from HSlot where slotname = old.slotname; @@ -600,7 +600,7 @@ create trigger tg_hslot_bu before update -- * BEFORE UPDATE on PHone -- * - do delete/insert instead of update if name changes -- ************************************************************ -create function tg_phone_bu() returns opaque as ' +create function tg_phone_bu() returns trigger as ' begin if new.slotname != old.slotname then delete from PHone where slotname = old.slotname; @@ -627,7 +627,7 @@ create trigger tg_phone_bu before update -- * AFTER INSERT or UPDATE or DELETE on slot with backlink -- * - Ensure that the opponent correctly points back to us -- ************************************************************ -create function tg_backlink_a() returns opaque as ' +create function tg_backlink_a() returns trigger as ' declare dummy integer; begin @@ -781,7 +781,7 @@ end; -- * AFTER INSERT or UPDATE or DELETE on slot with slotlink -- * - Ensure that the opponent correctly points back to us -- ************************************************************ -create function tg_slotlink_a() returns opaque as ' +create function tg_slotlink_a() returns trigger as ' declare dummy integer; begin diff --git a/src/test/regress/sql/type_sanity.sql b/src/test/regress/sql/type_sanity.sql index 5003ae6b165..0a9701de827 100644 --- a/src/test/regress/sql/type_sanity.sql +++ b/src/test/regress/sql/type_sanity.sql @@ -18,13 +18,12 @@ SELECT p1.oid, p1.typname FROM pg_type as p1 -WHERE (p1.typlen <= 0 AND p1.typlen != -1) OR - p1.typtype not in('b', 'c', 'd', 'p') OR +WHERE p1.typnamespace = 0 OR + (p1.typlen <= 0 AND p1.typlen != -1) OR + (p1.typtype not in ('b', 'c', 'd', 'p')) OR NOT p1.typisdefined OR - (p1.typalign != 'c' AND p1.typalign != 's' AND - p1.typalign != 'i' AND p1.typalign != 'd') OR - (p1.typstorage != 'p' AND p1.typstorage != 'x' AND - p1.typstorage != 'e' AND p1.typstorage != 'm'); + (p1.typalign not in ('c', 's', 'i', 'd')) OR + (p1.typstorage not in ('p', 'x', 'e', 'm')); -- Look for "pass by value" types that can't be passed by value. @@ -76,26 +75,45 @@ WHERE p1.typtype != 'c' AND (p1.typinput = 0 OR p1.typoutput = 0); -- Check for bogus typinput routines --- FIXME: ought to check prorettype, but there are special cases that make it --- hard: prorettype might be binary-compatible with the type but not the same, --- and for array types array_in's result has nothing to do with anything. SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 -WHERE p1.typinput = p2.oid AND p1.typtype = 'b' AND - (p2.pronargs != 1 OR p2.proretset) AND - (p2.pronargs != 3 OR p2.proretset OR p2.proargtypes[2] != 'int4'::regtype); +WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT + ((p2.pronargs = 1 AND p2.proargtypes[0] = 'cstring'::regtype) OR + (p2.pronargs = 3 AND p2.proargtypes[0] = 'cstring'::regtype AND + p2.proargtypes[1] = 'oid'::regtype AND + p2.proargtypes[2] = 'int4'::regtype)); + +-- As of 7.3, this check finds SET and refcursor, which are borrowing +-- other types' I/O routines +SELECT p1.oid, p1.typname, p2.oid, p2.proname +FROM pg_type AS p1, pg_proc AS p2 +WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND NOT + (p1.typelem != 0 AND p1.typlen < 0) AND NOT + (p2.prorettype = p1.oid AND NOT p2.proretset); + +-- Varlena array types will point to array_in +SELECT p1.oid, p1.typname, p2.oid, p2.proname +FROM pg_type AS p1, pg_proc AS p2 +WHERE p1.typinput = p2.oid AND p1.typtype in ('b', 'p') AND + (p1.typelem != 0 AND p1.typlen < 0) AND NOT + (p2.oid = 'array_in'::regproc); -- Check for bogus typoutput routines --- The first OR subclause detects bogus non-array cases, --- the second one detects bogus array cases. --- FIXME: ought to check prorettype, but not clear what it should be. + +-- As of 7.3, this check finds SET and refcursor, which are borrowing +-- other types' I/O routines +SELECT p1.oid, p1.typname, p2.oid, p2.proname +FROM pg_type AS p1, pg_proc AS p2 +WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT + ((p2.pronargs = 1 AND p2.proargtypes[0] = p1.oid) OR + (p2.oid = 'array_out'::regproc AND + p1.typelem != 0)); SELECT p1.oid, p1.typname, p2.oid, p2.proname FROM pg_type AS p1, pg_proc AS p2 -WHERE p1.typoutput = p2.oid AND p1.typtype = 'b' AND - (p2.pronargs != 1 OR p2.proretset) AND - (p2.pronargs != 2 OR p2.proretset OR p1.typelem = 0); +WHERE p1.typoutput = p2.oid AND p1.typtype in ('b', 'p') AND NOT + (p2.prorettype = 'cstring'::regtype AND NOT p2.proretset); -- **************** pg_class **************** diff --git a/src/tutorial/complex.c b/src/tutorial/complex.c index 2dd4e6e6078..b95baa2be0e 100644 --- a/src/tutorial/complex.c +++ b/src/tutorial/complex.c @@ -48,14 +48,6 @@ complex_in(char *str) return result; } -/* - * You might have noticed a slight inconsistency between the following - * declaration and the SQL definition: - * CREATE FUNCTION complex_out(opaque) RETURNS opaque ... - * The reason is that the argument pass into complex_out is really just a - * pointer. POSTGRES thinks all output functions are: - * char *out_func(char *); - */ char * complex_out(Complex * complex) { @@ -64,8 +56,8 @@ complex_out(Complex * complex) if (complex == NULL) return NULL; - result = (char *) palloc(60); - sprintf(result, "(%g,%g)", complex->x, complex->y); + result = (char *) palloc(100); + snprintf(result, 100, "(%g,%g)", complex->x, complex->y); return result; } diff --git a/src/tutorial/complex.source b/src/tutorial/complex.source index 5df3c5d6779..382eea25e9f 100644 --- a/src/tutorial/complex.source +++ b/src/tutorial/complex.source @@ -8,7 +8,7 @@ -- Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group -- Portions Copyright (c) 1994, Regents of the University of California -- --- $Header: /cvsroot/pgsql/src/tutorial/complex.source,v 1.13 2002/07/30 05:24:56 tgl Exp $ +-- $Header: /cvsroot/pgsql/src/tutorial/complex.source,v 1.14 2002/08/22 00:01:51 tgl Exp $ -- --------------------------------------------------------------------------- @@ -28,7 +28,7 @@ -- (in memory) representation. You will get a message telling you 'complex' -- does not exist yet but that's okay. -CREATE FUNCTION complex_in(opaque) +CREATE FUNCTION complex_in(cstring) RETURNS complex AS '_OBJWD_/complex' LANGUAGE 'c'; @@ -36,8 +36,8 @@ CREATE FUNCTION complex_in(opaque) -- the output function 'complex_out' takes the internal representation and -- converts it into the textual representation. -CREATE FUNCTION complex_out(opaque) - RETURNS opaque +CREATE FUNCTION complex_out(complex) + RETURNS cstring AS '_OBJWD_/complex' LANGUAGE 'c'; @@ -195,4 +195,3 @@ SELECT * from test_complex where a > '(56.0,-22.5)'; -- clean up the example DROP TABLE test_complex; DROP TYPE complex CASCADE; -DROP FUNCTION complex_out(opaque); |