mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Properly handle truncated table names (> NAMEDATALEN). Fixes #2277
This commit is contained in:
committed by
Dave Page
parent
9acf340400
commit
bb0bd8acc5
@@ -1446,6 +1446,12 @@ class TableView(PGChildNodeView, DataTypeReader, VacuumSettings):
|
||||
if not status:
|
||||
return internal_server_error(errormsg=res)
|
||||
|
||||
# PostgreSQL truncates the table name to 63 characters.
|
||||
# Have to truncate the name as like PostgreSQL to get the proper schema id
|
||||
CONST_MAX_CHAR_COUNT = 63
|
||||
if len(data['name']) > CONST_MAX_CHAR_COUNT:
|
||||
data['name'] = data['name'][0:CONST_MAX_CHAR_COUNT]
|
||||
|
||||
# Get updated schema oid
|
||||
SQL = render_template("/".join([self.template_path,
|
||||
'get_schema_oid.sql']), tname=data['name'])
|
||||
|
||||
Reference in New Issue
Block a user