PFA v4.
I’ve extended the NOTICE to cover all sub-commands for which ONLY has no effect and where actions on a partitioned table do not propagate to its partitions:
- ALTER COLUMN SET/RESET attribute_option
- ALTER COLUMN SET COMPRESSION
- ENABLE/DISABLE RULE
- ENABLE/DISABLE/FORCE/NO FORCE ROW LEVEL SECURITY
- REPLICA IDENTITY
- OWNER TO
- SET TABLESPACE
- SET SCHEMA
RENAME is intentionally excluded. Using ONLY (or not) has no effect for RENAME, since relation names are independent by nature and there is no expectation of recursion.
OF / NOT OF are also excluded. Using ONLY has no effect for these commands, as they apply only to the partitioned table itself and not to its partitions.
One thing worth noting: following David’s suggestion, I removed the action name from the NOTICE message in v2. However, I later realized that we do need to include the action name, because an ALTER TABLE command may contain multiple sub-commands, and the NOTICE would otherwise be ambiguous.
In v4, I reuse alter_table_type_to_string() to construct the action name, consistent with what ATSimplePermissions() does. The NOTICE message itself also follows the same style as messages emitted by ATSimplePermissions(). For example, when an ALTER TABLE contains multiple sub-commands, the output now looks like:
```
evantest=# alter table p_test replica identity full, alter column username set (n_distinct = 0.1);
NOTICE: ALTER action REPLICA IDENTITY on relation "p_test" does not affect present partitions
HINT: partitions may be modified individually, or specify ONLY to suppress this message
NOTICE: ALTER action ALTER COLUMN ... SET on relation "p_test" does not affect present partitions
HINT: partitions may be modified individually, or specify ONLY to suppress this message
ALTER TABLE
```
Regression tests have been updated, and a few new tests have been added. v4 should now be ready for review.
Best regards,