index 6d5fb1894061d79ba76ff51936f2be98840ff6ad..68855a700741ff47e33832779f4e9065250969e6 100644 (file)
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.130 2008年01月01日 19:45:51 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_relation.c,v 1.131 2008年04月05日 01:58:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
Alias *eref;
int numaliases;
+ /*
+ * Fail if join has too many columns --- we must be able to reference
+ * any of the columns with an AttrNumber.
+ */
+ if (list_length(aliasvars) > MaxAttrNumber)
+ ereport(ERROR,
+ (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
+ errmsg("joins can have at most %d columns",
+ MaxAttrNumber)));
+
rte->rtekind = RTE_JOIN;
rte->relid = InvalidOid;
rte->subquery = NULL;
index c1ec4947ffe6eec4d0bbbf5f94c407fc4e7c0ea4..033f2ee786d81580f726dc01c92d16f8e8f94533 100644 (file)
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/attnum.h,v 1.24 2008年01月01日 19:45:56 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/access/attnum.h,v 1.25 2008年04月05日 01:58:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
typedef int16 AttrNumber;
#define InvalidAttrNumber 0
+#define MaxAttrNumber 32767
/* ----------------
* support macros