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
sql: support user-defined composite/record types #27792
Comments
I was directed to this issue when doing a
|
I think the issue is that the first column can't be qualified. So you'd want |
That did it @jordanlewis. Thanks. I thought I tried every variation of that, but I guess not. |
Any update on this feature? This is the last blocker for us moving over to CDB. |
We don't support this syntax yet, but a workaround in the meantime is to rely on the implicit types created by a table definition.
|
@rafiss, let me outline the difference for an implementer trying to migrate from PG. Composite types:
Creating a table:
Workarounds like the one suggested above are simply non-starters when trying to migrate mature production systems. |
@jwaldrip I only meant to provide a possible workaround in case it unblocks you (or anyone else watching this issue) until we are able to fully address the issue. I agree that it may not be a good solution for migrating a mature production system, but it could work for someone who is prototyping or needs to move forward in a new application, and I did not understand your use case from your initial comment. |
Considering that composite types are about to be added, I was wondering if there's room for some convenience built-in functions or even casts to map composite types to JSONB and vice versa. I don't see anything about this in the postgres docs. Reusing their example:
Wouldn't it be nice to be able to do |
@postamar the Postgres way of doing that is:
|
and this is how you can go back:
CRDB v22.2 includes the |
CockroachDB 23.1 will include user-defined composite types. |
Until this is implemented, what are other options to include 1:N within a table (to avoid an extra table and joining)? Just JSONB? |
Maintainer note from @jordanlewis
CockroachDB 23.1 will support user-defined composite types.
Special case of #25123.
Special note:
https://www.postgresql.org/docs/10/static/rowtypes.html
Jira issue: CRDB-4943
Epic: CRDB-22358
The text was updated successfully, but these errors were encountered: