-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
plpgsql: support syntax to use column/table type for variable #114676
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
docs-known-limitation
docs-todo
O-qa
P-3
Issues/test failures with no fix SLA
T-sql-queries
SQL Queries Team
Comments
DrewKimball
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
O-qa
labels
Nov 17, 2023
This was referenced Apr 18, 2024
We saw this get triggered at least once in the wild #121876. |
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Apr 18, 2024
Previously, when parsing the type of a declared PL/pgSQL variable, the parser could return an internal error when attempting to parse an expression like `xy@ROWTYPE`. This syntax, isn't currently supported in CRDB, but shouldn't result in an internal error, either. Now, the parser has inlined some logic from `GetTypeFromCastOrCollate` and will now return an expected syntax error instead. Fixes cockroachdb#114676 Release note (bug fix): Fixed a bug that could result in an internal error when attempting to create a PL/pgSQL routine using the (currently unsupported) `%ROWTYPE` syntax for a variable declaration.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Apr 23, 2024
Previously, when parsing the type of a declared PL/pgSQL variable, the parser could return an internal error when attempting to parse an expression like `xy@ROWTYPE`. This syntax, isn't currently supported in CRDB, but shouldn't result in an internal error, either. Now, the parser has inlined some logic from `GetTypeFromCastOrCollate` and will now return an expected syntax error instead. Informs cockroachdb#114676 Release note (bug fix): Fixed a bug that could result in an internal error when attempting to create a PL/pgSQL routine using the (currently unsupported) `%ROWTYPE` syntax for a variable declaration.
craig bot
pushed a commit
that referenced
this issue
Apr 24, 2024
122660: plpgsql: avoid internal error when parsing variable type r=DrewKimball a=DrewKimball Previously, when parsing the type of a declared PL/pgSQL variable, the parser could return an internal error when attempting to parse an expression like `xy@ROWTYPE`. This syntax, isn't currently supported in CRDB, but shouldn't result in an internal error, either. Now, the parser has inlined some logic from `GetTypeFromCastOrCollate` and will now return an expected syntax error instead. Informs #114676 Release note (bug fix): Fixed a bug that could result in an internal error when attempting to create a PL/pgSQL routine using the (currently unsupported) `%ROWTYPE` syntax for a variable declaration. Co-authored-by: Drew Kimball <drewk@cockroachlabs.com>
blathers-crl bot
pushed a commit
that referenced
this issue
Apr 24, 2024
Previously, when parsing the type of a declared PL/pgSQL variable, the parser could return an internal error when attempting to parse an expression like `xy@ROWTYPE`. This syntax, isn't currently supported in CRDB, but shouldn't result in an internal error, either. Now, the parser has inlined some logic from `GetTypeFromCastOrCollate` and will now return an expected syntax error instead. Informs #114676 Release note (bug fix): Fixed a bug that could result in an internal error when attempting to create a PL/pgSQL routine using the (currently unsupported) `%ROWTYPE` syntax for a variable declaration.
DrewKimball
changed the title
plpgsql: internal error when attempting to use column/table type for variable
plpgsql: support syntax to use column/table type for variable
Apr 24, 2024
cockroach-dev-inf
pushed a commit
that referenced
this issue
Apr 24, 2024
Previously, when parsing the type of a declared PL/pgSQL variable, the parser could return an internal error when attempting to parse an expression like `xy@ROWTYPE`. This syntax, isn't currently supported in CRDB, but shouldn't result in an internal error, either. Now, the parser has inlined some logic from `GetTypeFromCastOrCollate` and will now return an expected syntax error instead. Informs #114676 Release note (bug fix): Fixed a bug that could result in an internal error when attempting to create a PL/pgSQL routine using the (currently unsupported) `%ROWTYPE` syntax for a variable declaration.
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Apr 25, 2024
Postgres allows using `%TYPE` and `%ROWTYPE` syntax to refer to the type of a table or variable when declaring a PL/pgSQL variable. This is currently unsupported in CRDB. This commit augments the error message when a user attempts to use this syntax with a pointer to the tracking issue. Informs cockroachdb#114676 Release note: None
DrewKimball
added a commit
to DrewKimball/cockroach
that referenced
this issue
Apr 25, 2024
Postgres allows using `%TYPE` and `%ROWTYPE` syntax to refer to the type of a table or variable when declaring a PL/pgSQL variable. This is currently unsupported in CRDB. This commit augments the error message when a user attempts to use this syntax with a pointer to the tracking issue. Informs cockroachdb#114676 Release note: None
craig bot
pushed a commit
that referenced
this issue
Apr 25, 2024
123028: plpgsql: improve error message for %TYPE and %ROWTYPE syntax r=DrewKimball a=DrewKimball Postgres allows using `%TYPE` and `%ROWTYPE` syntax to refer to the type of a table or variable when declaring a PL/pgSQL variable. This is currently unsupported in CRDB. This commit augments the error message when a user attempts to use this syntax with a pointer to the tracking issue. Informs #114676 Release note: None Co-authored-by: Drew Kimball <drewk@cockroachlabs.com>
blathers-crl bot
pushed a commit
that referenced
this issue
Apr 25, 2024
Postgres allows using `%TYPE` and `%ROWTYPE` syntax to refer to the type of a table or variable when declaring a PL/pgSQL variable. This is currently unsupported in CRDB. This commit augments the error message when a user attempts to use this syntax with a pointer to the tracking issue. Informs #114676 Release note: None
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
docs-known-limitation
docs-todo
O-qa
P-3
Issues/test failures with no fix SLA
T-sql-queries
SQL Queries Team
Postgres allows PLpgSQL variable declarations to inherit the type of a table row or column using special syntax (docs):
This issue tracks adding support for this syntax.
CRDB does not yet support this syntax, but instead of returning an "unsupported" error, we currently return an internal error during parsing:Jira issue: CRDB-33620
The text was updated successfully, but these errors were encountered: