Re: Strange assertion using VACOPT_FREEZE in vacuum.c

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Strange assertion using VACOPT_FREEZE in vacuum.c
Дата
Msg-id CA+Tgmob0B6VM4_rDCLhme=JQMhpi8Ay95OSg9SjYyvxnbJ0UoA@mail.gmail.com
обсуждение исходный текст
Ответ на Strange assertion using VACOPT_FREEZE in vacuum.c  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Strange assertion using VACOPT_FREEZE in vacuum.c
Список pgsql-hackers
On Thu, Feb 12, 2015 at 11:54 PM, Michael Paquier
<michael.paquier@gmail.com> wrote:
> Hi all,
>
> When calling vacuum(), there is the following assertion using VACOPT_FREEZE:
> Assert((vacstmt->options & VACOPT_VACUUM) ||
>     !(vacstmt->options & (VACOPT_FULL | VACOPT_FREEZE)));
> I think that this should be changed with sanity checks based on the
> parameter values of freeze_* in VacuumStmt as we do not set up
> VACOPT_FREEZE when VACUUM is used without options in parenthesis, for
> something like that:
>         Assert((vacstmt->options & VACOPT_VACUUM) ||
> -                  !(vacstmt->options & (VACOPT_FULL | VACOPT_FREEZE)));
> +                  ((vacstmt->options & VACOPT_FULL) == 0 &&
> +                       vacstmt->freeze_min_age < 0 &&
> +                       vacstmt->freeze_table_age < 0 &&
> +                       vacstmt->multixact_freeze_min_age < 0 &&
> +                       vacstmt->multixact_freeze_table_age < 0));
> This would also have the advantage to limit the use of VACOPT_FREEZE
> in the query parser.
> A patch is attached.
> Thoughts?

I think it's right the way it is.  The parser constructs a VacuumStmt
for either a VACUUM or an ANALYZE command.  That statement is checking
that if you are doing an ANALYZE, you can't specify FULL or FREEZE.
That makes sense, because there is no ANALYZE FULL or ANALYZE FREEZE
command.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: pg_basebackup -x/X doesn't play well with archive_mode & wal_keep_segments
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Add min and max execute statement time in pg_stat_statement