Subscription Dialog¶
Use the Subscription dialog to create a subscription. A subscription defines the connection to another database and set of publications (one or more) to which it wants to subscribe.
The subscription dialog organizes the development of a subscription through the following dialog tabs: General, Connection and With. The SQL tab displays the SQL code generated by dialog selections.
Use the fields in the General tab to identify the subscription:
Use the
Namefield to add a descriptive name for the subscription. The name will be displayed in the Browser tree control.The
Ownerfield takes the name of the user automatically as current connected user. You can change the owner after creating subscription using alter subscription. Please note that owner of the subscription has superuser privileges.
Click the Connection tab to continue.
Use the Connection tab to define the connection string to the publisher:
Use the
Host name/addressfield to provide the valid hostname or ip address of the publication.Use the
Portfield to provide port number to connect at Postgres Server in which publication is residing.Use the
Usernamefield to provide the name of the user to connect to the publication.Use the
Passwordto provide the password of the user.Use the
Databasefield to connect to the database in which publication is residing.Use the
Connection timeoutfield to specify the maximum wait for connection, in seconds. Zero or not specified means wait indefinetly. It is not recommended to use a timeout of less than 2 seconds.Use the
Passfilefield to specify the location of a password file (.pgpass). A .pgpass file allows a user to login without providing a password when they connect. For more information, see Section 33.15 of the Postgres documentation.Use the
Publicationfield to specify the publication name on the publishers to subscribe to. Click on the refresh button at the end to load the names of the existing publications and then select from the list. You can also write the name of the known publication in the field.
Click the SSL tab to continue.
Use the fields in the SSL tab to configure SSL:
Use the drop-down list box in the
SSLfield to select the type of SSL connection the server should use. For more information about using SSL encryption, see Section 33.18 of the Postgres documentation.
You can use the platform-specific File manager dialog to upload files that support SSL encryption to the server. To access the File manager dialog, click the icon that is located to the right of each of the following fields.
Use the
Client certificatefield to specify the file containing the client SSL certificate. This file will replace the default<STORAGE_DIR>/ <USERNAME>/.postgresql/postgresql.crt. This parameter is ignored if an SSL connection is not made.Use the
Client certificate keyfield to specify the file containing the secret key used for the client certificate. This file will replace the default<STORAGE_DIR>/<USERNAME>/.postgresql/postgresql.key. This parameter is ignored if an SSL connection is not made.Use the
Root certificatefield to specify the file containing the SSL certificate authority. This file will replace the default~/.postgresql/root.crt. This parameter is ignored if an SSL connection is not made.Use the
Certificate revocation listfield to specify the file containing the SSL certificate revocation list. This list will replace the default list, found in~/.postgresql/root.crl. This parameter is ignored if an SSL connection is not made.When
SSL compression?is set toTrue, data sent over SSL connections will be compressed. The default value isFalse(compression is disabled). This parameter is ignored if an SSL connection is not made.
Warning
The certificates, private keys, and the revocation list are stored in the per-user file storage area on the server, which is owned by the user account under which the PEM server process is run. This means that administrators of the server may be able to access those files; appropriate caution should be taken before choosing to use this feature.
Click the With tab to continue.
Use the With tab to define some parameters for a subscription:
The
Copy data?switch specifies whether the existing data in the publications that are being subscribed to should be copied once the replication starts. By default it is set to Yes.The
Create slot?switch specifies whether the command should create the replication slot on the publisher. By default it is set to Yes. Please note: if your publisher and subscriber both are inside same PostgreSQL server then is is set to No by default.The
Enabled?switch specifies whether the subscription should be actively replicating, or whether it should be just setup but not started yet. By default it is set to Yes.The
Connect?specifies whether the CREATE SUBSCRIPTION should connect to the publisher at all. By default, it is set to Yes. Setting this to No will change default values of enabled, create_slot and copy_data to No.Use the
Slot Namefield to specify the name of the replication slot to use. By default, it uses the name of the subscription for the slot name.Use the
Synchronous commitfield to override the synchronous_commit setting. By default, it is set to off. It is safe to use off for logical replication: If the subscriber loses transactions because of missing synchronization, the data will be sent again from the publisher.
Click the SQL tab to continue.
Your entries in the Subscription dialog generate a SQL command (see an example below). Use the SQL tab for review; revisit or switch tabs to make any changes to the SQL command.
Example
The following is an example of the sql command generated by user selections in
the Subscription dialog:
The example creates a subscription named pub1_sub1 that is owned by postgres. It will replicate the data from the publication pub1.
Click the
Infobutton (i) to access online help.Click the
Savebutton to save work.Click the
Cancelbutton to exit without saving work.Click the
Resetbutton to restore all the default settings.