From the questing I believe you want to change or add partition column on an existing table, in this case ins_txn_attachment_live. One easy way I see and I personally follow when there is no option to alter a table for a specific property, like partition or change the position of fields inside a table is the following:

First rename your table and including keys or indexes (in addition do not give prefix of PK in PostgreSQL indexes, as PostgreSQL creates out of the box primary key indexes without being visible in PGAdmin):

ALTER TABLE ins_txn_attachment_live RENAME TO ins_txn_attachment_live_old
ALTER INDEX PK_Ins_TXN_Attachment_ID_ArchiveDataRENAME TO PK_Ins_TXN_Attachment_ID_ArchiveData_old

Then create your new table with the desired partition:

CREATE TABLE ins_txn_attachment_live (
    id              UUID         NOT NULL,
    attachment_id   UUID         NOT NULL,
    inserttstmp     timestamp    not NULL
    archivedate     timestamp    NULL
)PARTITION BY RANGE (<whatever column>);

Then copy your data from _old table to the new table (if the source and destination columns are the same):

INSERT INTO ins_txn_attachment_live SELECT * FROM ins_txn_attachment_live_old

Then copy your data from _old table to the new table (in case the source and destination columns are different):

INSERT INTO ins_txn_attachment_live (id, attachment_id, inserttstmp, archivedate, new_column) SELECT id, attachment_id, inserttstmp, archivedate, 'new_default_value' FROM ins_txn_attachment_live_old

Hope it helps

