# Utilities

> Changes to configure, initdb, backup, restore, upgrade, psql, and maintenance tools.

---

LLMS index: [llms.txt](/en/llms.txt)

---

<div class="feature-source-note"><span class="feature-edition-badge">GA</span><span><strong>Source pages:</strong> PDF 74-88</span><span><a href="https://github.com/nori-shinoda/documents/blob/1773200c5362476c4a549222b7d17fa91f546cae/postgresql16_ga_new_features_en_20230919-1.pdf">Original PDF on GitHub</a></span></div>

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-74">PDF page 74</p>

Describes the major enhancements of utility commands.

#### 3.4.1 Configure {#pg16-3-4-1-configure}

The configure command has the following options changed. [9db49fc, [d3b111e](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d3b111e3205b6e681e16b4f8e6ed01f67142ce7b), [fcb21b3](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=fcb21b3acdcb9a60313325618fd7080aa36f1626)]

**Table 28.** Add\/Remove options

| Option name | Modify | Description |
| --- | --- | --- |
| --with-gnu-ld | Remove | Assume the C compiler uses GNU ld |
| --with-segsize-blocks | Add | Set table segment size in blocks |
| --with-icu | Remove | Build with ICU support |
| --without-icu | Add | Build without ICU support |

#### 3.4.2 Createuser {#pg16-3-4-2-createuser}

Multiple options have been added to the createuser command. The --role option can still be used, but it is deprecated. [[08951a7](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=08951a7c93cf0dd791ee6ac8a8cf5e4b152528e5), [2dcd157](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2dcd1578c40153250836df62f625863056c28a81), [381d19b](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=381d19b3ea0e7593d30a3af8df20d92bbccb775f)]

**Table 29.** Add\/Modify options

| Option name | Short option | Description |
| --- | --- | --- |
| --with-admin=ROLE | -a | ROLE will be a member of new role with admin option |
| --with-member=ROLE | -m | ROLE will be a member of new role |
| --valid-until=TIMESTAMP | -v | Password expiration |
| --bypassrls | - | Add Bypass RLS attribute |
| --no-bypassrls | - | Do not assign Bypass RLS attribute |
| --member-of=ROLE | -g | new role will be a member of ROLE (modified from --role option) |

**Example 84.** Execute the createuser command

```sql
$ createuser --member=role1 user1 --echo
SELECT pg_catalog.set_config('search_path', '', false);
CREATE
ROLE
user1 NOSUPERUSER NOCREATEDB
NOCREATEROLE INHERIT
LOGIN
NOREPLICATION NOBYPASSRLS IN ROLE role1;
```

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-75">PDF page 75</p>

#### 3.4.3 Initdb {#pg16-3-4-3-initdb}

The following enhancements have been implemented to the initdb command: [[27b6237](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=27b62377b47f9e7bf58613608bc718c86ea91e91), [30a53b7](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=30a53b792959b36f07200dae246067b3adbcc0b9), [3e51b27](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=3e51b278db6a4e2f50f3f6b9edc9667af1f934fd), [af3abca](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=af3abca029b39ae6bdb683a758b11375e9839631)]

##### --icu-rules option {#pg16-p75-icu-rules-option}

The --icu-rules option has been added to add a custom rule to the ICU locale.

**Example 85.** Execute initdb command with the \-\-icu\-rules option

```bash
$ initdb --icu-local=en_US --locale-provider=icu --icu-rules='&a < g' data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
Using language tag "en-US" for ICU locale "en_US".
The database cluster will be initialized with this locale configuration:
  provider:    icu
  ICU locale:  en_US
  LC_COLLATE:  en_US.UTF-8
...
```

##### --set option {#pg16-p75-set-option}

The --set option (shorthand option is -c) specifies the initial values of the parameters described in the postgresql.conf file. This option can be specified multiple times.

**Example 86.** initdb command with the \-\-set option

```bash
$ initdb --set port=5433 --set listen_addresses='*' --locale-provider=libc --
no-locale --encoding=utf8 data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "C".
The default text search configuration will be set to "english".
Data page checksums are disabled.
…
```

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-76">PDF page 76</p>

