## Problem We don't currently run tests for PostGIS in our test environment. ## Summary of Changes - Added PostGIS test support for PostgreSQL v16 and v17 - Configured different PostGIS versions based on PostgreSQL version: - PostgreSQL v17: PostGIS 3.5.0 - PostgreSQL v14/v15/v16: PostGIS 3.3.3 - Added necessary test scripts and configurations This ensures our PostgreSQL implementation remains compatible with this widely-used extension. --------- Co-authored-by: Alexander Bayandin <alexander@neon.tech> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2.8 KiB
PostGIS Testing in Neon
This directory contains configuration files and patches for running PostGIS tests in the Neon database environment.
Overview
PostGIS is a spatial database extension for PostgreSQL that adds support for geographic objects. Testing PostGIS compatibility ensures that Neon's modifications to PostgreSQL don't break compatibility with this critical extension.
PostGIS Versions
- PostgreSQL v17: PostGIS 3.5.0
- PostgreSQL v14/v15/v16: PostGIS 3.3.3
Test Configuration
The test setup includes:
postgis-no-upgrade-test.patch: Disables upgrade tests by removing the upgrade test section from regress/runtest.mkpostgis-regular-v16.patch: Version-specific patch for PostgreSQL v16postgis-regular-v17.patch: Version-specific patch for PostgreSQL v17regular-test.sh: Script to run PostGIS tests as a regular userneon-test.sh: Script to handle version-specific test configurationsraster_outdb_template.sql: Template for raster tests with explicit file paths
Excluded Tests
Important Note: The test exclusions listed below are specifically for regular-user tests against staging instances. These exclusions are necessary because staging instances run with limited privileges and cannot perform operations requiring superuser access. Docker-compose based tests are not affected by these exclusions.
Tests Requiring Superuser Permissions
These tests cannot be run as a regular user:
estimatedextentregress/core/legacyregress/core/typmodregress/loader/TestSkipANALYZEregress/loader/TestANALYZE
Tests Requiring Filesystem Access
These tests need direct filesystem access that is only possible for superusers:
loader/load_outdb
Tests with Flaky Results
These tests have assumptions that don't always hold true:
regress/core/computed_columns- Assumes computed columns always outperform alternatives, which is not consistently true
Tests Requiring Tunable Parameter Modifications
These tests attempt to modify the postgis.gdal_enabled_drivers parameter, which is only accessible to superusers:
raster/test/regress/rt_wkbraster/test/regress/rt_addbandraster/test/regress/rt_setbandpathraster/test/regress/rt_fromgdalrasterraster/test/regress/rt_asgdalrasterraster/test/regress/rt_astiffraster/test/regress/rt_asjpegraster/test/regress/rt_aspngraster/test/regress/permitted_gdal_drivers- Loader tests:
BasicOutDB,Tiled10x10,Tiled10x10Copy,Tiled8x8,TiledAuto,TiledAutoSkipNoData,TiledAutoCopyn
Topology Tests (v17 only)
populate_topology_layerrenametopogeometrycolumn
Other Modifications
- Binary.sql tests are modified to use explicit file paths
- Server-side SQL COPY commands (which require superuser privileges) are converted to client-side
\copycommands - Upgrade tests are disabled