On July 27, 2021 1:14 PM Amit Kapila <amit.kapil...@gmail.com> > On Mon, Jul 26, 2021 at 8:33 PM Robert Haas <robertmh...@gmail.com> > wrote: > > > > On Sat, Jul 24, 2021 at 5:52 AM Amit Kapila <amit.kapil...@gmail.com> > wrote: > > > I think for the consistency argument how about allowing users to > > > specify a parallel-safety option for both partitioned and > > > non-partitioned relations but for non-partitioned relations if users > > > didn't specify, it would be computed automatically? If the user has > > > specified parallel-safety option for non-partitioned relation then we > > > would consider that instead of computing the value by ourselves. > > > > Having the option for both partitioned and non-partitioned tables > > doesn't seem like the worst idea ever, but I am also not entirely sure > > that I understand the point. > > > > Consider below ways to allow the user to specify the parallel-safety option: > > (a) > CREATE TABLE table_name (...) PARALLEL DML { UNSAFE | RESTRICTED | SAFE } ... > ALTER TABLE table_name PARALLEL DML { UNSAFE | RESTRICTED | SAFE } .. > > OR > > (b) > CREATE TABLE table_name (...) WITH (parallel_dml_enabled = true) > ALTER TABLE table_name (...) WITH (parallel_dml_enabled = true)
Personally, I think the approach (a) might be better. Since it's similar to ALTER FUNCTION PARALLEL XXX which user might be more familiar with. Besides, I think we need a new default value about parallel dml safety. Maybe 'auto' or 'null'(different from safe/restricted/unsafe). Because, user is likely to alter the safety to the default value to get the automatic safety check, a independent default value can make it more clear. Best regards, Houzj