Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ mod candidate_tests {
run_direct_and_restart_smoke_set(&[generated::CANDIDATE_UUID_OSSP])
}

#[test]
fn postgis_passes_direct_and_restart_smoke() -> Result<()> {
run_direct_and_restart_smoke_set(&[generated::POSTGIS])
}

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
#[ignore = "promotion gate: run manually before marking packaged candidates stable"]
async fn packaged_candidate_extensions_pass_server_smoke() -> Result<()> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,11 +714,16 @@ const CANDIDATE_POSTGIS_DEPENDENCIES: &[&str] = EMPTY_SQL_NAMES;
const CANDIDATE_POSTGIS_LOAD_SQL: &[&str] = EMPTY_SQL;
const CANDIDATE_POSTGIS_POST_CREATE_SQL: &[&str] = EMPTY_SQL;
const CANDIDATE_POSTGIS_STARTUP_CONFIG: &[&str] = EMPTY_STARTUP_CONFIG;
const CANDIDATE_POSTGIS_NATIVE_SUPPORT_MODULES: &[ExtensionNativeModule] =
&[ExtensionNativeModule::new(
const CANDIDATE_POSTGIS_NATIVE_SUPPORT_MODULES: &[ExtensionNativeModule] = &[
ExtensionNativeModule::new(
"lib/postgresql/liboliphaunt_postgis_deps.so",
Some("extension:postgis:postgis_deps"),
)];
),
ExtensionNativeModule::new(
"lib/postgresql/postgis_raster-3.so",
Some("extension:postgis:postgis_raster"),
),
];

pub(crate) const CANDIDATE_POSTGIS: Extension = Extension::new(
"PostGIS",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
CREATE EXTENSION IF NOT EXISTS postgis_raster;
-- oliphaunt-statement
SET postgis.gdal_enabled_drivers = 'ENABLE_ALL';
-- oliphaunt-statement
DROP TABLE IF EXISTS liboliphaunt_postgis_points;
-- oliphaunt-statement
CREATE TEMP TABLE liboliphaunt_postgis_points(id int PRIMARY KEY, geom geometry(Point, 4326));
Expand All @@ -15,6 +19,9 @@ DECLARE
area float8;
polygons int;
nearby int;
gdal_drivers int;
raster_roundtrip raster;
raster_value float8;
BEGIN
SELECT ST_Distance(ST_GeomFromText('POINT(0 0)'), ST_GeomFromText('POINT(3 4)')) INTO distance;
IF distance <> 5 THEN
Expand Down Expand Up @@ -56,6 +63,29 @@ BEGIN
IF nearby <> 2 THEN
RAISE EXCEPTION 'postgis dwithin failed: %', nearby;
END IF;
SELECT count(*) INTO gdal_drivers
FROM ST_GDALDrivers()
WHERE short_name = 'GTiff' AND can_read AND can_write;
IF gdal_drivers <> 1 THEN
RAISE EXCEPTION 'postgis raster GeoTIFF driver is unavailable';
END IF;
SELECT ST_FromGDALRaster(
ST_AsGDALRaster(
ST_AddBand(
ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, 4326),
'8BUI'::text,
7::double precision,
0::double precision
),
'GTiff'
)
) INTO raster_roundtrip;
SELECT ST_Value(raster_roundtrip, 1, 1, 1) INTO raster_value;
IF raster_value <> 7 OR ST_SRID(raster_roundtrip) <> 4326 THEN
RAISE EXCEPTION 'postgis raster GDAL round-trip failed: value %, srid %',
raster_value,
ST_SRID(raster_roundtrip);
END IF;
END $$;
-- oliphaunt-statement
DROP TABLE IF EXISTS liboliphaunt_postgis_points;
3 changes: 2 additions & 1 deletion src/extensions/catalog/extensions.source.json
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@
"postgres extension",
"experimental"
],
"bundle-size": 8551161,
"bundle-size": 11490267,
"control-file": "target/oliphaunt-sources/checkouts/postgis/extensions/postgis/postgis.control.in",
"control": {
"module-pathname": "@MODULEPATH@",
Expand All @@ -1206,6 +1206,7 @@
},
"dependencies": [],
"native-dependencies": [
"gdal:3.13.2-static",
"geos:3.14.1-static",
"proj:9.8.1-static",
"sqlite:3.53.1-static",
Expand Down
6 changes: 3 additions & 3 deletions src/extensions/contrib/.release-semantic-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
},
{
"path": "src/sdks/rust/extension-artifact-archive-policy.properties",
"sha256": "e708d2a5749cdcbca9de2abe44abdf36b5faaa5f9eb010edc412496876d955fa"
"sha256": "89f3c0953d3070cc5e594e784488591612f551452c31c59b45547573bb7455bf"
},
{
"path": "tools/release/bounded-gunzip-to-file.mjs",
Expand Down Expand Up @@ -218,7 +218,7 @@
"inputs": [
{
"path": "src/extensions/generated/sdk/kotlin.json",
"sha256": "e6a713ed46ca57edfc92855317865114a54c8b415736759668294cc9c592713b"
"sha256": "39a8f931f2ebb049a51f7a01e5f583895b3bd745ec61c75cc4a057dd71a4cef1"
}
]
},
Expand Down Expand Up @@ -377,5 +377,5 @@
]
}
],
"sha256": "419f620e12df219054374188e11b362780ba9e436f547348c20acd0bf7c29d24"
"sha256": "5d0fc5e082f72592ab12c71457b9a6840ae7c30d868cb07785a0959a6983cff8"
}
1 change: 1 addition & 0 deletions src/extensions/evidence/matrix.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ source-digest-inputs = [
"src/extensions/external/pg_textsearch/source.toml",
"src/extensions/external/pg_uuidv7/source.toml",
"src/extensions/external/pgtap/source.toml",
"src/extensions/external/postgis/dependencies/gdal/source.toml",
"src/extensions/external/postgis/dependencies/geos/source.toml",
"src/extensions/external/postgis/dependencies/json-c/source.toml",
"src/extensions/external/postgis/dependencies/libiconv/source.toml",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
},
{
"path": "src/sdks/rust/extension-artifact-archive-policy.properties",
"sha256": "e708d2a5749cdcbca9de2abe44abdf36b5faaa5f9eb010edc412496876d955fa"
"sha256": "89f3c0953d3070cc5e594e784488591612f551452c31c59b45547573bb7455bf"
},
{
"path": "tools/release/bounded-gunzip-to-file.mjs",
Expand Down Expand Up @@ -184,7 +184,7 @@
"inputs": [
{
"path": "src/extensions/generated/sdk/kotlin.json",
"sha256": "e6a713ed46ca57edfc92855317865114a54c8b415736759668294cc9c592713b"
"sha256": "39a8f931f2ebb049a51f7a01e5f583895b3bd745ec61c75cc4a057dd71a4cef1"
}
]
},
Expand Down Expand Up @@ -343,5 +343,5 @@
]
}
],
"sha256": "cd9da3b78ef5e8df01dacab7774205aef15270bf3d20dee1718b81bad78c13b1"
"sha256": "c10becc3898bff217f9eb6d6860856d9cabacd7e91ad46ced107674e8e093a9a"
}
6 changes: 3 additions & 3 deletions src/extensions/external/pg_ivm/.release-semantic-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
},
{
"path": "src/sdks/rust/extension-artifact-archive-policy.properties",
"sha256": "e708d2a5749cdcbca9de2abe44abdf36b5faaa5f9eb010edc412496876d955fa"
"sha256": "89f3c0953d3070cc5e594e784488591612f551452c31c59b45547573bb7455bf"
},
{
"path": "tools/release/bounded-gunzip-to-file.mjs",
Expand Down Expand Up @@ -184,7 +184,7 @@
"inputs": [
{
"path": "src/extensions/generated/sdk/kotlin.json",
"sha256": "e6a713ed46ca57edfc92855317865114a54c8b415736759668294cc9c592713b"
"sha256": "39a8f931f2ebb049a51f7a01e5f583895b3bd745ec61c75cc4a057dd71a4cef1"
}
]
},
Expand Down Expand Up @@ -343,5 +343,5 @@
]
}
],
"sha256": "93852eada395596f863f6ff4bf11709c09758e8720e2f92ec0ae315a80ea07ef"
"sha256": "000c986be28889a114ca5d32d5f431b6b4f12db50af6f52ff6876d3b5d7d0ccf"
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
},
{
"path": "src/sdks/rust/extension-artifact-archive-policy.properties",
"sha256": "e708d2a5749cdcbca9de2abe44abdf36b5faaa5f9eb010edc412496876d955fa"
"sha256": "89f3c0953d3070cc5e594e784488591612f551452c31c59b45547573bb7455bf"
},
{
"path": "tools/release/bounded-gunzip-to-file.mjs",
Expand Down Expand Up @@ -184,7 +184,7 @@
"inputs": [
{
"path": "src/extensions/generated/sdk/kotlin.json",
"sha256": "e6a713ed46ca57edfc92855317865114a54c8b415736759668294cc9c592713b"
"sha256": "39a8f931f2ebb049a51f7a01e5f583895b3bd745ec61c75cc4a057dd71a4cef1"
}
]
},
Expand Down Expand Up @@ -343,5 +343,5 @@
]
}
],
"sha256": "93af1bc0cc1039d7285d1bfdefeca1b1a959c89bb0c523490711b59601b3c427"
"sha256": "93cd0ff8946b36e8ff28bae681f9386ff69b209cec52710a3466ac1df0088024"
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
},
{
"path": "src/sdks/rust/extension-artifact-archive-policy.properties",
"sha256": "e708d2a5749cdcbca9de2abe44abdf36b5faaa5f9eb010edc412496876d955fa"
"sha256": "89f3c0953d3070cc5e594e784488591612f551452c31c59b45547573bb7455bf"
},
{
"path": "tools/release/bounded-gunzip-to-file.mjs",
Expand Down Expand Up @@ -184,7 +184,7 @@
"inputs": [
{
"path": "src/extensions/generated/sdk/kotlin.json",
"sha256": "e6a713ed46ca57edfc92855317865114a54c8b415736759668294cc9c592713b"
"sha256": "39a8f931f2ebb049a51f7a01e5f583895b3bd745ec61c75cc4a057dd71a4cef1"
}
]
},
Expand Down Expand Up @@ -343,5 +343,5 @@
]
}
],
"sha256": "582f1d4797443f6cda96d94f8f3a6c1bf66bcd4778d3f8518b937233aab11e2e"
"sha256": "df761e3615935b414bfcb2a6b88075665a13ffbe5201522deaf7ded154464afe"
}
6 changes: 3 additions & 3 deletions src/extensions/external/pgtap/.release-semantic-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
},
{
"path": "src/sdks/rust/extension-artifact-archive-policy.properties",
"sha256": "e708d2a5749cdcbca9de2abe44abdf36b5faaa5f9eb010edc412496876d955fa"
"sha256": "89f3c0953d3070cc5e594e784488591612f551452c31c59b45547573bb7455bf"
},
{
"path": "tools/release/bounded-gunzip-to-file.mjs",
Expand Down Expand Up @@ -184,7 +184,7 @@
"inputs": [
{
"path": "src/extensions/generated/sdk/kotlin.json",
"sha256": "e6a713ed46ca57edfc92855317865114a54c8b415736759668294cc9c592713b"
"sha256": "39a8f931f2ebb049a51f7a01e5f583895b3bd745ec61c75cc4a057dd71a4cef1"
}
]
},
Expand Down Expand Up @@ -343,5 +343,5 @@
]
}
],
"sha256": "5bd705d032c08abd0cee58e21f15836ee67f512822017e61ce4bea347a8c6031"
"sha256": "1b44a50db553a1acdd9994caf983545811d5729ebff594e287a28d135a3d9b9d"
}
14 changes: 7 additions & 7 deletions src/extensions/external/postgis/.release-semantic-inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,19 @@
},
{
"path": "src/runtimes/liboliphaunt/native/bin/build-postgres18-linux.sh",
"sha256": "d9ded61bf55c42197f84115940c0546f2801876b1562084b17cae80b41aeae68"
"sha256": "551e2603d37157908c0a7fea72a086188bf65081fb2054b7d5874d31f1af819f"
},
{
"path": "src/runtimes/liboliphaunt/native/bin/build-postgres18-macos.sh",
"sha256": "b53b165f9942a080ecfe84af9f2bffd41c194af79657ab09fa1018c156af20ca"
"sha256": "f23ac3a4bb06cc9d55b36fd1ed9d12b23063aa2159680b38b52e4f5a5545b8ef"
},
{
"path": "src/runtimes/liboliphaunt/native/bin/build-postgres18-windows.ps1",
"sha256": "3ecdda83cf6ed8df45852ead088dc5baa415b07e302824b0531a4ff839cbb8c6"
"sha256": "71ba834a644c6d03be5678e5afca6ca6cc8cf28bd2ceba86500964b7df8030f5"
},
{
"path": "src/runtimes/liboliphaunt/native/bin/mobile-postgis-extensions.sh",
"sha256": "3542a4b4c4efe80fe664eb8f2421b992675f88e01e2f19a30856ff98cb711fb1"
"sha256": "e56a88d24095c44a00bda7390e77a968577e5ad7f6bb57959ec41d95c7d62fa4"
}
]
},
Expand Down Expand Up @@ -171,7 +171,7 @@
},
{
"path": "src/sdks/rust/extension-artifact-archive-policy.properties",
"sha256": "e708d2a5749cdcbca9de2abe44abdf36b5faaa5f9eb010edc412496876d955fa"
"sha256": "89f3c0953d3070cc5e594e784488591612f551452c31c59b45547573bb7455bf"
},
{
"path": "tools/release/bounded-gunzip-to-file.mjs",
Expand Down Expand Up @@ -231,7 +231,7 @@
"inputs": [
{
"path": "src/extensions/generated/sdk/kotlin.json",
"sha256": "e6a713ed46ca57edfc92855317865114a54c8b415736759668294cc9c592713b"
"sha256": "39a8f931f2ebb049a51f7a01e5f583895b3bd745ec61c75cc4a057dd71a4cef1"
}
]
},
Expand Down Expand Up @@ -390,5 +390,5 @@
]
}
],
"sha256": "a8d8102915899d7308025b7c9fd5401f64e18c347d2d53aed9c083c7b001c2a4"
"sha256": "b529ee0e3f512df115757455ec05c58262789357d235f8e1597e06392954b128"
}
4 changes: 4 additions & 0 deletions src/extensions/external/postgis/dependencies/gdal/source.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "gdal"
url = "https://github.com/OSGeo/gdal.git"
branch = "v3.13.2"
commit = "b40672525acf3f5c4f29d8541aa7dcff1e18eb92"
8 changes: 8 additions & 0 deletions src/extensions/external/postgis/deps.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
schema = "oliphaunt-extension-deps-v1"

