pointcloud/pgsql/pointcloud--1.0.sql
Paul Ramsey e8a7788d00 Add in XML function to pgsql
Set up XML validation tests
2013-01-18 16:15:39 -08:00

20 lines
738 B
SQL

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pointcloud" to load this file. \quit
-- Confirm the XML representation of a schema has everything we need
CREATE OR REPLACE FUNCTION PC_SchemaIsValid(xml text)
RETURNS boolean AS 'MODULE_PATHNAME','PC_SchemaIsValid'
LANGUAGE 'c' IMMUTABLE STRICT;
-- Metadata table describing contents of pcpoints
CREATE TABLE pointcloud_formats (
pcid INTEGER PRIMARY KEY,
srid INTEGER, -- REFERENCES spatial_ref_sys(srid)
schema TEXT
CHECK ( PC_SchemaIsValid(schema) )
);
-- Register pointcloud_formats table so the contents are included in pg_dump output
SELECT pg_catalog.pg_extension_config_dump('pointcloud_formats', '');