Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Link Parameters

Updated on 2023-10-23 GMT+08:00
Table 1 Link parameters

Parameter

Description

host

Name of the host to connect to. If the host name starts with a slash (/), Unix-domain socket communications instead of TCP/IP communications are used. The value is the directory where the socket file is stored. If host is not specified, the default behavior is to connect to the Unix-domain socket in the /tmp directory (or the socket directory specified during GaussDB installation). On a machine without a Unix-domain socket, the default behavior is to connect to localhost.

hostaddr

IP address of the host to connect to. The value is in standard IPv4 address format, for example, 172.28.40.9. If a non-null character string is specified, TCP/IP communications are used.

Replacing host with hostaddr can prevent applications from querying host names, which may be important for applications with time constraints. However, a host name is required for GSSAPI or SSPI authentication methods. Therefore, the following rules are used:

  1. If host is specified but hostaddr is not, a query for the host name will be executed.
  2. If hostaddr is specified but host is not, the value of hostaddr is the server network address. If the host name is required by authentication, the connection attempt fails.
  3. If both host and hostaddr are specified, the value of hostaddr is the server network address. The value of host is ignored unless it is required by authentication, in which case it is used as the host name.
    NOTICE:
    • If host is not the server name in the network address specified by hostaddr, the authentication may fail.
    • If neither host nor hostaddr is specified, libpq will use a local Unix-domain socket for connection. If the machine does not have a Unix-domain socket, it will attempt to connect to localhost.

port

Port number of the host server, or the socket file name extension for Unix-domain connections.

user

Name of the user to connect as. By default, the username is the same as the operating system name of the user running the application.

dbname

Database name. The default value is the same as the username.

password

Password to be used if the server requires password authentication.

connect_timeout

Maximum timeout period of the connection, in seconds (in decimal integer string). The value 0 or null indicates infinity. You are not advised to set the connection timeout period to a value less than 2 seconds.

client_encoding

Client encoding for the connection. In addition to the values accepted by the corresponding server options, you can use auto to determine the correct encoding from the current environment in the client (the LC_CTYPE environment variable in the Unix system).

tty

This parameter can be ignored. (This parameter was used to specify the location to which the debugging output of the server was sent).

options

Adds command-line options to send to the server at runtime.

application_name

Current user identity.

fallback_application_name

Specifies a backup value for the application_name parameter. This value is used if no value is set for application_name through a connection parameter or the PGAPPNAME environment variable. It is useful to specify a backup value in a common tool program that wants to set a default application name but does not want it to be overwritten by the user.

keepalives

Whether TCP keepalive is enabled on the client side. The default value is 1, indicating that the function is enabled. The value 0 indicates that the function is disabled. Ignore this parameter for Unix-domain connections.

keepalives_idle

The number of seconds of inactivity after which TCP should send a keepalive message to the server. The value 0 indicates that the default value is used. Ignore this parameter for Unix-domain connections or if keep-alive is disabled.

keepalives_interval

The number of seconds after which a TCP keepalive message that is not acknowledged by the server should be retransmitted. The value 0 indicates that the default value is used. Ignore this parameter for Unix-domain connections or if keep-alive is disabled.

keepalives_count

Controls the number of times that keepalive messages are sent through TCP. The value 0 indicates that the default value is used. Ignore this parameter for Unix-domain connections or if keep-alive is disabled.

tcp_user_timeout

Specifies the maximum duration for which transmitted data can remain unacknowledged before the TCP connection is forcibly closed on an operating system that supports the TCP_USER_TIMEOUT socket option. The value 0 indicates that the default value is used. Ignore this parameter for Unix-domain connections.

rw_timeout

Sets the read and write timeout interval of the client connection.

sslmode

SSL encryption mode:

  • disable: SSL connection is not enabled.
  • allow: If the database server requires SSL connection, SSL connection can be enabled. However, authenticity of the database server will not be verified.
  • prefer: If the database supports SSL connection, SSL connection is preferred. However, authenticity of the database server will not be verified.
  • require: SSL connection is required and data is encrypted. However, authenticity of the database server will not be verified.
  • verify-ca: SSL connection is required. Currently, Windows ODBC does not support cert authentication.
  • verify-full: SSL connection is required. Currently, Windows ODBC does not support cert authentication.

sslcompression

