Re: [PATCH] add CLUSTER table USING index (take 2)

From: Holger Schurig <holgerschurig(at)gmx(dot)de>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: [PATCH] add CLUSTER table USING index (take 2)
Date: 2007-03-29 19:27:19
Message-ID: 200703292127.19379.holgerschurig@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

> We still need to document the old syntax, especially if we don't change
> the example as well.

I agree that the example should be re-written. But I'm not sure if I need
to have a paragraph about the old syntax. There are two reasons:

- I haven't seen any other SQL command where an old syntax was
documented

- I thought I could come away without writing doc. After all, I'm
not a native english speaker. That's a point where I could need
some help ... (maybe my english is good enought, but it's not
worth to make a "take 4" to "take 17" patch just for english
grammar, typos, subtle meanings, whatever.

> > Index: src/src/backend/parser/gram.y
> > ===================================================================
> > *** src.orig/src/backend/parser/gram.y 2007-03-28 22:58:48.000000000 +0200
> > --- src/src/backend/parser/gram.y 2007-03-28 22:59:15.000000000 +0200
> > ***************
> > *** 209,215 ****
> >
> > %type <str> relation_name copy_file_name
> > database_name access_method_clause access_method attr_name
> > ! index_name name file_name
> >
> > %type <list> func_name handler_name qual_Op qual_all_Op subquery_Op
> > opt_class opt_validator
> > --- 209,215 ----
> >
> > %type <str> relation_name copy_file_name
> > database_name access_method_clause access_method attr_name
> > ! index_name name file_name opt_cluster_using
> >
> > %type <list> func_name handler_name qual_Op qual_all_Op subquery_Op
> > opt_class opt_validator
>
> Is the placement of opt_cluster_using completely arbitrary? I'm not very
> familiar with the parser, it really looks like those type-definitions
> are in random order.

I thought so. As you can see in the above patch, there are things
like opt_validator in the next "%type <list>" section.

There are many other "%type <str>" section in gram.y, but I haven't
found a structure yet. For example, some tokens are named
"OptSchemaName", some are named "opt_encoding". Let's look at
this one. It's used in line 1090, defined in 1218. Before and
after the usage there is "transaction_mode_list" and
"Colid_or_Sconst". Before and after the definition is
"zone_value" and again "ColId_or_Sconst". But neither of this
three is defined at the same "%type <str>" as "opt_encoding"
is.

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Holger Schurig 2007-03-29 19:27:55 Re: [PATCH] add CLUSTER table USING index (take 2)
Previous Message Josh Berkus 2007-03-29 18:45:27 Re: [PATCHES] Full page writes improvement, code update