1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Implement array_send/array_recv (binary I/O for arrays). This exposed

the folly of not passing element type to typsend/typreceive, so fix that.
This commit is contained in:
Tom Lane
2003-05-09 23:01:45 +00:00
parent b1ee615a7f
commit ba1e066e46
7 changed files with 316 additions and 35 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.35 2003/05/08 22:19:56 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.36 2003/05/09 23:01:45 tgl Exp $
*
* DESCRIPTION
* The "DefineFoo" routines take the parse tree and pick out the
@@ -911,7 +911,8 @@ findTypeReceiveFunction(List *procname, Oid typeOid)
Oid procOid;
/*
* Receive functions take a single argument of type INTERNAL.
* Receive functions can take a single argument of type INTERNAL, or
* two arguments (internal, oid).
*/
MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid));
@@ -921,6 +922,12 @@ findTypeReceiveFunction(List *procname, Oid typeOid)
if (OidIsValid(procOid))
return procOid;
argList[1] = OIDOID;
procOid = LookupFuncName(procname, 2, argList);
if (OidIsValid(procOid))
return procOid;
func_error("TypeCreate", procname, 1, argList, NULL);
return InvalidOid; /* keep compiler quiet */
@@ -933,7 +940,8 @@ findTypeSendFunction(List *procname, Oid typeOid)
Oid procOid;
/*
* Send functions take a single argument of the type.
* Send functions can take a single argument of the type, or two
* arguments (data value, element OID).
*/
MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid));
@@ -943,6 +951,12 @@ findTypeSendFunction(List *procname, Oid typeOid)
if (OidIsValid(procOid))
return procOid;
argList[1] = OIDOID;
procOid = LookupFuncName(procname, 2, argList);
if (OidIsValid(procOid))
return procOid;
func_error("TypeCreate", procname, 1, argList, NULL);
return InvalidOid; /* keep compiler quiet */