What does the output_expression for "DELETE FROM table" do? What does the output_expression for "DELETE FROM table" do? postgresql postgresql

What does the output_expression for "DELETE FROM table" do?


The asterisk is not output_expression, for this you would have to use the RETURNING keyword. It is instead an old, obsolete syntax for including child tables in queries. (The last version for which it is documented seems to be PostgreSQL 8.1. Since the syntax is still valid it is a documentation bug, as Tom Lane points out in the post linked below.)

Since PostgreSQL 7.1 this is the default (unless sql_inheritance is set to off) and the ONLY keyword is used for the opposite, so the * is not very useful.

See this explanatory post from Tom Lane on the PostgreSQL mailing list.