pg_analytics

Postgres for analytics, powered by DuckDB

Overview

PIGSTY 3rd Party Extension: pg_analytics : Postgres for analytics, powered by DuckDB

Information

Metadata

  • Latest Version: 0.3.3
  • Postgres Support: 17,16,15,14
  • Need Load: Shared library do not need explicit loading
  • Need DDL: Need CREATE EXTENSION DDL
  • Relocatable: Can be installed into other schemas
  • Trusted: Trusted, Can be created by user with CREATE Privilege
  • Schemas: paradedb
  • Requires: N/A

RPM / DEB

  • RPM Repo: PIGSTY
  • RPM Name: pg_analytics_$v
  • RPM Ver : 0.3.3
  • RPM Deps: N/A
  • DEB Repo: PIGSTY
  • DEB Name: postgresql-$v-pg-analytics
  • DEB Ver : 0.3.3
  • DEB Deps: N/A

Packages

OS Arch PG17 PG16 PG15 PG14 PG13
el8 x86_64 pg_analytics_17
PIGSTY 0.3.3
pg_analytics_16
PIGSTY 0.3.3
pg_analytics_15
PIGSTY 0.3.3
pg_analytics_14
PIGSTY 0.3.3
pg_analytics_13
PIGSTY 0.2.1
el8 aarch64 pg_analytics_17
PIGSTY 0.3.3
pg_analytics_16
PIGSTY 0.3.3
pg_analytics_15
PIGSTY 0.3.3
pg_analytics_14
PIGSTY 0.3.3
pg_analytics_13
PIGSTY 0.2.1
el9 x86_64 pg_analytics_17
PIGSTY 0.3.3
pg_analytics_16
PIGSTY 0.3.3
pg_analytics_15
PIGSTY 0.3.3
pg_analytics_14
PIGSTY 0.3.3
pg_analytics_13
PIGSTY 0.2.1
el9 aarch64 pg_analytics_17
PIGSTY 0.3.3
pg_analytics_16
PIGSTY 0.3.3
pg_analytics_15
PIGSTY 0.3.3
pg_analytics_14
PIGSTY 0.3.3
pg_analytics_13
PIGSTY 0.2.1
d12 x86_64 postgresql-17-pg-analytics
PIGSTY 0.3.3
postgresql-16-pg-analytics
PIGSTY 0.3.3
postgresql-15-pg-analytics
PIGSTY 0.3.3
postgresql-14-pg-analytics
PIGSTY 0.3.3
d12 aarch64 postgresql-17-pg-analytics
PIGSTY 0.3.3
postgresql-16-pg-analytics
PIGSTY 0.3.3
postgresql-15-pg-analytics
PIGSTY 0.3.3
postgresql-14-pg-analytics
PIGSTY 0.3.3
u22 x86_64 postgresql-17-pg-analytics
PIGSTY 0.3.3
postgresql-16-pg-analytics
PIGSTY 0.3.3
postgresql-15-pg-analytics
PIGSTY 0.3.3
postgresql-14-pg-analytics
PIGSTY 0.3.3
u22 aarch64 postgresql-17-pg-analytics
PIGSTY 0.3.3
postgresql-16-pg-analytics
PIGSTY 0.3.3
postgresql-15-pg-analytics
PIGSTY 0.3.3
postgresql-14-pg-analytics
PIGSTY 0.3.3
u24 x86_64 postgresql-17-pg-analytics
PIGSTY 0.3.3
postgresql-16-pg-analytics
PIGSTY 0.3.3
postgresql-15-pg-analytics
PIGSTY 0.3.3
postgresql-14-pg-analytics
PIGSTY 0.3.3
u24 aarch64 postgresql-17-pg-analytics
PIGSTY 0.3.3
postgresql-16-pg-analytics
PIGSTY 0.3.3
postgresql-15-pg-analytics
PIGSTY 0.3.3
postgresql-14-pg-analytics
PIGSTY 0.3.3

Installation

Install pg_analytics via the pig CLI tool:

pig ext install pg_analytics

Install pg_analytics via Pigsty playbook:

./pgsql.yml -t pg_extension -e '{"pg_extensions": ["pg_analytics"]}' # -l <cls>

Install pg_analytics RPM from YUM repo directly:

dnf install pg_analytics_17;
dnf install pg_analytics_16;
dnf install pg_analytics_15;
dnf install pg_analytics_14;

Install pg_analytics DEB from APT repo directly:

apt install postgresql-17-pg-analytics;
apt install postgresql-16-pg-analytics;
apt install postgresql-15-pg-analytics;
apt install postgresql-14-pg-analytics;

Enable pg_analytics extension on PostgreSQL cluster:

CREATE EXTENSION pg_analytics;

Usage

https://github.com/paradedb/pg_analytics

Example, read parquet file 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;




Last modified 2025-02-17: add extension part (cfa504b)