Skip site navigation (1) Skip section navigation (2)

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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: barrybrown(at)sierracollege(dot)edu, pgsql-bugs(at)postgresql(dot)org,pgsql-docs(at)postgresql(dot)org
Subject: Re: [DOCS] BUG #7543: Invalid table alias: DELETE FROM table *
Date: 2012-09-26 15:41:59
Message-ID: 20120926154159.GB11785@momjian.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-docs
On Sun, Sep 16, 2012 at 11:58:06PM -0400, Tom Lane wrote:
> barrybrown(at)sierracollege(dot)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  <bruce(at)momjian(dot)us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +


In response to

Responses

pgsql-docs by date

Next:From: Bruce MomjianDate: 2012-09-26 15:52:12
Subject: Re: [PERFORM] Planner selects different execution plans depending on limit
Previous:From: Tom LaneDate: 2012-09-25 17:41:37
Subject: Re: Wrong startup script of PostgreSQL 9.1.2 under OpenBSD 5.1

pgsql-bugs by date

Next:From: Tom LaneDate: 2012-09-26 15:59:26
Subject: Re: [DOCS] BUG #7543: Invalid table alias: DELETE FROM table *
Previous:From: PETIT RaphaelDate: 2012-09-26 14:32:23
Subject: Re: BUG #7564: window installer of Postgresql 9.2 and service configuration

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group