Re: ONLY with parentheses

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ONLY with parentheses
Date: 2009-01-08 13:41:57
Message-ID: 20090108134157.GB3835@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut wrote:
> While working on TRUNCATE with ONLY, I said to myself, hmm, when writing
>
> TRUNCATE ONLY a, b
>
> it might be a bit confusing whether the ONLY refers to a or both a and
> b. Then I noticed that the SQL standard requires parentheses, like
>
> TRUNCATE ONLY (a), b
>
> which is clearer.

Hmm, if I want to truncate only both (or is that "both only"?), what do
I have to do?

TRUNCATE ONLY (a), ONLY (b)
or
TRUNCATE ONLY (a, b)

Also, does this work?
TRUNCATE a, ONLY (b)

It's still not clear whether
TRUNCATE ONLY a, b
means to truncate both only, or only a only.

If only this was clearer ... if it was up to me, the ONLY keywords would
be inside the parentheses,
TRUNCATE (ONLY a), b
Now that is clear. What the hell do I know anyway.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-08 13:43:26 Re: Segmentation fault on PG 8.4 CVS head
Previous Message Peter Eisentraut 2009-01-08 13:34:25 ONLY with parentheses