Name

PROJ file access and configuration — Administrator controls for PROJ data files used by transformations.

Description

Coordinate transformations use PROJ resources such as proj.db, grid shift files, and init files. Install the required resources in the PROJ data directory bundled with the PostGIS build. Configure that directory with --with-projdatadir; when omitted, configure uses PROJ's pkg-config data directory or share/proj below --with-projdir. Windows packages use their installed PROJ bundle under PostgreSQL's share/contrib directory when no explicit directory was configured.

Reading files outside the installed PROJ data directory requires superuser privileges or the privileges of pg_read_server_files, as with PostgreSQL COPY FROM a server file. This applies to free-form CRS text and transformation pipelines supplied to SQL. Other roles can use bundled PROJ resources through SRIDs in spatial_ref_sys.

[Warning]

With PROJ 9.6 and later, the file restriction also applies when a role uses an SRID. A role without superuser or pg_read_server_files cannot use an SRID definition to open a file outside the installed PROJ data directory. With PROJ versions before 9.6, the restriction cannot be enforced during CRS parsing: anyone able to insert or update spatial_ref_sys can store a definition that names a server file and access it through that SRID. Administrators should limit write privileges on spatial_ref_sys to trusted roles and upgrade to PROJ 9.6 or later.

PROJ network access follows the server's PROJ configuration. The restricted context disables PROJ's network grid cache. See PROJ network configuration. The environment variable PROJ_AUX_DB is not supported for restricted access. PostGIS_Full_Version reports when PROJ before 9.6 prevents enforcement of the file restriction.