Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [DOCS] [BUGS] BUG #7543: Invalid table alias: DELETE FROM table *

6 views
Skip to first unread message

Tom Lane

unread,
Sep 16, 2012, 11:58:06 PM9/16/12
to
barry...@sierracollege.edu writes:
> I sometime see my users delete all rows from a table using a command like
> this:

> DELETE FROM customer *;

> The question is: what is the star? Is it a table alias or an
> output_expression?

Neither; it specifies to search the table and its inheritance children,
ie, the opposite of ONLY. This has been the default behavior (unless
you change the setting of sql_inheritance) for many years, so "*" has
largely fallen into disuse; but it's still accepted.

However ... I went looking for documentation on this point, and I'm
darned if I can find any. There certainly used to be some, but
apparently somebody got over-eager about editing the docs to reflect
the modern default behavior. The "*" doesn't even appear in the syntax
summaries for most of the commands where it's allowed, which is flat
wrong --- anywhere you can write "ONLY tablename", it's valid to write
"tablename*" instead.

So we have some docs work to do. Thanks for pointing it out.

regards, tom lane


--
Sent via pgsql-docs mailing list (pgsql...@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

0 new messages