-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OVERRIDING USER VALUE should be allowed for GENERATED ALWAYS AS IDENTITY #7638
Comments
The SQL:2023-2 standard uses an - in my opinion - better description in 14.11 <insert statement>:
|
@asfernandes Can this be backported to 4.0 as well? |
I can do it if you test the change in v5 and say it's ok. |
I've checked on 5.0.0.1093 (intermediate build from today's artefacts), script:
Output:
|
@asfernandes I've also tested it, and it works OK |
Currently, attempts to specify
OVERRIDING USER VALUE
is disallowed if the identity column is of typeGENERATED ALWAYS
. This is in conflict with Syntax rule 11 b of 14.11 <insert statement> from SQL:2016-2. It seems rule 11 c has been interpreted as disallowingOVERRIDING USER VALUE
forGENERATED ALWAYS
, while its actual intent is to disallowOVERRIDING SYSTEM VALUE
forGENERATED BY DEFAULT
.Rule 11 b specifies that the override-clause must occur (and so implies that both
SYSTEM
orUSER
are allowed), if the identity column is referenced in the insert column list, and it is generated always.Rule 11 c specifies that the override-clause can occur, and only
OVERRIDING USER VALUE
is allowed, if the identity column is referenced in the insert column list, and it is generated by default.Test case:
Expected result: row returned with (1, 'A')
Actual result: error:
In other words, it should behave the same as:
Expected and actual result:
For completeness rules 11 b and c:
The text was updated successfully, but these errors were encountered: