Skip to content

Commit 84dbd5a

Browse files
committed
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 ...
1 parent c3d6c7d commit 84dbd5a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/parser/parse_type.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.71 2004/08/29 05:06:44 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.72 2004/12/15 20:15:17 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -453,6 +453,8 @@ parseTypeString(const char *str, Oid *type_id, int32 *typmod)
453453
if (typename == NULL ||
454454
!IsA(typename, TypeName))
455455
goto fail;
456+
if (typename->setof)
457+
goto fail;
456458

457459
*type_id = typenameTypeId(typename);
458460
*typmod = typename->typmod;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy