sqltabs
sqltabs copied to clipboard
Strange character varying max length value
- Get table info via sql tabs and CTRL + I
legal_name character varying (259) display_name character varying (84)
- Get table info via plain psql
legal_name character varying(255) display_name character varying(80)
Why the max lengths were increased by 4?
Hi, thank you for reporting the bug!
The length of the field is taken from the pg_attribute.atttypmod.
And apparently for varchar datatype it represents the actual length of the field which is 4 bytes longer than the value which can be stored there. The first 4 bytes store the length of the field and the rest the data itself.
The proper behaviour should be the same as in psql.
To be fixed..