mirror of
https://github.com/pgpointcloud/pointcloud.git
synced 2025-12-08 20:36:04 +00:00
Add PC_Version function to read library version
This commit is contained in:
parent
379f22f24a
commit
26b44326ee
@ -1,4 +1,10 @@
|
||||
CREATE EXTENSION pointcloud;
|
||||
SELECT PC_Version();
|
||||
pc_version
|
||||
------------
|
||||
1.0
|
||||
(1 row)
|
||||
|
||||
INSERT INTO pointcloud_formats (pcid, srid, schema)
|
||||
VALUES (1, 0,
|
||||
'<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
@ -23,6 +23,7 @@ Datum pcpatch_compression(PG_FUNCTION_ARGS);
|
||||
Datum pcpatch_intersects(PG_FUNCTION_ARGS);
|
||||
Datum pcpatch_size(PG_FUNCTION_ARGS);
|
||||
Datum pcpoint_size(PG_FUNCTION_ARGS);
|
||||
Datum pc_version(PG_FUNCTION_ARGS);
|
||||
|
||||
/* Generic aggregation functions */
|
||||
Datum pointcloud_agg_transfn(PG_FUNCTION_ARGS);
|
||||
@ -575,3 +576,13 @@ Datum pcpoint_size(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_INT32(VARSIZE(serpt));
|
||||
}
|
||||
|
||||
PG_FUNCTION_INFO_V1(pc_version);
|
||||
Datum pc_version(PG_FUNCTION_ARGS)
|
||||
{
|
||||
text *version_text;
|
||||
char version[64];
|
||||
snprintf(version, 64, "%s", POINTCLOUD_VERSION);
|
||||
version_text = cstring_to_text(version);
|
||||
PG_RETURN_TEXT_P(version_text);
|
||||
}
|
||||
|
||||
|
||||
@ -46,6 +46,11 @@ CREATE OR REPLACE FUNCTION pc_typmod_pcid(typmod integer)
|
||||
RETURNS int4 AS 'MODULE_PATHNAME','pc_typmod_pcid'
|
||||
LANGUAGE 'c' IMMUTABLE STRICT;
|
||||
|
||||
-- Return the library version number
|
||||
CREATE OR REPLACE FUNCTION pc_version()
|
||||
RETURNS text AS 'MODULE_PATHNAME', 'pc_version'
|
||||
LANGUAGE 'c' IMMUTABLE STRICT;
|
||||
|
||||
-------------------------------------------------------------------
|
||||
-- PCPOINT
|
||||
-------------------------------------------------------------------
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
CREATE EXTENSION pointcloud;
|
||||
|
||||
SELECT PC_Version();
|
||||
|
||||
INSERT INTO pointcloud_formats (pcid, srid, schema)
|
||||
VALUES (1, 0,
|
||||
'<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user