I have a table:
dw_readings(date_key, time_key, account_key, reading_value, consumption, processed_date)
which has been partitioned on date_key by year. I now have need to add a reading_id column to the master table to support new functionality, however using the alter table statement doesn't seem to work correctly. After applying the alter to add the new reading_id column any insert into dw_readings results in reading_id being set to null despite the value being set in the insert statement; this can be reproduced through Java JDBC and through pgAdmin. However update statements setting the reading_id work correctly allowing me to set the column value.
The table is being altered using the following statement
ALTER dw_readings ADD COLUMN reading_id INTEGER;
What I need to know is how to properly add a new column to a partitioned table so that inserts work properly.
ALTERand INSERT statements you are using.