[[dependencies]]
name = "gdal"
source = "gdal"
version = "3.13.2"
linkage = "static"
license = "MIT"
mobile-static-dependencies = ["gdal"]

[[dependencies]]
name = "geos"
source = "geos"
Expand Down
48 changes: 45 additions & 3 deletions src/extensions/external/postgis/recipe.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,53 @@ needs_superuser = true
trusted = false

[artifacts]
control_files = ["share/postgresql/extension/postgis.control"]
sql_globs = ["share/postgresql/extension/postgis--*.sql"]
control_files = [
"share/postgresql/extension/postgis.control",
"share/postgresql/extension/postgis_raster.control",
]
sql_globs = [
"share/postgresql/extension/postgis--*.sql",
"share/postgresql/extension/postgis_raster--*.sql",
]
extension_sql_file_prefixes = [
"postgis_comments",
"postgis_proc_set_search_path",
"postgis_raster",
"rtpostgis",
]
extension_sql_file_names = ["uninstall_postgis.sql"]
native_modules = ["lib/postgresql/postgis-3.so"]
native_dependency_modules = ["lib/postgresql/liboliphaunt_postgis_deps.so"]
native_dependency_modules = [
"lib/postgresql/postgis_raster-3.so",
"lib/postgresql/liboliphaunt_postgis_deps.so",
]
data_files = [
"share/postgresql/gdal/GDALLogoBW.svg",
"share/postgresql/gdal/GDALLogoColor.svg",
"share/postgresql/gdal/GDALLogoGS.svg",
"share/postgresql/gdal/LICENSE.TXT",
"share/postgresql/gdal/cubewerx_extra.wkt",
"share/postgresql/gdal/ecw_cs.wkt",
"share/postgresql/gdal/epsg.wkt",
"share/postgresql/gdal/esri_StatePlane_extra.wkt",
"share/postgresql/gdal/gdal_algorithm.schema.json",
"share/postgresql/gdal/gdalicon.png",
"share/postgresql/gdal/gdalinfo_output.schema.json",
"share/postgresql/gdal/gdalmdiminfo_output.schema.json",
"share/postgresql/gdal/gdalvrt.xsd",
"share/postgresql/gdal/leaflet_template.html",
"share/postgresql/gdal/ogr_fields_override.schema.json",
"share/postgresql/gdal/ogrinfo_output.schema.json",
"share/postgresql/gdal/ozi_datum.csv",
"share/postgresql/gdal/ozi_ellips.csv",
"share/postgresql/gdal/pci_datum.txt",
"share/postgresql/gdal/pci_ellips.txt",
"share/postgresql/gdal/stateplane.csv",
"share/postgresql/gdal/template_tiles.mapml",
"share/postgresql/gdal/tms_LINZAntarticaMapTileGrid.json",
"share/postgresql/gdal/tms_MapML_APSTILE.json",
"share/postgresql/gdal/tms_MapML_CBMTILE.json",
"share/postgresql/gdal/tms_NZTM2000.json",
"share/postgresql/contrib/postgis-3.6/legacy.sql",
"share/postgresql/contrib/postgis-3.6/legacy_gist.sql",
"share/postgresql/contrib/postgis-3.6/legacy_minimal.sql",
Expand All @@ -44,6 +80,7 @@ data_files = [
]
headers = []
licenses = [
"share/licenses/gdal/LICENSE.TXT",
"share/licenses/geos/COPYING",
"share/licenses/geos/src/deps/ryu/LICENSE",
"share/licenses/geos/src/deps/ryu/LICENSE-Apache2",
Expand All @@ -62,6 +99,11 @@ licenses = [
"share/licenses/sqlite/LICENSE.md",
]

[[runtime_environment]]
name = "GDAL_DATA"
path = "share/postgresql/gdal"
required_file = "gdalvrt.xsd"

[[runtime_environment]]
name = "PROJ_DATA"
path = "share/postgresql/proj"
Expand Down
Loading
Loading