Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 853
Shreya Batra Avatar asked Jan 15 '19 10:01

Shreya Batra


1 Answers

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.

like image 174
a_horse_with_no_name Avatar answered Oct 12 '22 10:10

a_horse_with_no_name