aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_target.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-09-28 20:00:19 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-09-28 20:00:19 +0000
commit6d0d15c451739396851d3f93f81c63a47535bf1e (patch)
tree79370fcc4630f1857bede315eb4d9beae6d7f90b /src/backend/parser/parse_target.c
parent23616b47d54d0a0d39a626485299403264f7d8e1 (diff)
downloadpostgresql-6d0d15c451739396851d3f93f81c63a47535bf1e.tar.gz
postgresql-6d0d15c451739396851d3f93f81c63a47535bf1e.zip
Make the world at least somewhat safe for zero-column tables, and
remove the special case in ALTER DROP COLUMN to prohibit dropping a table's last column.
Diffstat (limited to 'src/backend/parser/parse_target.c')
-rw-r--r--src/backend/parser/parse_target.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/parser/parse_target.c b/src/backend/parser/parse_target.c
index 18d11cc7f5a..c03db4f8b4b 100644
--- a/src/backend/parser/parse_target.c
+++ b/src/backend/parser/parse_target.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.90 2002/09/18 21:35:22 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.91 2002/09/28 20:00:19 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -386,6 +386,7 @@ static List *
ExpandAllTables(ParseState *pstate)
{
List *target = NIL;
+ bool found_table = false;
List *ns;
foreach(ns, pstate->p_namespace)
@@ -413,11 +414,12 @@ ExpandAllTables(ParseState *pstate)
if (!rte->inFromCl)
continue;
+ found_table = true;
target = nconc(target, expandRelAttrs(pstate, rte));
}
/* Check for SELECT *; */
- if (target == NIL)
+ if (!found_table)
elog(ERROR, "Wildcard with no tables specified not allowed");
return target;