Re: Strange assertion using VACOPT_FREEZE in vacuum.c - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Strange assertion using VACOPT_FREEZE in vacuum.c
Date
Msg-id CAB7nPqQo7=_c4RxfECCihNSgh5Kkx3nM-NepTA+YaQdsOKGm+A@mail.gmail.com
Whole thread Raw
In response to Re: Strange assertion using VACOPT_FREEZE in vacuum.c  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
On Fri, Feb 20, 2015 at 5:41 AM, Peter Eisentraut wrote:
> That's cool if you want to add those assertions, but please make them
> separate statements each, like
>
> Assert(vacstmt->options & (VACOPT_FULL | VACOPT_FREEZE) || vacstmt->freeze_min_age == -1);
> Assert(vacstmt->options & (VACOPT_FULL | VACOPT_FREEZE) || vacstmt->freeze_table_age == -1);
> ...
>
> Besides being more readable, this will give you more useful output if
> the assertion fails.

It makes sense. When a manual VACUUM FREEZE without options specified
without parenthesis, VACOPT_FREEZE is not used in gram.y, so ISTM that
we should change them to that instead:
Assert((vacstmt->options & VACOPT_VACUUM) ||
vacstmt->multixact_freeze_table_age == -1);
At least this would check that an ANALYZE does not set those
parameters inappropriately...
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: pg_check_dir comments and implementation mismatch
Next
From: Pavel Stehule
Date:
Subject: Re: POLA violation with \c service=