On Fri, 5 Apr 2019 at 17:31, Pavan Deolasee <pavan.deola...@gmail.com> wrote: > IMV it makes sense to simply cap the lower limit of toast_tuple_target to the > compile time default and update docs to reflect that. Otherwise, we need to > deal with the possibility of dynamically creating the toast table if the > relation option is lowered after creating the table. Your proposed patch > handles the case when the toast_tuple_target is specified at CREATE TABLE, > but we would still have problem with ALTER TABLE, no? But there might be side > effects of changing the lower limit for pg_dump/pg_restore. So we would need > to think about that too.
I've attached a patch which increases the lower limit up to TOAST_TUPLE_TARGET. Unfortunately, reloptions don't have an assign_hook like GUCs do. Unless we add those we've no way to still accept lower values without an error. Does anyone think that's worth adding for this? Without it, it's possible that pg_restore / pg_upgrade could fail if someone happened to have toast_tuple_target set lower than 2032 bytes. I didn't bother capping RelationGetToastTupleTarget() to ensure it never returns less than TOAST_TUPLE_TARGET since the code that currently uses it can't trigger if it's lower than that value. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
toast_tuple_target_fix_david.patch
Description: Binary data