This document describes how to build and install the ta_pg PostgreSQL extension.
First, you need to clone and compile the ta-lib C library.
git clone https://github.com/TA-Lib/ta-lib.git
cd ta-lib/
sh autogen.sh
./configure
makeThe C and SQL code for the PostgreSQL extension is generated from the ta_func_api.xml file using a Python script. To generate the wrappers, run the following command:
python3 scripts/generate_pg_wrappers.pyThis will generate the ta_pg.c and ta_pg--1.0.sql files in the src/ directory.
To compile the PostgreSQL extension, run the following command:
make ta_pg.soThis will create the ta_pg.so shared library.
To install the extension, you need to copy the following files to your PostgreSQL installation directory (where ${PG_VERSION} is the postgresql version):
ta_pg.soto the PostgreSQL library directory (e.g.,/usr/lib/postgresql/${PG_VERSION}/lib/)src/ta_pg.controlto the PostgreSQL extension directory (e.g.,/usr/share/postgresql/${PG_VERSION}/extension/)src/ta_pg--1.0.sqlto the PostgreSQL extension directory (e.g.,/usr/share/postgresql/${PG_VERSION}/extension/)
Once the files are copied, you can install the extension in your database by running the following SQL command:
CREATE EXTENSION ta_pg;