diff --git a/.github/scripts/test_dump_restore.sh b/.github/scripts/test_dump_restore.sh index ba970aa..7d9a3d1 100755 --- a/.github/scripts/test_dump_restore.sh +++ b/.github/scripts/test_dump_restore.sh @@ -1,6 +1,10 @@ #! /bin/bash -pg_dump contrib_regression -Fp > dump.sql +set -e + +createdb test +psql test < .github/scripts/test_dump_restore.sql +pg_dump test -Fp > dump.sql cat dump.sql createdb test_restore -psql test_restore < dump.sql +psql -v ON_ERROR_STOP=1 test_restore < dump.sql diff --git a/.github/scripts/test_dump_restore.sql b/.github/scripts/test_dump_restore.sql new file mode 100644 index 0000000..7593dcf --- /dev/null +++ b/.github/scripts/test_dump_restore.sql @@ -0,0 +1,57 @@ +CREATE EXTENSION postgis; +CREATE EXTENSION pointcloud; +CREATE EXTENSION pointcloud_postgis; + +INSERT INTO pointcloud_formats (pcid, srid, schema) +VALUES (3, 0, +' + + + 1 + 4 + X coordinate as a long integer. You must use the scale and offset information of the header to determine the double value. + X + int32_t + 0.01 + + + 2 + 4 + Y coordinate as a long integer. You must use the scale and offset information of the header to determine the double value. + Y + int32_t + 0.01 + + + 3 + 4 + Z coordinate as a long integer. You must use the scale and offset information of the header to determine the double value. + Z + int32_t + 0.01 + + + 4 + 2 + The intensity value is the integer representation of the pulse return magnitude. This value is optional and system specific. However, it should always be included if available. + Intensity + uint16_t + 1 + + + dimensional + 4326 + +' +); + +CREATE TABLE IF NOT EXISTS probes ( + pa PCPATCH(3) +); + +CREATE INDEX ON probes USING gist(pc_envelopegeometry(pa)); + +INSERT INTO probes(pa) VALUES ('0000000003000000000000000200000002000000030000000500060000000200000003000000050008'); +INSERT INTO probes(pa) VALUES ('000000000300000000000000020000000600000007000000050006000000090000000A00000005000A'); +INSERT INTO probes(pa) VALUES ('0000000003000000000000000200000002000000030000000500060000000200000003000000050003'); +INSERT INTO probes(pa) VALUES ('0000000003000000000000000200000002000000030000000500060000000200000003000000050001'); diff --git a/.github/workflows/bionic_postgres12_postgis25.yml b/.github/workflows/bionic_postgres12_postgis25.yml index 1f8c31a..ec4b918 100644 --- a/.github/workflows/bionic_postgres12_postgis25.yml +++ b/.github/workflows/bionic_postgres12_postgis25.yml @@ -23,3 +23,5 @@ jobs: - name: Error if: ${{ failure() }} run: cat pgsql/regression.diffs + - name: Dump and restore tests + run: .github/scripts/test_dump_restore.sh diff --git a/.github/workflows/bionic_postgres12_postgis32.yml b/.github/workflows/bionic_postgres12_postgis32.yml index cb730d8..9a51b67 100644 --- a/.github/workflows/bionic_postgres12_postgis32.yml +++ b/.github/workflows/bionic_postgres12_postgis32.yml @@ -23,3 +23,5 @@ jobs: - name: Error if: ${{ failure() }} run: cat pgsql/regression.diffs + - name: Dump and restore tests + run: .github/scripts/test_dump_restore.sh diff --git a/.github/workflows/focal_postgres12_postgis32.yml b/.github/workflows/focal_postgres12_postgis32.yml index 36c166c..6c0800d 100644 --- a/.github/workflows/focal_postgres12_postgis32.yml +++ b/.github/workflows/focal_postgres12_postgis32.yml @@ -23,3 +23,5 @@ jobs: - name: Error if: ${{ failure() }} run: cat pgsql/regression.diffs + - name: Dump and restore tests + run: .github/scripts/test_dump_restore.sh diff --git a/.github/workflows/focal_postgres13_postgis32.yml b/.github/workflows/focal_postgres13_postgis32.yml index 1d43994..8475ad6 100644 --- a/.github/workflows/focal_postgres13_postgis32.yml +++ b/.github/workflows/focal_postgres13_postgis32.yml @@ -23,3 +23,5 @@ jobs: - name: Error if: ${{ failure() }} run: cat pgsql/regression.diffs + - name: Dump and restore tests + run: .github/scripts/test_dump_restore.sh