View a markdown version of this page

Schema changes for integrations with Amazon S3 Tables - Amazon Aurora

Schema changes for integrations with Amazon S3 Tables

Important

This is preview documentation for the Aurora PostgreSQL integration with Amazon S3 Tables. Before using this capability, review the Betas and Previews terms in the AWS Service Terms.

The Aurora PostgreSQL integration with Amazon S3 Tables applies data definition language (DDL) changes made on the source Aurora PostgreSQL DB cluster to the target Apache Iceberg tables. Depending on the type of change, the integration applies it without interruption, resyncs the affected table, or puts the table in the FAILED state.

Changes applied without a resync

The integration applies the following changes as Iceberg metadata operations, without interrupting replication:

  • Adding a nullable column with no default.

  • Dropping a column that is not part of the primary key.

  • Renaming a column.

  • Compatible type promotions, such as INTEGER to BIGINT.

  • Creating, dropping, and truncating a table. Creating a table creates a new target table, and dropping a table deletes the target table (this requires the permission described later in this section).

For example, the integration applies the following source statements with no resync:

ALTER TABLE orders ADD COLUMN notes text; ALTER TABLE orders RENAME COLUMN notes TO comments; ALTER TABLE orders ALTER COLUMN amount TYPE bigint; -- compatible promotion from int

When you drop a table on the source, the integration deletes the corresponding Iceberg table. The table bucket policy must allow s3tables:DeleteTable. If it does not, the table enters the FAILED state with the reason TARGET_ACCESS_DENIED, and the target table stays in the bucket with its data. For the policy, see Creating the table bucket and resource policy.

Changes that cause a resync

The integration cannot apply the following changes as metadata operations, so it resyncs the affected table automatically:

  • Adding a column that has any of the following: a default value, an identity or serial definition, a generated expression, or a NOT NULL constraint.

  • Incompatible type changes (changes that are not compatible type promotions) to a type that the target supports, such as changing a column from text to integer.

  • Replacing a primary key in one statement.

  • Renaming a table. The renamed table is replicated to a new target table. If the new name matches your data rules, the integration syncs it as a new table. If the new name does not match your data rules, it is not synced as a new table. In both cases, if the old table name matches your data rules, replication to it stops but it is not deleted. If the old table name does not match your data rules, it is deleted.

  • Renaming a schema, moving a table to another schema (ALTER TABLE ... SET SCHEMA), or renaming a database. The integration replicates the affected tables to new target tables. For a database rename, it moves them to a new namespace for the new database name.

  • Renaming a column that a data rule excludes to a name that the rule does not exclude. The integration resyncs the table so that the column is replicated.

For example, the following source statement causes a resync:

ALTER TABLE orders ALTER COLUMN code TYPE integer USING code::integer; -- incompatible type change

For how an automatic resync works, see Automatic resync.

Dropping a column

When you drop a column on the source, the integration drops the column from the target Iceberg table, and the column is no longer replicated. The column's existing data remains readable through earlier Iceberg snapshots. Dropping a column that is part of the primary key is not supported, and replication of the table fails.

Changes that cause a table to fail

A change that violates a replication requirement puts the table in the FAILED state. You fix the cause on the source. The main example is dropping the primary key:

ALTER TABLE orders DROP CONSTRAINT orders_pkey; -- leaves the table without a primary key; the table enters the FAILED state

Changing a column to a type that the integration does not support also puts the table in the FAILED state. For the unsupported types, see Unsupported types and values.

Dropping and recreating a table

If you drop a source table, the integration deletes its target table. If you later create a source table with the same name, the integration creates a new target table and replicates all data in the new table from the time it was created. If the old target table was not deleted (for example, because the table bucket policy does not allow s3tables:DeleteTable), the integration resyncs the table instead.