Shreya Batra
Shreya Batra

Reputation: 800

how to add new column to partitioned tables in postgres

I have created a new master table with multiple partitions on basis of a column value using declarative partitioning of postgres 10. How can i add new columns to the tables?

Upvotes: 11

Views: 9522

Answers (1)

user330315
user330315

Reputation:

You only need to add that column to the base table:

alter table master_table add new_column integer;

All partitions will automatically get that new column.

Upvotes: 23

Related Questions