Re: Syntax supplements for SET options

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Syntax supplements for SET options
Дата
Msg-id 603c8f071001250755y47745442u610a6ee2a1e101ad@mail.gmail.com
обсуждение исходный текст
Ответ на Syntax supplements for SET options  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Ответы Re: Syntax supplements for SET options  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Syntax supplements for SET options  (Takahiro Itagaki <itagaki.takahiro@oss.ntt.co.jp>)
Список pgsql-hackers
On Sun, Jan 24, 2010 at 9:16 PM, Takahiro Itagaki
<itagaki.takahiro@oss.ntt.co.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: problem with CVS on pgfoundry
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [BUG?] strange behavior in ALTER TABLE ... RENAME TO on inherited columns