Skip to content

Check for max identifier length #1098

@subnix

Description

@subnix

According to the documentation:

The system uses no more than NAMEDATALEN-1 bytes of an identifier; longer names can be written in commands, but they will be truncated. By default, NAMEDATALEN is 64 so the maximum identifier length is 63 bytes.

Thus, If we use identifiers longer than 63 characters, they will be truncated. It would be great if squawk warned us about this in advance.

create table table_very_long_very_long_very_long_very_long_very_long_very_long (column_very_long_very_long_very_long_very_long_very_long_very_long bigint);
# NOTICE:  identifier "table_very_long_very_long_very_long_very_long_very_long_very_long" will be truncated to "table_very_long_very_long_very_long_very_long_very_long_very_lo"
# NOTICE:  identifier "column_very_long_very_long_very_long_very_long_very_long_very_long" will be truncated to "column_very_long_very_long_very_long_very_long_very_long_very_l"
# CREATE TABLE

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions