Enum PGProperty
- All Implemented Interfaces:
Serializable
,Comparable<PGProperty>
,java.lang.constant.Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionSpecifies if number of rows, used during fetching rows of a result set, should be computed dynamically.Specifies the highest number of rows which can be calculated by adaptiveFetch.Specifies the lowest number of rows which can be calculated by adaptiveFetch.When using the V3 protocol the driver monitors changes in certain server configuration parameters that should not be touched by end users.The application name (require server version >= 9.0).Assume the server is at least that version.AuthenticationPluginClassSpecifies what the driver should do if a query fails.Use binary format for sending and receiving data if possible.Comma separated list of types to disable binary transfer.Comma separated list of types to enable binary transfer.Cancel command is sent out of band over its own connection, so cancel message can itself get stuck.Determine whether SAVEPOINTS used in AUTOSAVE will be released per query or notThe timeout value used for socket connect operations.Specify the schema (or several schema separated by commas) to be set in the search-path.Specifies the maximum number of fields to be cached per connection.Specifies the maximum size (in megabytes) of fields to be cached per connection.Default parameter forStatement.getFetchSize()
.Enable optimization that disables column name sanitiser.Specifies how the driver transforms JDBC escape call syntax into underlying SQL, for invoking procedures or functions.Group startup parameters in a transaction This is important in pool-by-transaction scenarios in order to make sure that all the statements reaches the same connection that is being initialized.Force one of SSPI (Windows transparent single-sign-on) GSSAPI (Kerberos, via JSSE) to be used when the server requests Kerberos or SSPI authentication.After requesting an upgrade to SSL from the server there are reports of the server not responding due to a failover without a timeout here, the client can wait forever.Enable mode to filter out the names of database objects for which the current user has no privileges granted from appearing in the DatabaseMetaData returned by the driver.Specifies the name of the JAAS system or application login configuration.Flag to enable/disable obtaining a GSS credential via JAAS login before authenticating.The Kerberos service name to use when authenticating with GSSAPI.If this is set then the client side will bind to this address.Whether to include full server error detail in exception messages.When connections that are not explicitly closed are garbage collected, log the stacktrace from the opening of the connection to trace the leak source.Deprecated.Logging is configured via java.util.logging.Deprecated.Logging is configured via java.util.logging.Specify how long to wait for establishment of a database connection.Specifies size of buffer during fetching result set.Specify 'options' connection initialization parameter.Password to use when authenticating.Database name to connect to (may be specified directly in the JDBC URL).Hostname of the PostgreSQL server (may be specified directly in the JDBC URL).Port of the PostgreSQL server (may be specified directly in the JDBC URL).Specifies which mode is used to execute queries to database: simple means ('Q' execute, no parse, no bind, text mode only), extended means always use bind/execute messages, extendedForPrepared means extended for prepared statements only, extendedCacheEverything means use extended protocol and try cache every statement (including Statement.execute(String sql)) in a query cache.Sets the default threshold for enabling server-side prepare.Specifies the maximum number of entries in cache of prepared statements.Specifies the maximum size (in megabytes) of the prepared statement cache.Force use of a particular protocol version when connecting, if set, disables protocol version fallback.Quote returning columns.Puts this connection in read-only mode.Connection parameter to control behavior whenConnection.setReadOnly(boolean)
is set totrue
.Socket read buffer size (SO_RECVBUF).Connection parameter passed in the startup message.Configure optimization to enable batch insert re-writing.Socket write buffer size (SO_SNDBUF).Service name to use for additional parameters.Socket factory used to create socket.Deprecated.use..Factory(Properties)
constructor.The timeout value used for socket read operations.Control use of SSL: empty ortrue
values implysslmode==verify-full
File containing the SSL Certificate.Classname of the SSL Factory to use (instance ofSSLSocketFactory
).Deprecated.use..Factory(Properties)
constructor.Classname of the SSL HostnameVerifier to use (instance ofHostnameVerifier
).File containing the SSL Key.Parameter governing the use of SSL.The SSL password to use in the default CallbackHandler.The classname instantiatingCallbackHandler
to use.After requesting an upgrade to SSL from the server there are reports of the server not responding due to a failover without a timeout here, the client can wait forever.File containing the root certificate when validating server (sslmode
=verify-ca
orverify-full
).Specifies the name of the SSPI service class that forms the service class part of the SPN.Bind String to eitherunspecified
orvarchar
.Enable or disable TCP keep-alive.Specifies the length to return for types of unknown length.Use SPNEGO in SSPI authentication requests.Username to connect to the database as.Factory class to instantiate factories for XML processing. -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable PGProperty
@Nullable String
get
(Properties properties) Deprecated.usegetOrDefault(Properties)
insteadboolean
getBoolean
(Properties properties) Return the boolean value for this connection parameter in the givenProperties
.String @Nullable []
Returns the available values for this connection parameter.@Nullable String
Returns the default value for this connection parameter.Returns the description for this connection parameter.int
getInt
(Properties properties) Return the int value for this connection parameter in the givenProperties
.@Nullable Integer
getInteger
(Properties properties) Return theInteger
value for this connection parameter in the givenProperties
.int
getIntNoCheck
(Properties properties) Return the int value for this connection parameter in the givenProperties
.getName()
Returns the name of the connection parameter.@Nullable String
getOrDefault
(Properties properties) Returns the value of the connection parameter from the givenProperties
or the default value.@Nullable String
getOrNull
(Properties properties) Returns the value of the connection parameter from the givenProperties
or null if there is no default value@Nullable String
getSetString
(Properties properties) Return the property if exists but avoiding the default.boolean
isPresent
(Properties properties) Test whether this property is present in the givenProperties
.boolean
Returns whether this parameter is required.void
set
(Properties properties, boolean value) Set the boolean value for this connection parameter in the givenProperties
.void
set
(Properties properties, int value) Set the int value for this connection parameter in the givenProperties
.void
set
(Properties properties, @Nullable String value) Set the value for this connection parameter in the givenProperties
.toDriverPropertyInfo
(Properties properties) Convert this connection parameter and the value read from the givenProperties
into aDriverPropertyInfo
.static PGProperty
Returns the enum constant of this type with the specified name.static PGProperty[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ADAPTIVE_FETCH
Specifies if number of rows, used during fetching rows of a result set, should be computed dynamically. Number of rows will be calculated by dividing maxResultBuffer size by max row size observed so far, rounded down. First fetch will have number of rows declared in defaultRowFetchSize. Number of rows can be limited by adaptiveFetchMinimum and adaptiveFetchMaximum. Requires declaring of maxResultBuffer and defaultRowFetchSize to work. Default value is false. -
ADAPTIVE_FETCH_MAXIMUM
Specifies the highest number of rows which can be calculated by adaptiveFetch. Requires adaptiveFetch set to true to work. Default value is -1 (used as infinity). -
ADAPTIVE_FETCH_MINIMUM
Specifies the lowest number of rows which can be calculated by adaptiveFetch. Requires adaptiveFetch set to true to work. Default value is 0. -
ALLOW_ENCODING_CHANGES
When using the V3 protocol the driver monitors changes in certain server configuration parameters that should not be touched by end users. Theclient_encoding
setting is set by the driver and should not be altered. If the driver detects a change it will abort the connection. -
APPLICATION_NAME
The application name (require server version >= 9.0). -
ASSUME_MIN_SERVER_VERSION
Assume the server is at least that version. -
AUTHENTICATION_PLUGIN_CLASS_NAME
AuthenticationPluginClass -
AUTOSAVE
Specifies what the driver should do if a query fails. Inautosave=always
mode, JDBC driver sets a savepoint before each query, and rolls back to that savepoint in case of failure. Inautosave=never
mode (default), no savepoint dance is made ever. Inautosave=conservative
mode, savepoint is set for each query, however the rollback is done only for rare cases like 'cached statement cannot change return type' or 'statement XXX is not valid' so JDBC driver rollsback and retries -
BINARY_TRANSFER
Use binary format for sending and receiving data if possible. -
BINARY_TRANSFER_DISABLE
Comma separated list of types to disable binary transfer. Either OID numbers or names. Overrides values in the driver default set and values set with binaryTransferEnable. -
BINARY_TRANSFER_ENABLE
Comma separated list of types to enable binary transfer. Either OID numbers or names -
CANCEL_SIGNAL_TIMEOUT
Cancel command is sent out of band over its own connection, so cancel message can itself get stuck. This property controls "connect timeout" and "socket timeout" used for cancel commands. The timeout is specified in seconds. Default value is 10 seconds. -
CLEANUP_SAVEPOINTS
Determine whether SAVEPOINTS used in AUTOSAVE will be released per query or not -
CONNECT_TIMEOUT
The timeout value used for socket connect operations. If connecting to the server takes longer than this value, the connection is broken.
The timeout is specified in seconds and a value of zero means that it is disabled.
-
CURRENT_SCHEMA
Specify the schema (or several schema separated by commas) to be set in the search-path. This schema will be used to resolve unqualified object names used in statements over this connection. -
DATABASE_METADATA_CACHE_FIELDS
Specifies the maximum number of fields to be cached per connection. A value of0
disables the cache. -
DATABASE_METADATA_CACHE_FIELDS_MIB
Specifies the maximum size (in megabytes) of fields to be cached per connection. A value of0
disables the cache. -
DEFAULT_ROW_FETCH_SIZE
Default parameter forStatement.getFetchSize()
. A value of0
means that need fetch all rows at once -
DISABLE_COLUMN_SANITISER
Enable optimization that disables column name sanitiser. -
ESCAPE_SYNTAX_CALL_MODE
Specifies how the driver transforms JDBC escape call syntax into underlying SQL, for invoking procedures or functions. (backend >= 11) InescapeSyntaxCallMode=select
mode (the default), the driver always uses a SELECT statement (allowing function invocation only). InescapeSyntaxCallMode=callIfNoReturn
mode, the driver uses a CALL statement (allowing procedure invocation) if there is no return parameter specified, otherwise the driver uses a SELECT statement. InescapeSyntaxCallMode=call
mode, the driver always uses a CALL statement (allowing procedure invocation only). -
GROUP_STARTUP_PARAMETERS
Group startup parameters in a transaction This is important in pool-by-transaction scenarios in order to make sure that all the statements reaches the same connection that is being initialized. All of the startup parameters will be wrapped in a transaction Note this is off by default as pgbouncer in statement mode -
GSS_ENC_MODE
-
GSS_LIB
Force one of- SSPI (Windows transparent single-sign-on)
- GSSAPI (Kerberos, via JSSE)
-
GSS_RESPONSE_TIMEOUT
After requesting an upgrade to SSL from the server there are reports of the server not responding due to a failover without a timeout here, the client can wait forever. The pattern for requesting a GSS encrypted connection is the same so we provide the same timeout mechanism This timeout will be set before the request and reset after
-
HIDE_UNPRIVILEGED_OBJECTS
Enable mode to filter out the names of database objects for which the current user has no privileges granted from appearing in the DatabaseMetaData returned by the driver. -
HOST_RECHECK_SECONDS
-
JAAS_APPLICATION_NAME
Specifies the name of the JAAS system or application login configuration. -
JAAS_LOGIN
Flag to enable/disable obtaining a GSS credential via JAAS login before authenticating. Useful if setting system property javax.security.auth.useSubjectCredsOnly=false or using native GSS with system property sun.security.jgss.native=true -
KERBEROS_SERVER_NAME
The Kerberos service name to use when authenticating with GSSAPI. This is equivalent to libpq's PGKRBSRVNAME environment variable. -
LOAD_BALANCE_HOSTS
-
LOCAL_SOCKET_ADDRESS
If this is set then the client side will bind to this address. This is useful if you need to choose which interface to connect to.
-
LOGGER_FILE
Deprecated.Logging is configured via java.util.logging.This property is no longer used by the driver and will be ignored. -
LOGGER_LEVEL
Deprecated.Logging is configured via java.util.logging.This property is no longer used by the driver and will be ignored. -
LOGIN_TIMEOUT
Specify how long to wait for establishment of a database connection. The timeout is specified in seconds. -
LOG_SERVER_ERROR_DETAIL
Whether to include full server error detail in exception messages. -
LOG_UNCLOSED_CONNECTIONS
When connections that are not explicitly closed are garbage collected, log the stacktrace from the opening of the connection to trace the leak source. -
MAX_RESULT_BUFFER
Specifies size of buffer during fetching result set. Can be specified as specified size or percent of heap memory. -
OPTIONS
Specify 'options' connection initialization parameter. The value of this parameter may contain spaces and other special characters or their URL representation. -
PASSWORD
Password to use when authenticating. -
PG_DBNAME
Database name to connect to (may be specified directly in the JDBC URL). -
PG_HOST
Hostname of the PostgreSQL server (may be specified directly in the JDBC URL). -
PG_PORT
Port of the PostgreSQL server (may be specified directly in the JDBC URL). -
PREFER_QUERY_MODE
Specifies which mode is used to execute queries to database: simple means ('Q' execute, no parse, no bind, text mode only), extended means always use bind/execute messages, extendedForPrepared means extended for prepared statements only, extendedCacheEverything means use extended protocol and try cache every statement (including Statement.execute(String sql)) in a query cache.
This mode is meant for debugging purposes and/or for cases when extended protocol cannot be used (e.g. logical replication protocol)
-
PREPARED_STATEMENT_CACHE_QUERIES
Specifies the maximum number of entries in cache of prepared statements. A value of0
disables the cache. -
PREPARED_STATEMENT_CACHE_SIZE_MIB
Specifies the maximum size (in megabytes) of the prepared statement cache. A value of0
disables the cache. -
PREPARE_THRESHOLD
Sets the default threshold for enabling server-side prepare. A value of-1
stands for forceBinary -
PROTOCOL_VERSION
Force use of a particular protocol version when connecting, if set, disables protocol version fallback. -
QUOTE_RETURNING_IDENTIFIERS
Quote returning columns. There are some ORM's that quote everything, including returning columns If we quote them, then we end up sending ""colname"" to the backend which will not be found -
READ_ONLY
Puts this connection in read-only mode. -
READ_ONLY_MODE
Connection parameter to control behavior whenConnection.setReadOnly(boolean)
is set totrue
. -
RECEIVE_BUFFER_SIZE
Socket read buffer size (SO_RECVBUF). A value of-1
, which is the default, means system default. -
REPLICATION
Connection parameter passed in the startup message. This parameter accepts two values; "true" and "database". Passing "true" tells the backend to go into walsender mode, wherein a small set of replication commands can be issued instead of SQL statements. Only the simple query protocol can be used in walsender mode. Passing "database" as the value instructs walsender to connect to the database specified in the dbname parameter, which will allow the connection to be used for logical replication from that database.
Parameter should be use together with
ASSUME_MIN_SERVER_VERSION
with parameter >= 9.4 (backend >= 9.4) -
REWRITE_BATCHED_INSERTS
Configure optimization to enable batch insert re-writing. -
SEND_BUFFER_SIZE
Socket write buffer size (SO_SNDBUF). A value of-1
, which is the default, means system default. -
SERVICE
Service name to use for additional parameters. It specifies a service name in "pg_service .conf" that holds additional connection parameters. This allows applications to specify only a service name so connection parameters can be centrally maintained. -
SOCKET_FACTORY
Socket factory used to create socket. A null value, which is the default, means system default. -
SOCKET_FACTORY_ARG
Deprecated.use..Factory(Properties)
constructor.The String argument to give to the constructor of the Socket Factory. -
SOCKET_TIMEOUT
The timeout value used for socket read operations. If reading from the server takes longer than this value, the connection is closed. This can be used as both a brute force global query timeout and a method of detecting network problems. The timeout is specified in seconds and a value of zero means that it is disabled. -
SSL
Control use of SSL: empty ortrue
values implysslmode==verify-full
-
SSL_CERT
File containing the SSL Certificate. Default will be the filepostgresql.crt
in$HOME/.postgresql
(*nix) or%APPDATA%\postgresql
(windows). -
SSL_FACTORY
Classname of the SSL Factory to use (instance ofSSLSocketFactory
). -
SSL_FACTORY_ARG
Deprecated.use..Factory(Properties)
constructor.The String argument to give to the constructor of the SSL Factory. -
SSL_HOSTNAME_VERIFIER
Classname of the SSL HostnameVerifier to use (instance ofHostnameVerifier
). -
SSL_KEY
File containing the SSL Key. Default will be the filepostgresql.pk8
in$HOME/.postgresql
(*nix) or%APPDATA%\postgresql
(windows). -
SSL_MODE
Parameter governing the use of SSL. The allowed values aredisable
,allow
,prefer
,require
,verify-ca
,verify-full
. Ifssl
property is empty or set totrue
it impliesverify-full
. Default mode is "require" -
SSL_PASSWORD
The SSL password to use in the default CallbackHandler. -
SSL_PASSWORD_CALLBACK
The classname instantiatingCallbackHandler
to use. -
SSL_RESPONSE_TIMEOUT
After requesting an upgrade to SSL from the server there are reports of the server not responding due to a failover without a timeout here, the client can wait forever. This timeout will be set before the request and reset after
-
SSL_ROOT_CERT
File containing the root certificate when validating server (sslmode
=verify-ca
orverify-full
). Default will be the fileroot.crt
in$HOME/.postgresql
(*nix) or%APPDATA%\postgresql
(windows). -
SSPI_SERVICE_CLASS
Specifies the name of the SSPI service class that forms the service class part of the SPN. The default,POSTGRES
, is almost always correct. -
STRING_TYPE
Bind String to eitherunspecified
orvarchar
. Default isvarchar
for 8.0+ backends. -
TARGET_SERVER_TYPE
-
TCP_KEEP_ALIVE
Enable or disable TCP keep-alive. The default isfalse
. -
TCP_NO_DELAY
-
UNKNOWN_LENGTH
Specifies the length to return for types of unknown length. -
USER
Username to connect to the database as. -
USE_SPNEGO
Use SPNEGO in SSPI authentication requests. -
XML_FACTORY_FACTORY
Factory class to instantiate factories for XML processing. The default factory disables external entity processing. Legacy behavior with external entity processing can be enabled by specifying a value of LEGACY_INSECURE. Or specify a custom class that implementsPGXmlFactoryFactory
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getName
Returns the name of the connection parameter. The name is the key that must be used in JDBC URL or in Driver properties- Returns:
- the name of the connection parameter
-
getDefaultValue
Returns the default value for this connection parameter.- Returns:
- the default value for this connection parameter or null
-
isRequired
public boolean isRequired()Returns whether this parameter is required.- Returns:
- whether this parameter is required
-
getDescription
Returns the description for this connection parameter.- Returns:
- the description for this connection parameter
-
getChoices
Returns the available values for this connection parameter.- Returns:
- the available values for this connection parameter or null
-
getOrDefault
Returns the value of the connection parameter from the givenProperties
or the default value.- Parameters:
properties
- properties to take actual value from- Returns:
- evaluated value for this connection parameter
-
get
Deprecated.usegetOrDefault(Properties)
insteadReturns the value of the connection parameter from the givenProperties
or the default value- Parameters:
properties
- properties to take actual value from- Returns:
- evaluated value for this connection parameter or null
-
getOrNull
Returns the value of the connection parameter from the givenProperties
or null if there is no default value- Parameters:
properties
- properties object to get value from- Returns:
- evaluated value for this connection parameter
-
set
Set the value for this connection parameter in the givenProperties
.- Parameters:
properties
- properties in which the value should be setvalue
- value for this connection parameter
-
getBoolean
Return the boolean value for this connection parameter in the givenProperties
.- Parameters:
properties
- properties to take actual value from- Returns:
- evaluated value for this connection parameter converted to boolean
-
getIntNoCheck
Return the int value for this connection parameter in the givenProperties
. Prefer the use ofgetInt(Properties)
anywhere you can throw anSQLException
.- Parameters:
properties
- properties to take actual value from- Returns:
- evaluated value for this connection parameter converted to int
- Throws:
NumberFormatException
- if it cannot be converted to int.
-
getInt
Return the int value for this connection parameter in the givenProperties
.- Parameters:
properties
- properties to take actual value from- Returns:
- evaluated value for this connection parameter converted to int
- Throws:
PSQLException
- if it cannot be converted to int.
-
getInteger
Return theInteger
value for this connection parameter in the givenProperties
.- Parameters:
properties
- properties to take actual value from- Returns:
- evaluated value for this connection parameter converted to Integer or null
- Throws:
PSQLException
- if unable to parse property as integer
-
set
Set the boolean value for this connection parameter in the givenProperties
.- Parameters:
properties
- properties in which the value should be setvalue
- boolean value for this connection parameter
-
set
Set the int value for this connection parameter in the givenProperties
.- Parameters:
properties
- properties in which the value should be setvalue
- int value for this connection parameter
-
isPresent
Test whether this property is present in the givenProperties
.- Parameters:
properties
- set of properties to check current in- Returns:
- true if the parameter is specified in the given properties
-
toDriverPropertyInfo
Convert this connection parameter and the value read from the givenProperties
into aDriverPropertyInfo
.- Parameters:
properties
- properties to take actual value from- Returns:
- a DriverPropertyInfo representing this connection parameter
-
forName
-
getSetString
Return the property if exists but avoiding the default. Allowing the caller to detect the lack of a property.- Parameters:
properties
- properties bundle- Returns:
- the value of a set property
-