##### Check locale command {#pg16-p76-check-locale-command}

The initdb command now exits successfully even if the 'locale' command does not exist. In previous versions, the initdb command would fail if the locale -a command failed.

#### 3.4.4 Pgindent {#pg16-3-4-4-pgindent}

The following options have been added/extended to the pgindent command. [[b90f0b5](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b90f0b57474eac3980be8146f2e45f73a05c994f), [a1c4cd6](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a1c4cd6f2c8857fbb78d043a0b3c7d397e48ef2e), [068a243](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=068a243b7771890052a32c577a44c48facd34884), [b16259b](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b16259b3c1897cf90855a94e5cb126d6c75e3cf3)]

**Table 30.** Add\/change options

| Option name | Change | Description |
| --- | --- | --- |
| --build | Remove | Building the pg_bsd_indent command |
| --code-base | Remove | Specifying base directory for source code |
| --commit=gitref | Add | Target files changed in the specified commit |
| --excludes=PATH | Change | Can be specified multiple times |
| --help | Add | Output usage |
| --show-diff | Add | View changes |
| --silent-diff | Add | Exit with return value 2 if there are any changes |

#### 3.4.5 Pg_basebackup {#pg16-3-4-5-pg-basebackup}

It is now possible to specify 'long' for the level of the Zstandard compression method. This option improves the compression ratio for large data, but increases resource usage. [[2820adf](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2820adf7755d2a377546d5b55f5b1a4a39889336)]

**Example 87.** Specifying the compression level to \&\#x27\;long\&\#x27\;

```bash
$ pg_basebackup -D data.zstd --compress=zstd:long --format=tar
$ file data.zstd/*
data.zstd/backup_manifest: ASCII text
data.zstd/base.tar.zst:    Zstandard compressed data (v0.8+), Dictionary ID:
None
data.zstd/pg_wal.tar:      POSIX tar archive
```

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-77">PDF page 77</p>

#### 3.4.6 Pg_bsd_indent {#pg16-3-4-6-pg-bsd-indent}

The BSD-style indentation tool the pg_bsd_indent command, developed in a separate project, has been incorporated into the core repository. [[4e831f4](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4e831f4cee140b004fae44d528d47c284d8ac9eb)]

**Example 88.** Execute the pg\_bsd\_indent command

```bash
$ pg_bsd_indent -v indent.c
There were 1273 output lines and 223 comments
(Lines with comments)/(Lines with code):  0.548
```

#### 3.4.7 Pg_dump {#pg16-3-4-7-pg-dump}

The following enhancements have been implemented in the pg_dump command. [[5e73a60](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=5e73a6048849bd7bda4947e39570b9011734114d), [0da243f](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=0da243fed0875932f781aff08df782b56af58d02), [84adc8e](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=84adc8e20f54e93a003cd316fa1eb9b03e393288), [2820adf](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2820adf7755d2a377546d5b55f5b1a4a39889336), [35ce24c](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=35ce24c333cf6dee3c92bc5f67553c7720bd9988), [2f80c95](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=2f80c95740f88e9e3e04ee0c2063e55a497315b4), [a563c24](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a563c24c9574b74f4883c004c89275bba03c3c26), [5f53b42](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=5f53b42cfd053a724fcbe0712a9d5716e576a3e6)]

##### --compress option {#pg16-p77-compress-option}

The --compress option now accepts a compression method and compression level separated by a colon (:). The compression method can be none, gzip, lz4 or zstd. The value that can be specified for compression level differs depending on the compression method.

**Table 31.** Compression level range

| Compression Method | Default level | Level Range | Note |
| --- | --- | --- | --- |
| none | - | - |  |
| gzip | -1 | 1～9 |  |
| lz4 | 0 | 1～12 |  |
| zstd | 3 | -131072～22, long |  |

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-78">PDF page 78</p>

**Example 89.** Execute the pg\_dump command

```bash
$ pg_dump --compress=gzip:9 --file=postgres.gz postgres
$ file postgres.gz
postgres.gz: gzip compressed data, max compression, from Unix, original size
11963
$ pg_dump --compress=lz4:12 --file=postgres.lz4 postgres
$ file postgres.lz4
postgres.lz4: LZ4 compressed data (v1.4+)
$ pg_dump --compress=zstd:22 --file=postgres.zstd postgres
$ file postgres.zstd
postgres.zstd: Zstandard compressed data (v0.8+), Dictionary ID: None
```

##### --large-objects option {#pg16-p78-large-objects-option}

The --blob and --no-blob options from previous versions have been changed to --large-objects and - -no-large-objects. Legacy options are still available, but are deprecated.

**Example 90.** Help message of the pg\_dump command

```bash
$ pg_dump --help
pg_dump dumps a database as a text file or to other formats.
…
Options controlling the output content:
  -a, --data-only              dump only the data, not the schema
  -b, --large-objects          include large objects in dump
  --blobs                      (same as --large-objects, deprecated)
  -B, --no-large-objects       exclude large objects in dump
  --no-blobs                   (same as --no-large-objects, deprecated)
  -c, --clean                  (drop) database objects before recreating
…
```

##### --table-and-children option {#pg16-p78-table-and-children-option}

Basically, the same as the --table option. Includes tables matching the pattern and their child tables and partitions.

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-79">PDF page 79</p>

##### --exclude-table-and-children option {#pg16-p79-exclude-table-and-children-option}

Basically, the same as the --exclude-table option. Exclude tables matching the pattern and their child tables and partitions.

##### --exclude-table-data-and-children option {#pg16-p79-exclude-table-data-and-children-option}

Basically, the same as the --exclude-table-data option. Exclude data from tables matching the pattern and their child tables and partitions.

##### Lock acquisition {#pg16-p79-lock-acquisition}

The pg_dump command executes a LOCK TABLE statement on the target table at startup. In PostgreSQL 16, multiple table names are described for one LOCK TABLE to reduce the amount of communication between the client and server.

#### 3.4.8 Pg_receivewal / Pg_recvlogical {#pg16-3-4-8-pg-receivewal-pg-recvlogical}

The SIGTERM signal has been added as a program exit condition in addition to the existing SIGINT signal. This change corresponds to the default value of the systemd exit signal (KillSignal). [[8b60db7](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=8b60db774356117fab2eb53fb37160fa3e173cdb)]

#### 3.4.9 Pg_upgrade {#pg16-3-4-9-pg-upgrade}

Add the --copy option to the pg_upgrade command. This is the default behavior. Copies locale and encoding information from source to destination. [[746915c](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=746915c6866953506379e996ce5198bc9e9e5b94), [9637bad](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9637badd9f9209166140eb567602e91699dd2ffb)]

#### 3.4.10 Pg_verifybackup {#pg16-3-4-10-pg-verifybackup}

Add the --progress option (shortened option -P). Report progress. [[d07c294](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d07c2948bfe577cfeaa4eb564c5e62bcb6cb1955)]

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-80">PDF page 80</p>

**Example 91.** Execute the pg\_verifybackup command

```bash
$ pg_basebackup -D back.1 -v
pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 0/5E000028 on timeline 1
pg_basebackup: starting background WAL receiver
pg_basebackup: created temporary replication slot "pg_basebackup_120380"
pg_basebackup: write-ahead log end point: 0/5E0001B0
pg_basebackup: waiting for background process to finish streaming ...
pg_basebackup: syncing data to disk ...
pg_basebackup: renaming backup_manifest.tmp to backup_manifest
pg_basebackup: base backup completed
$ pg_verifybackup back.1 --progress
887802/887802 kB (100%) verified
backup successfully verified
```

#### 3.4.11 Pg_waldump {#pg16-3-4-11-pg-waldump}

The following new features have been added to the pg_waldump command. [[d497093](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d497093cbecccf6df26365e06a5f8f8614b591c8), [4c8044c](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4c8044c04455fe87dadefa4f7c69bfe6cdbe3cc5) , [b381d96](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b381d9637030c163c3b1f8a9d3de51dfc1b4ee58)]

##### --save-fullpage option {#pg16-p80-save-fullpage-option}

Add the --save-fullpage option to specify the directory to save full page images. The specified directory must be empty. A full-page image is created with the following file name:

```text
<timeline>-<lsn>.<tablespace>.<database>.<relation>.<block>_<forkname>
```

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-81">PDF page 81</p>

**Table 32.** File name explanation

| Notation | Description | Example |
| --- | --- | --- |
| <timeline> | Timeline hexadecimal format | 00000000 |
| <lsn> | LSN hexadecimal format | 05AD6E48 |
| <tablespace> | OID of the tablespace | 1663 |
| <database> | OID of the database | 5 |
| <relation> | Relation filenode | 16388 |
| <block> | Block number | 20 |
| <forkname> | Fork name | main |

**Example 92.** Execute the pg\_waldump command with the \-\-save\-fullpage option

```bash
$ pg_waldump --save-fullpage=$HOME/fullpage
data/pg_wal/000000010000000000000004
rmgr: Heap        len (rec/tot):     65/    65, tx:        740, lsn: …
rmgr: Heap        len (rec/tot):     65/    65, tx:        740, lsn: …
…
$ ls -1 $HOME/fullpage
00000000-00000000-05A26608.1663.5.16388.0_vm
00000000-00000000-05A7D2E8.1663.5.2619.18_main
00000000-00000000-05A7E920.1663.5.2696.1_main
```

##### --timeline option {#pg16-p81-timeline-option}

The --timeline option now accepts hexadecimal strings.

**Example 93.** Execute the pg\_waldump command with the \-\-timeline option

```bash
$ pg_waldump 000000010000000000000001  --timeline=0xA
rmgr: XLOG        len (rec/tot):    114/   114, tx:          0, lsn:
0/01000028, prev 0/00000000, desc: CHECKPOINT_SHUTDOWN redo 0/1000028; tli 1;
pr
ev tli 1; fpw true; xid 0:3; oid 10000; multi 1; offset 0; oldest xid 3 in DB
1; oldest multi 1 in DB 1; oldest/newest commit timestamp xid: 0/0; old
est running xid 0; shutdown
…
```

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-82">PDF page 82</p>

#### 3.4.12 Psql {#pg16-3-4-12-psql}

The following enhancements have been implemented to the psql command: [[b0d8f2d](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b0d8f2d983cb25d1035fae1cd7de214dd67809b4), [31ae2aa](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=31ae2aa9d2c200a0d7d3283d749669a408ec7b65), [bd95816](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=bd95816f74ad4cad3d2a3c160be426358d6cea51), [5b66de3](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=5b66de3433e2110b38a2b32aaaa0b9cdac8aacdb), [a45388d](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=a45388d6e0984abb02074f0300cd9c5cbda13848), [d913928](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d913928c9c5e905d0062d1e7237b7fb5fbde61ed), [6f9ee74](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=6f9ee74d45aa7c1836b6c12b6e2a958327c16ab5), [31ae2aa](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=31ae2aa9d2c200a0d7d3283d749669a408ec7b65)]

##### Command execution status {#pg16-p82-command-execution-status}

The execution status of \!, \g, \o, \w, and \copy metacommands can now be obtained with the following variables.

**Table 33.** Command execution status

| Variable name | Description |
| --- | --- |
| SHELL_ERROR | 'true' if command execution result is 0, 'false' if not 0 |
| SHELL_EXIT_CODE Command exit code | Commandexitcode |

**Example 94.** Check command execution status

```text
postgres=> \! ls postgresql.conf
postgresql.conf
postgres=> \echo :SHELL_ERROR
false
postgres=> \echo :SHELL_EXIT_CODE
0
postgres=> \! ls postgresql.conf.bad
ls: cannot access 'postgresql.conf.bad': No such file or directory
postgres=> \echo :SHELL_ERROR
true
postgres=> \echo :SHELL_EXIT_CODE
2
```

##### \d+ metacommand {#pg16-p82-d-metacommand}

Executing the \d+ meta command on a partitioned table will output "FOREIGN" if the partition is an external table.

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-83">PDF page 83</p>

**Example 95.** External table partition information

```text
postgres=> CREATE FOREIGN TABLE remote1(c1 INT, c2 VARCHAR(10)) SERVER remsvr1 ;
CREATE FOREIGN TABLE
postgres=> CREATE TABLE part1(c1 INT, c2 VARCHAR(10)) PARTITION BY RANGE(c1) ;
CREATE TABLE
postgres=> ALTER TABLE part1 ATTACH PARTITION remote1 FOR VALUES FROM (0) TO
(100) ;
ALTER TABLE
postgres=> \d+ part1
                                           Partitioned table "public.part1"
 Column |         Type          | Collation | Nullable | Default | Storage …
--------+-----------------------+-----------+----------+---------+-------- …
c1     | integer               |           |          |         | plain   …
 c2     | character varying(10) |           |          |         | extended…
Partition key: RANGE (c1)
Partitions: remote1 FOR VALUES FROM (0) TO (100), FOREIGN
```

##### \bind metacommand {#pg16-p83-bind-metacommand}

Add \bind metacommand to set values for bind variables in SQL statements. A semicolon (;) is not considered a line terminator, so specify something like \g.

**Example 96.** Binding variable settings

```text
postgres=> SELECT $1, $2
postgres-> \bind 'value1' 'value2' \g
 ?column? | ?column?
----------+----------
 value1   | value2
(1 row)
postgres=> SELECT * FROM data1 WHERE c1=$1 \bind 100 \g
 c1  |  c2
-----+-------
 100 | data1
(1 row)
```

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-84">PDF page 84</p>

##### \pset metacommand {#pg16-p84-pset-metacommand}

Add the xheader_width option to \pset metacommand. This option can limit the width of the header when outputting in extended table format. The values that can be specified are as follows.

**Table 34.** Possible values

| Value | Description | Note |
| --- | --- | --- |
| full | Widest line length (default) |  |
| column | Truncate to Width of First Column |  |
| page | Truncate to Terminal Page Width |  |
| Numerical value | Truncate to Specified Number |  |

**Example 97.** Specifying the xheader\_width option

```text
postgres=> \x
Expanded display is on.
postgres=> CREATE TABLE data1(c1 char(10), c2 char(20)) ;
CREATE TABLE
postgres=> INSERT INTO data1 VALUES ('1234567890', '12345678901234567890') ;
INSERT 0 1
postgres=> \pset xheader_width
Expanded header width is 'full'.
postgres=> SELECT * FROM data1 ;
-[ RECORD 1 ]------------
c1 | 1234567890
c2 | 12345678901234567890
postgres=> \pset xheader_width column
Expanded header width is 'column'.
postgres=> SELECT * FROM data1 ;
-[ RECORD 1 ]
c1 | 1234567890
c2 | 12345678901234567890
```

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-85">PDF page 85</p>

##### \dpS metacommand {#pg16-p85-dps-metacommand}

'S' can now be specified for \dp meta-command and \z meta-command. Along with this, the operation of the \dp or \z command has been changed from the previous version. Temporary objects were included in the list, and objects in the information_schema schema were excluded.

##### \watch metacommand {#pg16-p85-watch-metacommand}

Add validation of entered values. Any non-numeric or negative value will result in an error. Specify zero (0) to rerun without an interval. Also, the number of reruns can now be specified. To limit the number of re-executions, specify the interval and the number of executions in the "i=interval c=number of times of execution" format.

**Example 98.** \\watch metacommand with rerun count

```text
postgres=> SELECT current_time ;
    current_time
--------------------
16:58:33.012005+09
(1 row)
postgres=> \watch i=1 c=2
Sat 16 Sep 2023 04:58:34 PM JST (every 1s)
    current_time
--------------------
16:58:34.850061+09
(1 row)
Sat 16 Sep 2023 04:58:35 PM JST (every 1s)
    current_time
--------------------
 16:58:35.850556+09
(1 row)
```

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-86">PDF page 86</p>

##### \drg metacommand {#pg16-p86-drg-metacommand}

Added \drg meta command to output role grant information. [[d65ddac](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=d65ddaca93f6f31e76b15bc1001f5cabb6a46c9d)]

**Example 99.** \\drg metacommand

```text
postgres=# GRANT pg_checkpoint TO demo1 WITH INHERIT FALSE ;
GRANT ROLE
postgres=# GRANT pg_checkpoint TO demo2 WITH SET FALSE ;
GRANT ROLE
postgres=# \drg
              List of role grants
 Role name |   Member of   | Options | Grantor
-----------+---------------+---------+----------
 demo1     | pg_checkpoint | SET     | postgres
 demo2     | pg_checkpoint | INHERIT | postgres
(2 rows)
```

#### 3.4.13 Vacuumdb {#pg16-3-4-13-vacuumdb}

The following options have been added to the vacuumdb command. [[7781f4e](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=7781f4e3e711ace6bcf9b6253a104b180cb78fcf), [4211fbd](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=4211fbd8413b26e0abedbe4338aa7cda2cd469b4), [ae78cae](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=ae78cae3be627213528f2e08eb976d6906d754de)]

##### --schema option {#pg16-p86-schema-option}

Specify the name of the schema to which the table to be VACUUMed belongs. The shorthand option is -n. This option can be specified multiple times. This option cannot be used with the --excludeschema option.

##### --exclude-schema option {#pg16-p86-exclude-schema-option}

Specify the name of the schema to which the table that does not execute VACUUM belongs. The shorthand option is -N. This option cannot be used at the same time as the --schema option.

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-87">PDF page 87</p>

**Example 100.** vacuumdb command with specifying schema

```sql
$ vacuumdb -d postgres --schema=public
vacuumdb: vacuuming database "postgres"
$ vacuumdb -d postgres --exclude-schema=public
vacuumdb: vacuuming database "postgres"
$ vacuumdb -d postgres --schema=public --exclude-schema=public
vacuumdb: error: cannot vacuum all tables in schema(s) and exclude schema(s) at
the same time
```

##### --no-process-main option {#pg16-p87-no-process-main-option}

Added the option --no-process-main for the VACUUM (PROCESS_MAIN FALSE) statement.

**Example 101.** With the \-\-no\-process\-main option

```sql
$ vacuumdb --no-process-main --echo postgres
SELECT pg_catalog.set_config('search_path', '', false);
vacuumdb: vacuuming database "postgres"
RESET search_path;
SELECT c.relname, ns.nspname FROM pg_catalog.pg_class c
 JOIN pg_catalog.pg_namespace ns ON c.relnamespace OPERATOR(pg_catalog.=)
ns.oid
 LEFT JOIN pg_catalog.pg_class t ON c.reltoastrelid OPERATOR(pg_catalog.=) t.oid
 WHERE c.relkind OPERATOR(pg_catalog.=) ANY (array['r', 'm'])
 ORDER BY c.relpages DESC;
SELECT pg_catalog.set_config('search_path', '', false);
VACUUM (PROCESS_MAIN FALSE, SKIP_DATABASE_STATS) pg_catalog.pg_proc;
…
```

##### --buffer-usage-limit option {#pg16-p87-buffer-usage-limit-option}

Add the --buffer-usage-limit option for VACUUM (BUFFER_USAGE_LIMIT) statement.

<p class="feature-page-marker" id="pgfeat-16-utilities-pdf-page-88">PDF page 88</p>

**Example 102.** The vacuumdb command with \-\-buffer\-usage\-limit option

```sql
$ vacuumdb --buffer-usage-limit=1MB --echo postgres
SELECT pg_catalog.set_config('search_path', '', false);
vacuumdb: vacuuming database "postgres"
…
SELECT pg_catalog.set_config('search_path', '', false);
VACUUM (SKIP_DATABASE_STATS, BUFFER_USAGE_LIMIT '1MB') public.t1;
…
```
