From 6d0d15c451739396851d3f93f81c63a47535bf1e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 28 Sep 2002 20:00:19 +0000 Subject: 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. --- src/backend/parser/parse_target.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/backend/parser/parse_target.c') 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; -- cgit v1.2.3