-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Renaming columns not working when new name is longer than 63 bytes (postgres column name length) #2286
Comments
SQL DB dump for example:
|
@drmnk Hm, this isn't the same as #1937? So NAMEDATALEN is max 63 chars? Related PostgREST/postgrest-docs#535 |
Not even RDS supports more than 63 chars: https://stackoverflow.com/questions/55141062/how-to-increase-column-name-width-limit-in-aws-rds-postgres If you host your own postgres, you might be able to compile it with a bigger value though. |
Sure, I understand that Postgres has limit of only 63 chars. It's not a question about NAMEDATALE. But renaming of column is also relies on Postgres? I don't know the inner mechanism on renaming. Thought that it can be some in-memory operation maybe. |
@drmnk We use standard postgresql aliasing for this. It has the same limitation: select name as columnnamelongerthansixtythreesymbolscolumnnamelongerthansixtythreesymbols from test.projects;
NOTICE: identifier "columnnamelongerthansixtythreesymbolscolumnnamelongerthansixtythreesymbols" will be truncated to
"columnnamelongerthansixtythreesymbolscolumnnamelongerthansixtyt"
columnnamelongerthansixtythreesymbolscolumnnamelongerthansixtyt
-----------------------------------------------------------------
Windows 7
Windows 10
IOS
OSX
Orphan |
Closing as duplicate. |
Environment
Description of issue
Hello!
I found strange behavior in Postgrest:
If we have a column name longer than 63 bytes (longest table/column name in bytes that PostgreSQL allow) - renaming of column will not work.
How to reproduce - create column with name, for example:
And add some data to it. Of course, it will be truncated, but we can easily query it via postgrest.
After we quering table we will get
Ok, but we for data crunching we need a full name, so we try to rename it in response with ":"
But result will be the same. If we rename column in any name less than 63 symbols, abc for example, it will work.
P.S. Why do I need names longer than 63 symbols - it's because I use non-ASCII symbols in table names and column names, cyrillic, by the way. I do it because it sometimes can be very hard to trancslate specifing termins in my domain (accounting). And because of PostgreSQL limitations it truncates to 63 bytes - every non-ASCII symbol uses 2 bytesm so only 31 symbols left for my column names.
Yes, it works :)
The text was updated successfully, but these errors were encountered: