From: Tom Lane Date: Wed, 15 Dec 2004 20:15:17 +0000 (+0000) Subject: Disallow SETOF in the input of parseTypeString(). Formerly it was X-Git-Tag: REL8_0_0RC2~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=84dbd5a8f60cdb27270ffc1f105cf1b1bb3c1ddc;p=postgresql Disallow SETOF in the input of parseTypeString(). Formerly it was silently ignored, allowing one to write bizarre things like DECLARE x setof int; in plpgsql. This has misled at least one novice into thinking that plpgsql variables could be sets ... --- diff --git a/src/backend/parser/parse_type.c b/src/backend/parser/parse_type.c index 4b4e8ae498..b8218d32aa 100644 --- a/src/backend/parser/parse_type.c +++ b/src/backend/parser/parse_type.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.71 2004/08/29 05:06:44 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.72 2004/12/15 20:15:17 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -453,6 +453,8 @@ parseTypeString(const char *str, Oid *type_id, int32 *typmod) if (typename == NULL || !IsA(typename, TypeName)) goto fail; + if (typename->setof) + goto fail; *type_id = typenameTypeId(typename); *typmod = typename->typmod;