[PostGIS] #5819: ST_EstimatedExtent fails for long table names

PostGIS trac at osgeo.org
Tue Dec 10 01:57:21 PST 2024


#5819: ST_EstimatedExtent fails for long table names
---------------------+---------------------
 Reporter:  martins  |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  blocker  |  Milestone:
Component:  postgis  |    Version:  3.5.x
 Keywords:           |
---------------------+---------------------
 For
 create table
 t23456789012345678901234567890123456789012345678901234567890(g geometry);
 this
 ST_EstimatedExtent('public','t23456789012345678901234567890123456789012345678901234567890','g')
 fails with error 'invalid name syntax'.

 It happens in PostGIS 3.5 only. It is fine in 3.4.x.

 I think the reason is a change in gserialized_estimated_extent():

 char nsp_tbl[NAMEDATALEN];
 ...
 snprintf(nsp_tbl, NAMEDATALEN, "\"%s\".\"%s\"", nsp, tbl);

 I think nsp_tbl should at least be NAMEDATALEN*2+6 characters long?
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5819>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list