The PostgreSQL RPM repository has supported Amazon Linux 2023 for a while, but until this week it had no GIS packages there: a few weeks ago I removed the AL2023 build of the GIS stack, as the distribution does not ship several libraries our GDAL was built against (hdf5, netcdf, xerces-c, Qt and friends).

Taking a second look, all of those turned out to be optional GDAL drivers, so I put the whole stack back, and this time PostGIS also comes with SFCGAL. Everything is available for PostgreSQL 14 to 18, on both x86_64 and aarch64.


What is in the repository?

geos315: 3.15.0
proj98: 9.8.1
libgeotiff17: 1.7.4
librttopo: 1.1.0
libspatialite50: 5.1.0
gdal313 (with the Python 3.13 and Java bindings): 3.13.3
SFCGAL: 2.3.0
PostGIS (postgis33 ... postgis37): 3.3.10, 3.4.6, 3.5.7, 3.6.4, 3.7.0 RC
pgRouting: 4.0.2
ogr_fdw: 1.1.9
h3-pg: 4.5.0
postgis_tiger_geocoder: 2025.2


Amazon Linux 2023 ships its own GDAL 3.10, GEOS 3.13 and PROJ 9.6. Our packages do not replace them: as on RHEL, they are installed under their own prefixes (/usr/gdal313, /usr/geos315, /usr/proj98, ...), and PostGIS is linked against them through the rpath.

SFCGAL

SFCGAL (the library behind the `postgis_sfcgal` extension and the `CG_*` functions) needs CGAL and nlohmann's JSON library to build, and Amazon Linux 2023 has neither. So the repository now has two new build-time packages for
AL2023:

- **CGAL 6.1.2** (`CGAL-devel`, header-only, built without the Qt demos)
- **nlohmann_json 3.12.0** (`nlohmann_json-devel`)

SFCGAL 2.3.0 is built against them, and PostGIS 3.3 to 3.7 are built with SFCGAL support. You only need these two packages if you build software against CGAL yourself: installing PostGIS just pulls in `SFCGAL-libs`.

Installing

```
dnf install https://download.postgresql.org/pub/repos/yum/reporpms/AL-2023-x86_64/pgdg-amazonlinux-repo-latest.noarch.rpm
dnf install postgresql18-server postgis36_18
```

(use `AL-2023-aarch64` on Graviton). Then, in your database:

```
CREATE EXTENSION postgis;
CREATE EXTENSION postgis_raster;
CREATE EXTENSION postgis_sfcgal;
SELECT postgis_full_version();
```

What is missing compared to RHEL

GDAL on Amazon Linux 2023 is built without the drivers whose libraries the distribution does not ship: netCDF, HDF4/HDF5, FITS, LIBKML, XLS, GPSBabel, GMLAS (xerces-c) and Arrow/Parquet. Every other driver, including GeoTIFF, COG, GeoPackage, PostGIS raster and vector, SpatiaLite, PDF (poppler) and the OGR formats PostGIS users rely on, is there. The PostGIS shapefile
loader GUI (`shp2pgsql-gui`) is not built either, as there is no GTK 2.

If you need one of the missing drivers, please open an issue at https://github.com/pgdg-packaging/pgdg-rpms/issues and tell us about your use case. As always, please report any problems you hit with these packages.

Enjoy!

No comments

The author does not allow comments to this entry