As I have published on
https://abdulyadi.wordpress.com/2019/12/26/reinforce-data-validation-prevent-direct-table-modification/,
the patch is to have "private_modify" option in table creation. For example:
CREATE TABLE mytable (id integer) WITH (private_modify=true);
Having the option set, even superuser can not insert/update/delete the
table outside SQL or SPI-based function where complex data validation takes
place.
The patch has been passed all regression test provided in Postgresql source
code (src/test/regression): make check, make installcheck, make
installcheck-parallel, make checkworld, make install-checkworld.
Regards,
Abdul Yadi