Skip to content

InfluxDB Line Protocol Listener for PostgreSQL

License

Notifications You must be signed in to change notification settings

mkindahl/pg_influx

 
 

Repository files navigation

InfluxDB Line Protocol Listener for PostgreSQL

InfluxDB line protocol listener that can listen on UDP ports and insert into PostgreSQL database tables.

Lines will be received over UDP in InfluxDB line protocol format and write them into tables in the database. This means that there is a risk that lines can be lost, but it is very fast and does not block.

This is a very basic example of an extension that listens for data on a socket and writes it to the database.

It is an ongoing experimental work for educational purposes and as such there are no guarantees regarding feasability for any specific purpose, including its intended use.

Documentation

Building and Installing

To install the dependencies it is easiest to install the PGDG version of the packages. Using the instructions from PostgreSQL Apt Repository would look like this:

sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install postgresql postgresql-server-dev-13

After the dependencies are installed, you can download the repository from GitHub.

git clone git@github.com:mkindahl/pg_influx.git
cd pg_influx

Building from source

After the dependencies are installed, To build and install the extension:

make
sudo make install

Building Debian Packages

The debian directory contains the necessary files to build a debian package. To build the Debian packages you can use debmake together with debuild:

debmake -t -i debuild

You will find the resulting packages in the parent directory of the source directory.

If you want to build unsigned packages, you can do that using

debmake -t -i "debuild -i -uc -us"

Running Regression Tests

To run the regression tests

make installcheck

About

InfluxDB Line Protocol Listener for PostgreSQL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 94.9%
  • Makefile 2.7%
  • PLpgSQL 2.4%