Answer from Stavros Koureas on Stack Overflow
🌐
PostgreSQL
postgresql.org › docs › current › ddl-partitioning.html
PostgreSQL: Documentation: 18: 5.12. Table Partitioning
May 14, 2026 - CREATE TABLE measurement ( city_id int not null, logdate date not null, peaktemp int, unitsales int ) PARTITION BY RANGE (logdate); Create partitions. Each partition's definition must specify bounds that correspond to the partitioning method ...
🌐
EnterpriseDB
enterprisedb.com › blog › altering-bounds-partition
EDB Tutorial: How To ALTER the Bounds of a Partition | EDB
Like many other major features in PostgreSQL, partitioning will take a few (or possibly, just a couple) releases to be functionally complete or close to complete. However, the above functional deficiency is not hard to overcome, and what follows is how to do it. Let's create a partitioned table with three partitions: CREATE TABLE t1 (a int, b int) PARTITION BY RANGE(a); CREATE TABLE t1p1 PARTITION OF t1 FOR VALUES FROM (0) TO (100); CREATE TABLE t1p2 PARTITION OF t1 FOR VALUES FROM (200) TO (300); CREATE TABLE t1p3 PARTITION OF t1 FOR VALUES FROM (300) TO (400);
🌐
Bun
bun.uptrace.dev › postgres › table-partition.html
PostgreSQL Table Partitioning - Bun - Uptrace
March 30, 2025 - ALTER TABLE measurements RENAME TO measurements_y2021m01; -- Create the partitioned table. CREATE TABLE measurements (LIKE measurements_y2021m01 INCLUDING DEFAULTS INCLUDING CONSTRAINTS) PARTITION BY RANGE (date); -- Attach the existing partition ...
🌐
Kyle Hailey
kylehailey.com › post › postgres-partition-conversion-minimal-downtime
Postgres Partition Conversion: minimal downtime
April 9, 2023 - Create a new table like payment, then the trick is, add a constraint for the time range of the new partition, the attach that table with the constraint as a partition: CREATE TABLE payment_23_04_13 (LIKE payment INCLUDING ALL); ALTER TABLE payment_23_04_13 ADD CONSTRAINT payment_23_04_13_constraint CHECK ( created IS NOT NULL AND created >= '2023-04-13 00:00:00'::timestamp without time zone AND created < '2023-04-14 00:00:00'::timestamp without time zone ) ; ALTER TABLE payment ATTACH PARTITION payment_23_04_13 FOR VALUES FROM ('2023-04-13 00:00:00') TO ( '2023-04-14 00:00:00');
🌐
PostgreSQL Extension Network
pgxn.org › dist › range_partitioning
range_partitioning: Partition a table by static ranges / PostgreSQL Extension Network
Run “make install” same as above to put the script files and libraries in place. Then run the following in PostgreSQL itself: ALTER EXTENSION range_partitioning UPDATE TO '<latest ...
🌐
EnterpriseDB
enterprisedb.com › docs › epas › latest › reference › oracle_compatibility_reference › 04_partitioning_commands_compatible_with_oracle_databases › 02_alter_table_add_partition
EDB Docs - EDB Postgres Advanced Server v18 - ALTER TABLE...ADD PARTITION
ADD PARTITION command adds a partition to an existing partitioned table. There's no upper limit to the number of defined partitions in a partitioned table. New partitions must be of the same type (LIST, RANGE, or HASH) as existing partitions.
🌐
PostgreSQL Wiki
wiki.postgresql.org › wiki › Table_partitioning
Table partitioning - PostgreSQL wiki
June 7, 2019 - CREATE TABLE orders(id INT, shipdate DATE, …) PARTITION BY RANGE(shipdate) ( PARTITION q4_05 STARTING MINVALUE, PARTITION q1_06 STARTING '1/1/2006', PARTITION q2_06 STARTING '4/1/2006', PARTITION q3_06 STARTING '7/1/2006', PARTITION q4_06 STARTING '10/1/2006' ENDING ‘12/31/2006' ) This is equivalent to "VALUES LESS THAN"(technically VALUES GREATER THAN) and includes a limit · The partition manipulation syntax (here, addition) is nice, too: ALTER TABLE orders ATTACH PARTITION q1_07 STARTING '01/01/2007' ENDING '03/31/2007' FROM TABLE neworders
Find elsewhere
🌐
Medium
medium.com › @dmitry.romanoff › partitioning-a-table-by-range-in-the-postgresql-database-423adb0319b7
Partitioning a table by range in the PostgreSQL database. | by Dmitry Romanoff | Medium
November 9, 2023 - Check table definition to ensure how partitions are defined · postgres=# \d+ my_table_partitioned Partitioned table "public.my_table_partitioned" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description --------+-----------------------------+-----------+----------+--------------------------------------------------+----------+--------------+------------- id | integer | | not null | nextval('my_table_partitioned_id_seq'::regclass) | plain | | a | character varying(100) | | | | extended | | b | timestamp without time zone | | not null | | plain | | c | smallint | | |
🌐
Evil Martians
evilmartians.com › blog › a slice of life: table partitioning in postgresql databases—martian chronicles, evil martians’ team blog
A slice of life: table partitioning in PostgreSQL databases—Martian Chronicles, Evil Martians’ team blog
April 12, 2022 - At the same time, since unique constraints must include a partition key, we cannot ensure that the uuid is unique. ... ALTER TABLE event_store_messages_partitioned ADD CONSTRAINT event_store_messages_partitioned_pkey PRIMARY KEY (uuid, "time”);
🌐
PostgreSQL
postgresql.org › docs › 11 › sql-altertable.html
PostgreSQL: Documentation: 11: ALTER TABLE
November 9, 2023 - ALTER TABLE cities ATTACH PARTITION cities_partdef DEFAULT; ... The forms ADD (without USING INDEX), DROP [COLUMN], DROP IDENTITY, RESTART, SET DEFAULT, SET DATA TYPE (without USING), SET GENERATED, and SET sequence_option conform with the SQL ...
🌐
Medium
rodoq.medium.com › partition-an-existing-table-on-postgresql-480b84582e8d
Partition an existing table on PostgreSQL | by Rodolphe Quiédeville | Medium
February 15, 2021 - Partition an existing table on PostgreSQL Release after release PostgreSQL is better and better on table partitioning, if you do run a version12 or 13 today you must have a look on this …
🌐
pg_tileserv
access.crunchydata.com › documentation › postgresql11 › 11.2 › ddl-partitioning.html
5.10. Table Partitioning - PostgreSQL
PostgreSQL offers built-in support for the following forms of partitioning: ... The table is partitioned into " ranges " defined by a key column or set of columns, with no overlap between the ranges of values assigned to different partitions.
🌐
PostgreSQL
postgresql.org › message-id › attachment › 67544 › ddl-partitioning.html
5.10. Table Partitioning
PostgreSQL offers built-in support for the following forms of partitioning: ... The table is partitioned into “ranges” defined by a key column or set of columns, with no overlap between the ranges of values assigned to different partitions.
🌐
PostgreSQL
postgresql.org › docs › 10 › ddl-partitioning.html
PostgreSQL: Documentation: 10: 5.10. Table Partitioning
November 10, 2022 - For example, one might partition by date ranges, or by ranges of identifiers for particular business objects. ... The table is partitioned by explicitly listing which key values appear in each partition. If your application needs to use other forms of partitioning not listed above, alternative methods such as inheritance and UNION ALL views can be used instead. Such methods offer flexibility but do not have some of the performance benefits of built-in declarative partitioning. PostgreSQL offers a way to specify how to divide a table into pieces called partitions.
🌐
EnterpriseDB
enterprisedb.com › docs › epas › latest › epas_compat_table_partitioning › 04_partitioning_commands_compatible_with_oracle_databases › 02_alter_table_add_partition
EDB Docs - EDB Postgres Advanced Server v15 - ALTER TABLE...ADD PARTITION
January 24, 2023 - ADD PARTITION command adds a partition to an existing partitioned table. There's no upper limit to the number of defined partitions in a partitioned table. New partitions must be of the same type (LIST, RANGE, or HASH) as existing partitions.
🌐
PostgreSQL
postgresql.org › message-id › c73a1746-0cd0-6bdd-6b23-3ae0b7c0c582@postgrespro.ru
PostgreSQL: Add SPLIT PARTITION/MERGE PARTITIONS commands
May 31, 2022 - CREATE TABLE sales_range (salesman_id INT, salesman_name VARCHAR(30), sales_amount INT, sales_date DATE) PARTITION BY RANGE (sales_date); CREATE TABLE sales_jan2022 PARTITION OF sales_range FOR VALUES FROM ('2022-01-01') TO ('2022-02-01'); CREATE ...
🌐
Postgres Professional
postgrespro.com › docs › postgrespro › 11 › ddl-partitioning
Postgres Pro Standard : Documentation: 11: 5.10. Table Partitioning : Postgres Professional
August 4, 2020 - CREATE TABLE measurement ( city_id int not null, logdate date not null, peaktemp int, unitsales int ) PARTITION BY RANGE (logdate); Create partitions. Each partition's definition must specify bounds that correspond to the partitioning method ...