forked from timescale/pg_influx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinflux--0.4.sql
24 lines (19 loc) · 912 Bytes
/
influx--0.4.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION influx" to load this file. \quit
-- Launch a new worker that listens on a port and writes to a namespace
CREATE FUNCTION worker_launch(ns regnamespace, service text)
RETURNS integer
LANGUAGE C AS '$libdir/influx.so';
CREATE FUNCTION worker_launch(service text)
RETURNS integer
LANGUAGE C AS '$libdir/influx.so';
-- Send a packet over UDP to a host and service
CREATE PROCEDURE send_packet(packet text, service text, hostname text = 'localhost')
LANGUAGE C AS '$libdir/influx.so';
-- Parse InfluxDB Line Protocol packet
CREATE FUNCTION parse_influx(text)
RETURNS TABLE (_metric text, _time timestamp, _tags jsonb, _fields jsonb)
LANGUAGE C AS '$libdir/influx.so';
CREATE FUNCTION _create("metric" name, "tags" name[], "fields" name[])
RETURNS regclass
LANGUAGE C AS '$libdir/influx.so', 'default_create';