pg_lamina
pg_lamina · Transactional PostgreSQL-hosted Parquet analytics with DataFusion
Overview
PostgreSQL · 17, 18, 19
Usage
Sources:
pg_lamina 0.3.0 stores transactional Parquet segments in PostgreSQL tables and runs analytical queries through DataFusion. It supports PostgreSQL17–19. Conversion now preserves the original heap and attaches insert ingestion; it does not reproduce UPDATE or DELETE in the analytical copy.
Convert and Query
A superuser installs the extension and uses the current lamina schema:
Conversion takes an exclusive lock until transaction end and accepts ordinary logged heap tables. It retains the source on commit; rollback discards the conversion. Analytical tables are catalog entries, not normal PostgreSQL relations. Source indexes, constraints, defaults and permissions are not transferred.
Ingestion and Maintenance
The statement trigger buffers INSERT/COPY rows in logged delta tables, immediately visible to lamina.query. lamina.ingest_batch_rows controls flushing: 0 flushes each statement and -1 waits for explicit flushing. lamina.append_table accepts matching batch tables and an explicit drop/truncate/keep cleanup policy. lamina.attach_staging_table and lamina.detach_staging_table manage ingestion triggers. Compaction rewrites segments and summaries.
Boundaries and Upgrade
lamina.query uses DataFusion semantics, is read-only, requires a superuser and returns at most 10,000 rows. Supported types include booleans, integer types, double precision, text and finite dates/timestamps without time zone. Numeric, timestamptz, arrays and domains are unsupported. Partitioned, inherited, temporary and unlogged sources are unsupported.
lamina.memory_limit_mb bounds tracked query memory; lamina.query_workers and per-backend caches need separate sizing. This release stores segments and delta rows in WAL-logged tables covered by PostgreSQL backups and physical replication. Restore targets need matching extension binaries. Install the new library/SQL, follow the upstream restart procedure and run:
The upgrade preserves existing segments. Legacy pg_analytics/analytics prerelease images are a separate compatibility boundary and must not be treated as interchangeable with versioned pg_lamina installations.
Version 0.3.1
Release 0.3.1 retains the PostgreSQL 17–19 interface and storage boundaries above. The supplied 0.3.0-to-0.3.1 script is a version transition with no SQL object changes. After installing matching binaries and upgrade files and following the upstream restart procedure, use ALTER EXTENSION pg_lamina UPDATE TO '0.3.1'. Earlier installations must have the complete supported upgrade chain available; the older README example stops at 0.3.0.