Modifies the configuration of a logical partitioned table. Available starting from Hologres V3.1.
Unlike physical partitioned tables, logical partitioned tables do not require manual partition creation, or attaching and detaching partitions through ALTER TABLE.The following operations are supported:
Modify table properties — Update table-level settings such as expiration time, hot storage window, and partition filter requirements.
Reset table properties — Restore one or more table-level properties to their defaults.
Modify partition properties — Update storage settings for one or more specific partitions.
Reset partition properties — Restore one or more partition-level properties to their defaults.
For non-partition-specific ALTER TABLE operations supported on logical partitioned tables, see ALTER TABLE. For the full list of table properties and partition properties, see Table properties and Partition properties.
Modify table properties
ALTER TABLE <table_name> SET (<property_name> = <property_value> [, ...]);Sets one or more table-level properties. You can update multiple properties in a single statement. Common properties include partition_expiration_time, partition_keep_hot_window, and partition_require_filter.
Reset table properties
ALTER TABLE <table_name> RESET (<property_name> [, ...]);Restores one or more table-level properties to their default values.
Modify partition properties
ALTER TABLE <table_name> PARTITION(<partition_key> = '<partition_value>') [...] SET (<property_name> = <property_value> [, ...]);Sets one or more properties on specific partitions. Common properties include keep_alive and storage_mode.
Specifying partition targets: Include one PARTITION(<partition_key> = '<partition_value>') clause for each partition to update. To update multiple partitions in a single statement, repeat the clause — for example:
PARTITION (ds = '2025-03-16') PARTITION (ds = '2025-03-17')Reset partition properties
ALTER TABLE <table_name> PARTITION(<partition_key> = '<partition_value>') [...] RESET (<property_name> [, ...]);Restores one or more partition-level properties to their default values.
Examples
Prepare data
-- Create a logical partitioned table.
CREATE TABLE public.hologres_logical_parent_1 (
a TEXT,
b INT,
c TIMESTAMP,
ds DATE NOT NULL,
PRIMARY KEY (b, ds))
LOGICAL PARTITION BY LIST (ds)
WITH (
orientation = 'column',
distribution_key = 'b',
partition_expiration_time = '30 day',
partition_keep_hot_window = '15 day',
partition_require_filter = TRUE,
binlog_level = 'replica',
partition_generate_binlog_window = '3 day'
);
-- Insert data.
INSERT INTO public.hologres_logical_parent_1
VALUES
('a', 1, '2025-03-16 10:00:00', '2025-03-16'),
('b', 2, '2025-03-17 11:00:00', '2025-03-17');Modify table properties
The following example extends the expiration window to 60 days, increases the hot storage window to 30 days, and disables the partition filter requirement.
ALTER TABLE public.hologres_logical_parent_1
SET (
partition_expiration_time = '60 day',
partition_keep_hot_window = '30 day',
partition_require_filter = FALSE);Modify partition properties for multiple partitions
The following example pins two partitions to hot storage by setting keep_alive = TRUE and storage_mode = 'hot' on both in a single statement.
ALTER TABLE public.hologres_logical_parent_1
PARTITION (ds = '2025-03-16') PARTITION (ds = '2025-03-17')
SET (
keep_alive = TRUE,
storage_mode = 'hot');What's next
CREATE LOGICAL PARTITION TABLE — Create a logical partitioned table and define its initial properties.
ALTER TABLE — General ALTER TABLE operations supported on Hologres tables.