|
Working on the ALTER TABLE information, I noticed the following sentence under "Dropping columns":
"DROP COLUMN is not allowed if sqlAuthorization is true (see It appears that Hi Kim,
Thanks for looking at this issue. 1) You are right that you have fewer options with ALTER TABLE. The ALTER TABLE syntax should be changed as follows: Simple-column-Name [ DataType ] [ Column-level-constraint ]* [ [ WITH ] DEFAULT DefaultConstantExpression | generation-clause ] 2) I agree that Thanks! Thanks very much, Rick.
I guess that means that in the ALTER TABLE topic, the following statement under "Adding columns" is not quite true: "The syntax for the column-definition for a new column is the same as for a column in a CREATE TABLE statement." The sentence after that is "This means that a column constraint can be placed on the new column within the ALTER TABLE ADD COLUMN statement." I suppose I should change the two sentences to something like this: "The syntax for the column-definition for a new column is almost the same as for a column in a CREATE TABLE statement. This syntax allows a column constraint to be placed on the new column within the ALTER TABLE ADD COLUMN statement." Another question: for the syntax
GENERATED ALWAYS AS ( values-expression ) how should I define "values-expression"? I can't find it elsewhere in the Reference Manual. Is it any of the expressions described in "SQL expressions" (http://db.apache.org/derby/docs/dev/ref/rrefsqlj19433.html) or are there limits? Hi Kim,
Your rewording of the ALTER TABLE material looks good to me. You could also say "The syntax for the column-definition for a new column is a subset of the syntax for a column in a CREATE TABLE statement..." What I meant by value-expression is what the Reference Guide just calls an Expression. This syntax is mentioned in the Reference Guide in the topic titled "VALUES expression". But you are right, the Reference Guide doesn't define what an Expression is. Thanks, -Rick Attaching
One clarification: there are no changes to the CREATE TABLE topic itself, but only to the topic on column-definition that it references (which in turn references the new topic on the generation-clause). Please let me know if changes are needed, or if I've missed anything. Thanks for the patch, Kim. Looks good. Some comments follow:
Two typos: rrefsqlj81859 "Column definition" section: "if" should be capitalized. rrefsqlj30540 1st paragraph: "if" should be capitalized. Substantive issue: Both rrefsqlj30540 and rrefsqljrevoke say that a table will be dropped if one of its generation clauses depends on a role-based EXECUTE privilege which is subsquently dropped. The functional spec says that this is the expected behavior but subsequent discussion on Thanks, -Rick Hi Kim,
Yes, I would vote for removing the harsh assertion from those two pages. I'd say there's a small chance that we will need to revisit this issue based on the discussion on Thanks, Rick.
Filing a revised patch, This means that rrefsqljrevoke is unchanged, so it's no longer part of the patch. The file changes are now as follows: M src/ref/rrefsqljrenamecolumnstatement.dita M src/ref/rrefsqlj26498.dita M src/ref/rrefdropfunctionstatement.dita M src/ref/rrefsqlj40774.dita M src/ref/rrefsqlj81859.dita M src/ref/rrefcreateprocedurestatement.dita M src/ref/rrefsqlj30540.dita A src/ref/rrefsqljgenerationclause.dita M src/ref/refderby.ditamap M src/ref/rrefcreatefunctionstatement.dita M src/ref/rrefsqlj43125.dita Thanks, Kim. I've taken a look at the files you changed. They look good to me.
Thanks very much, Rick!
Committed patch |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
column-definition ::= Simple-column-Name [ DataType ]
[ Column-level-constraint ]*
[ [ WITH ] DEFAULT DefaultConstantExpression
| generated-column-spec
| generation-clause
]
[ Column-level-constraint ]*
Currently, though, the syntax described for CREATE TABLE in http://db.apache.org/derby/docs/dev/ref/rrefsqlj30540.html#rrefsqlj30540 is not quite the same as the syntax described for ALTER TABLE in http://db.apache.org/derby/docs/dev/ref/rrefsqlj81859.html. The syntax for CREATE TABLE is the same as what's in the Generated Columns spec except for the changes. But the syntax for ALTER TABLE looks different:
Simple-column-Name DataType
[ Column-level-constraint ]*
[ [ WITH ] DEFAULT DefaultConstantExpression ]
It lacks both the generated-column-spec and the additional Column-level-constraint at the end. Should it be changed to be the same?