If this parameter is set to 1 (default value), the data transmitted over the SSL connection is compressed (this requires that the OpenSSL version be 0.9.8 or later). If set to 0, compression will be disabled (this requires OpenSSL 1.0.0 or later). If a connection without SSL is established, this parameter is ignored. If the OpenSSL version in use does not support this parameter, it will also be ignored. Compression takes up CPU time, but it increases throughput when the bottleneck is the network. If CPU performance is a limiting factor, disabling compression can improve response time and throughput.

sslcert

This parameter specifies the file name of the client SSL certificate. It replaces the default ~/.postgresql/postgresql.crt. If no SSL connection is established, this parameter is ignored.

sslkey

This parameter specifies the location of the key used for the client certificate. It can specify the name of a file used to replace the default ~/.postgresql/postgresql.key, or specify a key obtained from an external "engine" that is a loadable module of OpenSSL. An external engine description should consist of a colon-separated engine name and an engine-related key identifier. If no SSL connection is established, this parameter is ignored.

sslrootcert

This parameter specifies the name of a file that contains the SSL Certificate Authority (CA) certificate. If the file exists, the system authenticates the server certificate issued by one of these authorities. The default value is ~/.postgresql/root.crt.

sslcrl

This parameter specifies the file name of the SSL Certificate Revocation List (CRL). If a certificate listed in this file exists, the server certificate authentication will be rejected. The default value is ~/.postgresql/root.crl.

requirepeer

This parameter specifies the OS user of the server, for example, requirepeer=postgres. When a Unix-domain socket connection is established, if this parameter is set, the client checks whether the server process is running under the specified user name at the beginning of the connection. If not, the connection will be interrupted by an error. This parameter can be used to provide server authentication similar to that of the SSL certificate on TCP/IP connections. (Note that if the Unix domain socket is in /tmp or another public writable location, any user can start a server for listening on the location. Use this parameter to ensure that you are connected to a server that is run by a trusted user.) This option is supported only on platforms that implement the peer authentication method.

krbsrvname

This parameter specifies the Kerberos service name used for GSSAPI authentication. For successful Kerberos authentication, this value must match the service name specified in the server configuration.

gsslib

This parameter specifies the GSS library used for GSSAPI authentication. It is used only in the Windows OS. If this parameter is set to gssapi, the libpq is forced to use the GSSAPI library to replace the default SSPI for authentication.

service

This parameter specifies the name of the service for which the additional parameter is used. It specifies a service name in pg_service.conf that holds the additional connection parameters. This allows the application to specify only one service name so that the connection parameters can be centrally maintained.

authtype

authtype is no longer used, so it is marked as a parameter not to be displayed. It is retained in an array so as not to reject the conninfo string from old applications that might still try to set it.

remote_nodename

Specifies the name of the remote node connected to the local node.

localhost

Specifies the local host in a connection channel.

localport

Specifies the local port in a connection channel.

fencedUdfRPCMode

Specifies whether the fenced udf RPC protocol uses UNIX domain sockets or special socket file names. The default value is 0, indicating that the UNIX domain socket mode is used and the file type is .s.PGSQL.%d. To use the fenced UDF mode, set this parameter to 1. In this case, the file type is .s.fencedMaster_unixdomain.

replication

Specifies whether the connection should use replication protocols instead of common protocols. Protocols with this parameter configured are internal protocols used for PostgreSQL replication connections and tools such as pg_basebackup, while they can also be used by third-party applications. The following values, which are case-insensitive, are supported:

  • true, on, yes, and 1

Specify whether the physical replication mode is connected.

  • database

Specifies that the logical replication mode and the database specified by dbname are connected.

  • false, off, no, and 0

    Specify that the connection is a regular connection, which is the default behavior.

In physical or logical replication mode, only simple query protocols can be used.

backend_version

Specifies the backend version to be passed to the remote end.

prototype

Sets the current protocol level. The default value is PROTO_TCP.

enable_ce

Specifies whether a client is allowed to connect to a fully-encrypted database. The default value is 0. To enable this function, change the value to 1.

connection_info

The value of connection_info is a JSON character string consisting of driver_name, driver_version, driver_path, and os_user.

If the value is not null, use connection_info and ignore connectionExtraInf.

If the value is null, a connection information string related to libpq is generated. When connectionExtraInf is set to false, the value of connection_info consists of only driver_name and driver_version.

connectionExtraInf

Specifies whether the value of connection_info contains extension information. The default value is 0. If the value contains other information, set this parameter to 1.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback