Skip to content
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

Update max_identifier_length length to 128 #260

Closed
Woolworths opened this issue Mar 1, 2023 · 3 comments · Fixed by #317
Closed

Update max_identifier_length length to 128 #260

Woolworths opened this issue Mar 1, 2023 · 3 comments · Fixed by #317

Comments

@Woolworths
Copy link

As you can see here:

max_identifier_length is set to 64, however when I run in CockroachDB:
SHOW max_identifier_length;

I get 128. I believe max_identifier_length should be updated from 64 to 128.

@Woolworths
Copy link
Author

Note that 128 is not the "enforceable" limit, but may be enforceable in the future, see here:
https://www.cockroachlabs.com/docs/stable/schema-design-overview.html#hard-limits

@amozoss
Copy link

amozoss commented Feb 15, 2024

Ran into this today, I'm using Rails to do some things with an existing cockroach database, so I don't have any control over the index names.

The index name is clearly valid for cockroach because everything works fine when the server is running, but when trying to run a test rails throws an error.

ArgumentError: Index name 'bucket_bandwidth_rollups_archive_action_interval_project_id_index' on table 'bucket_bandwidth_rollup_archives' is too long; the limit is 63 characters (ArgumentError)                                                                          
                                                                                                                                                                                                                                                                           
            raise ArgumentError, "Index name '#{new_name}' on table '#{table_name}' is too long; the limit is #{index_name_length} characters"                                                                                                                             
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^            

@BuonOmo
Copy link
Collaborator

BuonOmo commented Feb 16, 2024

You all are pretty right, this was overriden when cockroachdb didn't have support for SHOW max_identifier_length. Let's now fallback to the default pg adapter behaviour

BuonOmo added a commit that referenced this issue Feb 16, 2024
This is no longer necessary as CRDB now supports
`SHOW max_identifier_length`, which is the same as
PostgreSQL's adapter implementation.

Fixes #260
BuonOmo added a commit that referenced this issue Feb 16, 2024
This is no longer necessary as CRDB now supports
`SHOW max_identifier_length`, which is the same as
PostgreSQL's adapter implementation.

Fixes #260
rafiss pushed a commit that referenced this issue Feb 16, 2024
This is no longer necessary as CRDB now supports
`SHOW max_identifier_length`, which is the same as
PostgreSQL's adapter implementation.

Fixes #260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants