Movatterモバイル変換


[0]ホーム

URL:



Facebook
Postgres Pro
Facebook
Downloads

pg_recvlogical

Name

pg_recvlogical -- controlPostgreSQL logical decoding streams

Synopsis

pg_recvlogical [option...]

Description

pg_recvlogical controls logical decoding replication slots and streams data from such replication slots.

It creates a replication-mode connection, so it is subject to the same constraints aspg_receivexlog, plus those for logical replication (seeChapter 46).

Options

At least one of the following options must be specified to select an action:

--create-slot

Create a new logical replication slot with the name specified by--slot, using the output plugin specified by--plugin, for the database specified by--dbname.

--drop-slot

Drop the replication slot with the name specified by--slot, then exit.

--start

Begin streaming changes from the logical replication slot specified by--slot, continuing until terminated by a signal. If the server side change stream ends with a server shutdown or disconnect, retry in a loop unless--no-loop is specified.

The stream format is determined by the output plugin specified when the slot was created.

The connection must be to the same database used to create the slot.

--create-slot and--start can be specified together.--drop-slot cannot be combined with another action.

The following command-line options control the location and format of the output and other replication behavior:

-ffilename
--file=filename

Write received and decoded transaction data into this file. Use- for stdout.

-Finterval_seconds
--fsync-interval=interval_seconds

Specifies how oftenpg_recvlogical should issuefsync() calls to ensure the output file is safely flushed to disk.

The server will occasionally request the client to perform a flush and report the flush position to the server. This setting is in addition to that, to perform flushes more frequently.

Specifying an interval of0 disables issuingfsync() calls altogether, while still reporting progress to the server. In this case, data could be lost in the event of a crash.

-Ilsn
--startpos=lsn

In--start mode, start replication from the given LSN. For details on the effect of this, see the documentation inChapter 46 andSection 49.3. Ignored in other modes.

-n
--no-loop

When the connection to the server is lost, do not retry in a loop, just exit.

-oname[=value]
--option=name[=value]

Pass the optionname to the output plugin with, if specified, the option valuevalue. Which options exist and their effects depends on the used output plugin.

-Pplugin
--plugin=plugin

When creating a slot, use the specified logical decoding output plugin. SeeChapter 46. This option has no effect if the slot already exists.

-sinterval_seconds
--status-interval=interval_seconds

This option has the same effect as the option of the same name inpg_receivexlog. See the description there.

-Sslot_name
--slot=slot_name

In--start mode, use the existing logical replication slot namedslot_name. In--create-slot mode, create the slot with this name. In--drop-slot mode, delete the slot with this name.

-v
--verbose

Enables verbose mode.

The following command-line options control the database connection parameters.

-ddatabase
--dbname=database

The database to connect to. See the description of the actions for what this means in detail. This can be a libpq connection string; seeSection 31.1.1 for more information. Defaults to user name.

-hhostname-or-ip
--host=hostname-or-ip

Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for the Unix domain socket. The default is taken from thePGHOST environment variable, if set, else a Unix domain socket connection is attempted.

-pport
--port=port

Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. Defaults to thePGPORT environment variable, if set, or a compiled-in default.

-Uuser
--username=user

Username to connect as. Defaults to current operating system user name.

-w
--no-password

Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a.pgpass file, the connection attempt will fail. This option can be useful in batch jobs and scripts where no user is present to enter a password.

-W
--password

Forcepg_recvlogical to prompt for a password before connecting to a database.

This option is never essential, sincepg_recvlogical will automatically prompt for a password if the server demands password authentication. However,pg_recvlogical will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing-W to avoid the extra connection attempt.

The following additional options are available:

-V
--version

Print thepg_recvlogical version and exit.

-?
--help

Show help aboutpg_recvlogical command line arguments, and exit.

Environment

This utility, like most otherPostgreSQL utilities, uses the environment variables supported bylibpq (seeSection 31.14).

Examples

SeeSection 46.1 for an example.


PrevHomeNext
pg_receivexlogUppg_restore
Go to PostgreSQL 9.4
By continuing to browse this website, you agree to the use of cookies. Go toPrivacy Policy.

[8]ページ先頭

©2009-2025 Movatter.jp