Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGtkS-0004n9-2W; Wed, 26 Sep 2012 15:42:04 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TGtkP-0003Qw-MR; Wed, 26 Sep 2012 15:42:03 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1TGtkN-0001Ee-2A; Wed, 26 Sep 2012 11:41:59 -0400 Date: Wed, 26 Sep 2012 11:41:59 -0400 From: Bruce Momjian To: Tom Lane Cc: barrybrown@sierracollege.edu, pgsql-bugs@postgresql.org, pgsql-docs@postgresql.org Subject: Re: [DOCS] BUG #7543: Invalid table alias: DELETE FROM table * Message-ID: <20120926154159.GB11785@momjian.us> References: <5536.1347854286@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5536.1347854286@sss.pgh.pa.us> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.7 (--) X-Archive-Number: 201209/271 X-Sequence-Number: 34265 On Sun, Sep 16, 2012 at 11:58:06PM -0400, Tom Lane wrote: > barrybrown@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. Is there any value to having * vs just not using ONLY? I am not sure documenting this is helping us, and it would add more clutter. Isn't this like how we don't document the old COPY syntax. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +