Issue with st_estimatedextent function ??

Regina Obe lr at pcorp.us
Wed Nov 19 11:43:56 PST 2025


Bo,

 

FWIW I’m in the middle of packaging windows PostGIS 3.6.1 Bundle package ofr PG13-18.  I should have that done this week.

I’ll send an update to the mailing list once I have that ready.

 

I confirm that in PostGIS 3.6.1 I can’t replicate this error, but I can in 

 

POSTGIS="3.5.2 3.5.2" [EXTENSION] PGSQL="150" GEOS="3.13.0-CAPI-1.19.0" PROJ="8.2.1 ..”

 

 

From: Paul Ramsey via postgis-users <postgis-users at lists.osgeo.org> 
Sent: Wednesday, November 19, 2025 1:36 PM
To: Bo Victor Thomsen <bo.victor.thomsen at gmail.com>
Cc: postgis-users at lists.osgeo.org
Subject: Re: Issue with st_estimatedextent function ??

 

I cannot replicate this bug on my PostGIS 3.5.5dev environment, probably because the issue is already fixed as of 3.5.3

 

https://github.com/postgis/postgis/blob/stable-3.5/NEWS#L66

https://trac.osgeo.org/postgis/ticket/5819

 

I think you probably need a maintenance upgrade.

 

ATB,

P

 

On Wed, Nov 19, 2025 at 9:21 AM Bo Victor Thomsen <bo.victor.thomsen at gmail.com <mailto:bo.victor.thomsen at gmail.com> > wrote:

Hi list - 

I'm using Postgres/Postgis as a data repository for QGIS - and it normally just works.. However I'm getting errors with tables having long names, for example: 

fdc_results.bygningskade_stormflod_rcp85_2100_t100_ssp3_7_0_20251119164 

(Schema-name length: 11, table-name length: 59)

I have tracked the issue using the log facility in QGIS. It shows, that QGIS intermittently executes a SQL command: 

SELECT st_estimatedextent('fdc_results','bygningskade_stormflod_rcp85_2100_t100_ssp3_7_0_20251119164','geom')

which results in an error: ERROR: invalid name syntax

If I change the table name to:

fdc_results.bygningskade_stormflod_rcp85_2100_t100_ssp3_7_0   (Schema-name length: 11, table-name length: 47) 

the error disappears. 

I've done some testing and could replicate the error (and non-error) situation in PGAdmin

Further testing shows that if the sum of the character lengths of the schema- and table-name is larger than 58 the function will stop with an error. Otherwise it returns a result like:

"BOX(716701.25 6167151,720533.9375 6174220)"

It's my understanding, that the maximum length of a tablename in PostgreSQL is 63. This same limit applies for every type of identifier in Postgres. Am I wrong to assume this? Or is there an issue with name lengths in the PostGIS st_estimatedextent  function?? 

(It might be a coincidence but if you express the tablename like this : "fdc_results"."bygningskade_stormflod_rcp85_2100_t100_ssp3_7_0", the total length is 63) 

PostgreSQL version: "PostgreSQL 17.4 on x86_64-windows, compiled by msvc-19.42.34436, 64-bit"

PostGIS version: "3.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1"

-- 
Med venlig hilsen / Best regards
 
Bo Victor Thomsen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20251119/e07f3fc5/attachment.htm>


More information about the postgis-users mailing list