Re: Syntax supplements for SET options

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Syntax supplements for SET options
Date: 2010-01-25 15:55:32
Message-ID: 603c8f071001250755y47745442u610a6ee2a1e101ad@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Jan 24, 2010 at 9:16 PM, Takahiro Itagaki
<itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:
> I found a couple of incomplete syntax when I was adjusting psql
> automatic tab completion for HEAD.

So, I'm slightly confused about whether you want to fix tab completion
or behavior, but...

> 1. We cannot specify tablespace options on "CREATE TABLESPACE"
>   though "ALTER TABLESPACE" supports generic options by SET (...).

I'm not super excited about adding tablespace options as part of
CREATE TABLESPACE support, but I certainly don't object if you want to
have a go at it.

With respect to tab completion, ALTER TABLESPACE x currently completes
with only "OWNER TO" or "RENAME TO"; we need to add "SET" to that
list. My bad.

> 2. Should we still support "ALTER COLUMN SET STATISTICS"
>   though we can set generic options with "ALTER COLUMN SET (...)" ?

I don't think we can change this because "ALTER COLUMN SET STATISTICS"
is not new in 8.5. We added (and then removed) "ALTER COLUMN SET
STATISTICS DISTINCT", but that's not the same thing.

What we COULD do is add a column option called statistics_target and
then make ALTER COLUMN SET STATISTICS set that option under the hood,
removing attstattarget. We could then document that ALTER COLUMN SET
STATISTICS is deprecated and may be removed in a future release, but
we won't actually be able to remove it for a long time.

On tab completion: if you enter "ALTER TABLE x ALTER COLUMN y SET
STATISTICS" and then hit tab twice, it adds "TO DEFAULT", which isn't
legal syntax.

> 3. We cannot specify column options on "CREATE TABLE"
>   though "ALTER TABLE ALTER COLUMN SET ..." supports it.

As with tablespace options, these are more likely to be things that
you set on an existing table once you discover that something isn't
working quite right than they are to be things that you want to do
when initially creating the table. There's also the issue of exactly
what the syntax should be. But I'm not opposed to it.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-01-25 15:58:14 Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns
Previous Message Pavel Stehule 2010-01-25 15:47:50 problem with CVS on pgfoundry