From d78397d301172cccce14d5d789f296c47dd47c5e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 10 Jul 2005 21:14:00 +0000 Subject: Change typreceive function API so that receive functions get the same optional arguments as text input functions, ie, typioparam OID and atttypmod. Make all the datatypes that use typmod enforce it the same way in typreceive as they do in typinput. This fixes a problem with failure to enforce length restrictions during COPY FROM BINARY. --- src/backend/tcop/postgres.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/backend/tcop/postgres.c') diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 6973e9d3b3c..038a482239f 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.452 2005/07/04 04:51:49 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.453 2005/07/10 21:13:58 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -1571,9 +1571,10 @@ exec_bind_message(StringInfo input_message) getTypeBinaryInputInfo(ptype, &typreceive, &typioparam); params[i].value = - OidFunctionCall2(typreceive, + OidFunctionCall3(typreceive, PointerGetDatum(&pbuf), - ObjectIdGetDatum(typioparam)); + ObjectIdGetDatum(typioparam), + Int32GetDatum(-1)); /* Trouble if it didn't eat the whole buffer */ if (pbuf.cursor != pbuf.len) -- cgit v1.2.3