Hi Thomas, 2014-05-07 7:46 GMT+02:00 Thomas Mueller <[email protected]>:
> Hi, > > In order to simplify the documentation, currently, not all variants of the > grammar are documented, only those that are "recommended" (that's a fuzzy > description, I know). That is, if people write new code, they should use > the documented grammar, and not rely on the undocumented features. The > undocumented features are for compatibility with other databases. > I don't fully agree with this assessment :-) For two reasons: 1) such decisions often appear a bit arbitrary: What qualifies a documented feature and what qualifies an undocumented feature? I.e. what made you decide that having an optional COLUMN keyword is a "feature" for ALTER TABLE ADD ( http://www.h2database.com/html/grammar.html#alter_table_add), but not for ALTER TABLE ALTER ( http://www.h2database.com/html/grammar.html#alter_table_alter_column) ? 2) this is not just about documentation, it's about API: While I believe that you're right in terms of not needing to document every keyword in syntax with words (this one is self-explanatory, once the BNF is adapted), I do believe that the syntax description should be accurate in order for it to be predictable. In other words, explicitly declaring [ COLUMN ] as optional will establish a contract on this syntax that users will be able to rely on. > So, I wonder whether it is important to document that "column" is optional > in those cases. > Since it is already optional in ALTER TABLE ADD: Yes, I think so (although not urgent) :-) > Is it optional in the ANSI SQL standard? > Yes. From http://www.andrew.cmu.edu/user/shadow/sql/sql1992.txt <add column definition> ::= ADD [ COLUMN ] <column definition> <alter column definition> ::= ALTER [ COLUMN ] <column name> <alter column action> <drop column definition> ::= DROP [ COLUMN ] <column name> <drop behavior> Cheers, Lukas -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
