bug fix and documentation improvement about vacuumdb

Поиск
Список
Период
Сортировка
От Kuwamura Masaki
Тема bug fix and documentation improvement about vacuumdb
Дата
Msg-id CAMyC8qp9mXPQd5D6s6CJxvmignsbTqGZwDDB6VYJOn1A8WG38w@mail.gmail.com
обсуждение исходный текст
Ответы Re: bug fix and documentation improvement about vacuumdb
Список pgsql-hackers
Hi there,

I have 1 trivial fix, 1 bug fix, and 1 suggestion about vacuumdb.

First, I noticed that the help message of `vacuumdb` is a bit incorrect.

`vacuumdb -?` displays the following message
```
...
  -n, --schema=PATTERN            vacuum tables in the specified schema(s) only
  -N, --exclude-schema=PATTERN    do not vacuum tables in the specified schema(s)

...
```
PATTERN should be changed to SCHEMA because -n and -N options don't support
pattern matching for schema names. The attached patch 0001 fixes this.

Second, when we use multiple -N options, vacuumdb runs incorrectly as shown below.
```
$ psql
=# CREATE SCHEMA s1;
=# CREATE SCHEMA s2;
=# CREATE SCHEMA s3;
=# CREATE TABLE s1.t(i int);
=# CREATE TABLE s2.t(i int);
=# CREATE TABLE s3.t(i int);
=# ALTER SYSTEM SET log_statement TO 'all';
=# SELECT pg_reload_conf();
=# \q
$ vacuumdb -N s1 -N s2
```
We expect that tables in schemas s1 and s2 should not be vacuumed, while the
others should be. However, logfile says like this.
```
LOG:  statement: VACUUM (SKIP_DATABASE_STATS) pg_catalog.pg_proc;
LOG:  statement: VACUUM (SKIP_DATABASE_STATS) pg_catalog.pg_proc;

...

LOG:  statement: VACUUM (SKIP_DATABASE_STATS) s2.t;
LOG:  statement: VACUUM (SKIP_DATABASE_STATS) s1.t;
LOG:  statement: VACUUM (ONLY_DATABASE_STATS);
```
Even specified by -N, s1.t and s2.t are vacuumed, and also the others are vacuumed
twice. The attached patch 0002 fixes this.

Third, for the description of the -N option, I wonder if "vacuum all tables except
in the specified schema(s)" might be clearer. The current one says nothing about
tables not in the specified schema.

Thoughts?

Masaki Kuwamura
Вложения

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

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Reducing memory consumed by RestrictInfo list translations in partitionwise join planning
Следующее
От: Jim Jones
Дата:
Сообщение: Re: [PATCH] Add inline comments to the pg_hba_file_rules view