Scalable Open-Source Historian Database
Ignition PostgreSQL Historian: Enterprise Data Storage
Deploy PostgreSQL as a high-performance historian database for Ignition SCADA. Leverage Tag Historian, Store & Forward reliability, and table partitioning for scalable long-term data storage across your industrial infrastructure.
Overview
PostgreSQL is the ideal Ignition PostgreSQL historian choice for industrial environments requiring robust, open-source data storage. Its advanced features like native partitioning, JSON support, and powerful indexing make it a top-tier candidate for Tag Historian data, alarm journals, and audit logs at enterprise scale.
Combined with Ignition’s Store & Forward engine, PostgreSQL guarantees zero data loss even during network disruptions. Named Queries provide a secure, high-performance interface for custom reporting, while TimescaleDB extensions can further optimize time-series workloads.
Key Benefits
- Open-source with enterprise-grade reliability
- Native table partitioning for billions of rows
- Store & Forward ensures zero data loss
- Named Queries for secure, cached SQL access
- TimescaleDB extension for time-series optimization
PostgreSQL Historian Architecture
Data flows from Ignition tags through the Store & Forward engine into PostgreSQL, where it is available for reporting and advanced analytics.
+-----------------+ +----------------------+ +----------------+ +----------------------+
| Ignition Tags | --> | Store & Forward | --> | PostgreSQL | --> | Reporting / |
| (OPC, MQTT, | | Engine | | Historian DB | | Analytics |
| Device Tags) | | (buffering & retry) | | (partitioned) | | (Grafana, Perspective|
+-----------------+ +----------------------+ +----------------+ | Reports, BI tools) |
+----------------------+Configuration Steps
Step 1: Create the PostgreSQL historian database
Set up a dedicated PostgreSQL database and user for Ignition historian data. This isolates historian storage from other application data and allows fine-grained access control.
-- Connect to PostgreSQL as superuser
CREATE DATABASE ignition_historian;
-- Create a dedicated user for Ignition
CREATE USER ignition_user WITH PASSWORD 'secure_password_here';
-- Grant privileges
GRANT ALL PRIVILEGES ON DATABASE ignition_historian TO ignition_user;
-- Connect to the new database
\c ignition_historian
-- Grant schema privileges
GRANT ALL ON SCHEMA public TO ignition_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT ALL ON TABLES TO ignition_user;Step 2: Add the database connection in Ignition Gateway
Configure the JDBC connection in the Ignition Gateway. Navigate to Config > Databases > Connections and add a new PostgreSQL connection using the org.postgresql.Driver JDBC driver.
# Ignition Gateway connection settings
# Navigate to: Config > Databases > Connections > Create new connection
Name: PostgreSQL_Historian
Description: Historian database for tag history and alarms
JDBC Driver: org.postgresql.Driver
JDBC URL: jdbc:postgresql://db-server:5432/ignition_historian
Username: ignition_user
Password: ********
# Connection pooling (recommended settings)
Max Active: 20
Max Idle: 10
Min Idle: 5
Validation Query: SELECT 1Step 3: Configure Tag Historian to use PostgreSQL
Create a Tag History provider pointing to the PostgreSQL connection, then enable history on your tags. Use system.tag.configure in a gateway script or the Designer tag editor to set up historian properties.
# Python script to enable Tag Historian on existing tags
# Run in the Script Console or as a Gateway Event Script
# Define tag configuration with historian enabled
tag_config = {
"name": "Temperature_Reactor_01",
"tagType": "AtomicTag",
"dataType": "Float8",
"historyEnabled": True,
"historyProvider": "PostgreSQL_Historian",
"historySampleRate": 10000, # 10 seconds
"historyMaxAge": 365, # days to retain
"historyMaxAgeUnits": "DAY"
}
# Apply configuration to the tag path
system.tag.configure(
basePath="[default]Plant/Reactor",
tags=[tag_config],
collisionPolicy="o" # overwrite existing
)
print("Tag Historian configured for PostgreSQL.")Step 4: Set up table partitioning for scalability
Implement PostgreSQL native partitioning on the historian tables to maintain query performance as data volume grows. Monthly partitions allow efficient data retention policies and faster queries on recent data.
-- Create the partitioned historian table
-- (run this BEFORE Ignition creates its default tables,
-- or migrate existing data)
CREATE TABLE sqlt_data_1_2024 PARTITION OF sqlt_data_1
FOR VALUES FROM ('2024-01-01') TO ('2025-01-01')
PARTITION BY RANGE (t_stamp);
-- Create monthly sub-partitions for 2024
CREATE TABLE sqlt_data_1_2024_01 PARTITION OF sqlt_data_1_2024
FOR VALUES FROM ('2024-01-01') TO ('2024-02-01');
CREATE TABLE sqlt_data_1_2024_02 PARTITION OF sqlt_data_1_2024
FOR VALUES FROM ('2024-02-01') TO ('2024-03-01');
-- ... repeat for each month
-- Create indexes on each partition for fast lookups
CREATE INDEX idx_sqlt_data_2024_01_tstamp
ON sqlt_data_1_2024_01 (t_stamp);
CREATE INDEX idx_sqlt_data_2024_01_tagid
ON sqlt_data_1_2024_01 (tagid);
-- Automate partition creation with pg_partman (recommended)
SELECT partman.create_parent('public.sqlt_data_1',
't_stamp', 'native', 'monthly');Key Features
Tag Historian
Automatically collect and store time-series data from Ignition tags into PostgreSQL with configurable sample rates, deadband filtering, and data retention policies.
Store & Forward
Buffer historian data locally when the PostgreSQL connection is unavailable and automatically forward it once connectivity is restored, ensuring zero data loss.
Named Queries
Execute parameterized, pre-compiled SQL queries against PostgreSQL with built-in caching, connection management, and SQL injection prevention for secure reporting.
Table Partitioning
Leverage PostgreSQL native range partitioning to split historian tables by time period, enabling fast queries on recent data and efficient archival of historical records.
Use Cases
Long-Term Historian Storage
Store years of high-resolution tag history data in PostgreSQL with partitioned tables, automated retention policies, and efficient compression for cost-effective long-term archival.
Regulatory Compliance & Audit Trail
Maintain tamper-evident audit trails and compliance records in PostgreSQL for FDA 21 CFR Part 11, ISO 14001, and other regulatory frameworks with immutable historical data and full traceability.
Advanced Analytics with Grafana
Connect Grafana directly to PostgreSQL historian tables for real-time dashboards, trend analysis, and anomaly detection. Combine SCADA data with business metrics in unified visualizations.
Technologies
PostgreSQL 15+
Enterprise-grade open-source relational database with native partitioning, advanced indexing, and ACID compliance for mission-critical historian storage.
Tag Historian
Ignition’s built-in module for automatic time-series data collection from tags, with configurable sample rates, deadband filtering, and multiple storage providers.
Store & Forward
Ignition’s data buffering engine that caches historian records locally during database outages and reliably forwards them when connectivity is restored.
pgAdmin
Web-based administration tool for PostgreSQL providing database management, query execution, monitoring dashboards, and backup/restore operations.
TimescaleDB
PostgreSQL extension that adds automatic partitioning, columnar compression, and continuous aggregates optimized for time-series data from Ignition Tag Historian.
Frequently Asked Questions
Find answers to common questions about this integration.
Ready to Get Started?
Contact our team of experts to discuss your integration needs and get a customized solution.