Re: ONLY with parentheses - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: ONLY with parentheses
Date
Msg-id 20090108134157.GB3835@alvh.no-ip.org
Whole thread Raw
In response to ONLY with parentheses  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: ONLY with parentheses  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.


pgsql-hackers by date:

Previous
From: "Hitoshi Harada"
Date:
Subject: Re: Sample of user-define window function and other things
Next
From: Tom Lane
Date:
Subject: Re: Segmentation fault on PG 8.4 CVS head