On Fri, Mar 6, 2015 at 12:42 AM, Robert Haas wrote:
> On Thu, Mar 5, 2015 at 9:58 AM, Alvaro Herrera wrote:
>> Here's a simple idea to improve the patch: make VacuumParams include
>> VacuumStmt and the for_wraparound and do_toast flags.  ISTM that reduces
>> the number of arguments to be passed down in a couple of places.  In
>> particular:
>> vacuum(VacuumParams *params, BufferAccessStrategy bstrategy, bool isTopLevel)
>> vacuum_rel(VacuumParams *params)
>> Does that sound more attractive?
> I dislike passing down parser nodes straight into utility commands.
> It tends to make those those functions hard for in-core users to call,
> and also to lead to security vulnerabilities where we look up the same
> names more than once and just hope that we get the same OID every
> time.  Stuffing the VacuumStmt pointer inside the VacuumParams object
> doesn't, for me, help anything.  It'd be a lot more interesting if we
> could get rid of that altogether.

Do you mean removing totally VacuumStmt from the stack? We would then
need to add relation and va_cols as additional arguments of things
like vacuum_rel, analyze_rel, do_analyze_rel or similar.

FWIW, adding do_toast and for_wraparound into VacuumParams makes sense
to me, but not VacuumStmt. It has little meaning as VacuumParams
should be used for parameters.

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to