-
Notifications
You must be signed in to change notification settings - Fork 62
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
Handle maximum table name length #37
Conversation
Nice! @vrmiguel can you add a test for a name > 58 (?) characters, and bump the version in core/Cargo.toml? |
// https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS | ||
|
||
// Default value of `NAMEDATALEN`, set in `src/include/pg_config_manual.h` | ||
const NAMEDATALEN: usize = 64; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an API where this configuration can be read, so you don't need to guess?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be close, but need to look into this a bit more. Not sure how reliable it would be for our use case.
show max_identifier_length;
max_identifier_length
-----------------------
63
(1 row)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* bump patch * Update Cargo.toml
First PR for #33
This PR ensures tables are at most 59-characters long, since by default Postgres limits identifiers to 63 characters, and we add to it a 4-bytes long prefix. This is configurable, but would require building Postgres from source.
Docs: https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS