CREATE TABLE orders (
order_id SERIAL PRIMARY KEY,
customer_id INTEGER,
order_date DATE,
order_total NUMERIC
) PARTITION BY RANGE (order_date);
CREATE TABLE orders_y2023 PARTITION OF orders
FOR VALUES FROM ('2023-01-01') TO ('2024-01-01');
CREATE TABLE orders_y2024 PARTITION OF orders
FOR VALUES FROM ('2024-01-01') TO ('2025-01-01');
-- Add an index to each partition
CREATE INDEX idx_orders_y2023_customer_id ON orders_y2023 (customer_id);
CREATE INDEX idx_orders_y2024_customer_id ON orders_y2024 (customer_id);
order_id SERIAL PRIMARY KEY,
customer_id INTEGER,
order_date DATE,
order_total NUMERIC
) PARTITION BY RANGE (order_date);
CREATE TABLE orders_y2023 PARTITION OF orders
FOR VALUES FROM ('2023-01-01') TO ('2024-01-01');
CREATE TABLE orders_y2024 PARTITION OF orders
FOR VALUES FROM ('2024-01-01') TO ('2025-01-01');
-- Add an index to each partition
CREATE INDEX idx_orders_y2023_customer_id ON orders_y2023 (customer_id);
CREATE INDEX idx_orders_y2024_customer_id ON orders_y2024 (customer_id);
Schemas in PostgreSQL and Oracle: what is the difference?
https://www.cybertec-postgresql.com/en/schema-postgresql-oracle-difference/
https://www.cybertec-postgresql.com/en/schema-postgresql-oracle-difference/
CYBERTEC PostgreSQL | Services & Support
Schemas in PostgreSQL and Oracle: what is the difference?
This article describes how the database management systems Oracle and PostgreSQL implement the standard SQL concept "schema" differently.
Cascading Replication
https://www.cybertec-postgresql.com/en/patroni-cascading-replication-with-stanby-cluster/
https://www.cybertec-postgresql.com/en/patroni-cascading-replication-with-stanby-cluster/
CYBERTEC PostgreSQL | Services & Support
Patroni: Cascading Replication with Standby Cluster
A demonstration of how to setup a Patroni standby cluster, including prerequisites, configuration and promotion.
Patroni is a widely used solution for managing PostgreSQL high availability. It provides a robust framework for automatic failover, cluster management, and operational simplicity in PostgreSQL environments.
https://www.cybertec-postgresql.com/en/patroni-cascading-replication-with-stanby-cluster/
https://www.cybertec-postgresql.com/en/patroni-cascading-replication-with-stanby-cluster/
CYBERTEC PostgreSQL | Services & Support
Patroni: Cascading Replication with Standby Cluster
A demonstration of how to setup a Patroni standby cluster, including prerequisites, configuration and promotion.