note about syntax for fillfactor patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема note about syntax for fillfactor patch
Дата
Msg-id 11822.1151856408@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: note about syntax for fillfactor patch  (Bruce Momjian <bruce@momjian.us>)
Re: note about syntax for fillfactor patch  (Simon Riggs <simon@2ndquadrant.com>)
Re: note about syntax for fillfactor patch  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Список pgsql-hackers
I see that the just-applied fillfactor patch has changed the syntax
for CREATE TABLE to replace 

OptWithOids:           WITH OIDS                            { $$ = MUST_HAVE_OIDS; }           | WITHOUT OIDS
           { $$ = MUST_NOT_HAVE_OIDS; }           | /*EMPTY*/                          { $$ = DEFAULT_OIDS; }       ; 
 
with

OptWith:           WITH OIDS                       { $$ = list_make1(defWithOids(true)); }           | WITHOUT OIDS
            { $$ = list_make1(defWithOids(false)); }           | WITH definition               { $$ = $2; }           |
WITHOIDS WITH definition     { $$ = lappend($4, defWithOids(true)); }           | WITHOUT OIDS WITH definition  { $$ =
lappend($4,defWithOids(false)); }           | /*EMPTY*/                     { $$ = NIL; }       ;
 

The latter seems seriously grotty: it forces the user to remember an
arbitrary choice about the order in which the two WITHs can be written,
and using the same WITH keyword to introduce two different things seems
ugly.  However, the implementation is such that OIDS can also be
specified in the "definition" option list:

regression=# create table foot(f1 int) with (oids, fillfactor);
CREATE TABLE
regression=# create table foot0(f1 int) with (oids=0, fillfactor);
CREATE TABLE
regression=# select relname,relhasoids from pg_class order by oid desc limit 2;relname | relhasoids
---------+------------foot0   | ffoot    | t
(2 rows)

regression=#

(hm, I wonder why it's not complaining about the bogus fillfactor
specification...)

I propose that we change the syntax to be
WITH OIDS| WITHOUT OIDS| WITH (definition)| /*EMPTY*/

and say that if you want to specify both OIDS and another option you
have to write "oids" or "oids=false" in the definition list.

This gets rid of the hazard that someone might try to specify
conflicting oids options in the hardwired part of the syntax and
in the definition list, and lets the hardwired syntax be deprecated
and perhaps someday removed.

Any objections?
        regards, tom lane


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: optimizing constant quals within outer joins
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Do a pass of code review for the ALTER TABLE