Closed effjot closed 1 year ago
I think that you have to inform the user that the table name is too long. Then the user has to make the change of the table name himself. It would be great if during the input of the new name the validity is checked right away.
If the name of the layer is too long (PostgreSQL default NAMEDATALEN is 64, i.e. identifiers can be max. 63 characters long), upload of the raster itself is possible, but then fails creating the index here: https://github.com/hdus/pg_raster_upload/blob/10d322d208a4e7869c55c29ff7dab219e45c647a/raster/raster_upload.py#L113
Postgres automatically truncates longer identifiers, so both relations (table and index) end up with the same name, because the
_gist_idx
suffix is lost. (The primary key and sequence are properly truncated, i.e. the base name is shortened to make space for the suffixes.)This might also affect overview creation later on, because the overviews add a prefix, which increases the risk of name collisions.
I could think of different solutions:
make_sql_create_gist()
in such a way that the suffix is still there, so no collisions arise.@hdus What do you think is the best way forward?