pg_analytics
Postgres for analytics, powered by DuckDB
Overview
2420 | pg_analytics | pg_analytics | 0.3.7 | OLAP | PostgreSQL | Rust |
Attributes
Yes | No | Yes | No | Yes | No | Yes | paradedb |
Packages
EL | PIGSTY | pg_analytics_$v | 0.3.7 | - | 17 16 15 14 13 |
Debian | PIGSTY | postgresql-$v-pg-analytics | 0.3.7 | - | 17 16 15 14 13 |
Comments
pgrx=0.13.0
Availability
PG17 | PG16 | PG15 | PG14 | PG13 | |
---|---|---|---|---|---|
el8.x86_64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | 0.2.1 |
el8.aarch64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | 0.2.1 |
el9.x86_64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | 0.2.1 |
el9.aarch64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | 0.2.1 |
d12.x86_64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | ✗ |
d12.aarch64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | ✗ |
u22.x86_64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | ✗ |
u22.aarch64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | ✗ |
u24.x86_64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | ✗ |
u24.aarch64 | 0.3.7 | 0.3.7 | 0.3.7 | 0.3.7 | ✗ |
CONTRIB
PGDG
PIGSTY
Download
To add the required PGDG / PIGSTY upstream repository, use:
pig repo add pgdg -u # add PGDG repo and update cache (leave existing repos)
pig repo add pigsty -u # add PIGSTY repo and update cache (leave existing repos)
pig repo add pgsql -u # add PGDG + Pigsty repo and update cache (leave existing repos)
pig repo set all -u # set repo to all = NODE + PGSQL + INFRA (remove existing repos)
./node.yml -t node_repo -e node_repo_modules=node,pgsql # -l <cluster>
Or download the latest packages directly:
Install
Install this extension with:
pig ext install pg_analytics; # install by extension name, for the current active PG version
pig ext install pg_analytics -v 17; # install for PG 17
pig ext install pg_analytics -v 16; # install for PG 16
pig ext install pg_analytics -v 15; # install for PG 15
pig ext install pg_analytics -v 14; # install for PG 14
dnf install pg_analytics_17;
dnf install pg_analytics_16;
dnf install pg_analytics_15;
dnf install pg_analytics_14;
apt install postgresql-17-pg-analytics;
apt install postgresql-16-pg-analytics;
apt install postgresql-15-pg-analytics;
apt install postgresql-14-pg-analytics;
./pgsql.yml -t pg_ext -e '{"pg_extensions": ["pg_analytics"]}' # -l <cls>
Create this extension with:
CREATE EXTENSION pg_analytics;
Usage
Archived!
This extension is archived and no longer maintained. It is recommended to use other duckdb related extensions instead.
https://github.com/paradedb/pg_analytics
Example, read parquet files from S3:
CREATE EXTENSION pg_lakehouse;
CREATE FOREIGN DATA WRAPPER parquet_wrapper HANDLER parquet_fdw_handler VALIDATOR parquet_fdw_validator;
-- Provide S3 credentials
CREATE SERVER parquet_server FOREIGN DATA WRAPPER parquet_wrapper;
-- Create foreign table with auto schema creation
CREATE FOREIGN TABLE trips ()
SERVER parquet_server
OPTIONS (files 's3://paradedb-benchmarks/yellow_tripdata_2024-01.parquet');
-- Success! Now you can query the remote Parquet file like a regular Postgres table
SELECT COUNT(*) FROM trips;
count
---------
2964624
(1 row)
This fdw is read-only for now.
Iceberg Support
CREATE EXTENSION pg_lakehouse;
CREATE FOREIGN DATA WRAPPER iceberg_wrapper
HANDLER iceberg_fdw_handler
VALIDATOR iceberg_fdw_validator;
CREATE SERVER iceberg_server
FOREIGN DATA WRAPPER iceberg_wrapper;
-- Replace the dummy schema with the actual schema
CREATE FOREIGN TABLE iceberg_table (x INT)
SERVER iceberg_server
OPTIONS (files 's3://bucket/iceberg_folder');
-- Success! You can now query the Iceberg table
SELECT COUNT(*) FROM iceberg_table;