Starting from Hologres V3.1, logical partitioned tables are supported. This topic describes how to use the ALTER LOGICAL PARTITION TABLE statement to modify the configuration of a logical partitioned table.
Modify a logical partitioned table
Hologres supports the ALTER TABLE syntax. For more information about using ALTER TABLE for non-partitioned tables, see ALTER TABLE. As physical tables, logical partitioned tables also support the ALTER TABLE syntax and have all ALTER TABLE functionalities of non-partitioned tables. In addition, logical partitioned tables support modifying partition properties by partition. For more information about logical partitioned tables and partition properties, see Table properties and Partition properties.
Modify table properties
ALTER TABLE <table_name> SET (<property_name> = <property_value> [, ...]);Reset table properties
ALTER TABLE <table_name> RESET (<property_name> [, ...]);Modify partition properties
ALTER TABLE <table_name> PARTITION(<partition_key> = '<partition_value>') [...] SET (<property_name> = <property_value> [, ...]);Reset partition properties
ALTER TABLE <table_name> PARTITION(<partition_key> = '<partition_value>') [...] RESET (<property_name> [, ...]);Compared with physical partitioned tables, logical partitioned tables do not require partition creation. They also do not require attaching or detaching partitions through the ALTER TABLE syntax.
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 of the logical partitioned table
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 of multiple partitions in the logical partitioned table
ALTER TABLE public.hologres_logical_parent_1
PARTITION (ds = '2025-03-16') PARTITION (ds = '2025-03-17')
SET (
keep_alive = TRUE,
storage_mode = 'hot');