Skip to content

PostGIS: GDAL_DATA is not defined #166

@NiccoloFei

Description

@NiccoloFei

When using PostGIS imageVolumes, PostgreSQL is logging the following warning when creating the extension:

{
  "level": "info",
  "ts": "2026-03-23T15:05:38.748554552Z",
  "logger": "postgres",
  "msg": "Warning 3: Cannot find tms_NZTM2000.json (GDAL_DATA is not defined)",
  "source": "/controller/log/postgres",
  "logging_pod": "cluster-postgis-1"
}

Also, PostGIS_Full_Version() reports the following:

PROJ="9.6.0 NETWORK_ENABLED=OFF URL_ENDPOINT= USER_WRITABLE_DIRECTORY=/tmp/proj" (compiled against PROJ 9.6.0) 
GDAL="GDAL 3.10.3, released 2025/04/01 GDAL_DATA not found" 
LIBXML="2.9.14" 
LIBJSON="0.18" 
LIBPROTOBUF="1.5.1" 
WAGYU="0.5.0 (Internal)" 
TOPOLOGY RASTER
(1 row)

Proposed fix

Requires #162 & cloudnative-pg/cloudnative-pg#10372 to be merged.

When building the image, we should copy:

  • /usr/share/gdal
  • /usr/share/proj

in the final layer, and define both GDAL_DATA and PROJ_DATA environment variables in the extension's metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions