##Problem solved! RaduBerinde @RaduBerinde 12:08
Yeah, the IDENT is coming from the grammar which allows you to sometimes not use AS (just col_label)
https://github.com/cockroachdb/cockroach/blob/master/sql/parser/sql.y#L4119
RaduBerinde @RaduBerinde 12:19
I think it's means it cannot be any SQL keyword
##Needless details
- The IDENT clause does not function in the DELETE statement. Its placement in the statement works like "AS col_label" without the "AS" (included steps to repro below).
- No other statement uses IDENT, so I couldn't infer its function https://www.cockroachlabs.com/docs/sql-statements.html
- Google was enormously unhelpful https://www.google.com/#q=sql%20ident
- delete.go doesn't include any explicit mentions of a variable, method, or parameter named ident
##STEPS TO REPRO IDENT CLAUSE BEHAVIOR
> CREATE TABLE account_information (
account_id INT PRIMARY KEY NOT NULL,
balance DECIMAL,
account_holder STRING(50)
);
> INSERT INTO account_information VALUES
(1, 32000, 'Nyla Nasser'),
(2, 25000, 'Leonie Tietmeyer')
;
Based on the SQL track, this is the correct spot for the IDENT clause (RETURNING a_expr IDENT
):
> DELETE FROM account_information WHERE account_id=1 RETURNING balance IDENT;
+-------+
| IDENT |
+-------+
| 32000 |
+-------+
As you can see, all it does is function like AS col_label, which we can show is the behavior of all strings placed after the a_expr
> DELETE FROM account_information WHERE account_id=2 RETURNING balance colVarName123;
+---------------+
| colVarName123 |
+---------------+
| 25000 |
+---------------+