Skip navigation links
  • Overview
  • Package
  • Class
  • Use
  • Tree
  • Deprecated
  • Index
  • Help

Deprecated API

Contents

  • Classes
  • Fields
  • Methods
  • Constructors
  • Enum Constants
  • Deprecated Classes
    Class
    Description
    org.postgresql.ds.PGPoolingDataSource
    Since 42.0.0, instead of this class you should use a fully featured connection pool like HikariCP, vibur-dbcp, commons-dbcp, c3p0, etc.
    org.postgresql.jdbc.EscapedFunctions
    see EscapedFunctions2
    org.postgresql.jdbc2.optional.ConnectionPool
    Please use PGConnectionPoolDataSource
    org.postgresql.jdbc2.optional.PoolingDataSource
    Since 42.0.0, see PGPoolingDataSource
    org.postgresql.jdbc2.optional.SimpleDataSource
    Please use PGSimpleDataSource
    org.postgresql.jdbc3.Jdbc3ConnectionPool
    Please use PGConnectionPoolDataSource
    org.postgresql.jdbc3.Jdbc3PoolingDataSource
    Since 42.0.0, see PGPoolingDataSource
    org.postgresql.jdbc3.Jdbc3SimpleDataSource
    Please use PGSimpleDataSource
    org.postgresql.ssl.jdbc4.LibPQFactory
    prefer LibPQFactory
  • Deprecated Fields
    Field
    Description
    org.postgresql.core.QueryExecutor.QUERY_DISALLOW_BATCHING
    in PgJDBC 9.4 as we now auto-size batches.
  • Deprecated Methods
    Method
    Description
    org.postgresql.core.BaseConnection.getTimestampUtils()
    org.postgresql.core.QueryExecutor.createFastpathParameters(int)
    This API is somewhat obsolete, as one may achieve similar performance and greater functionality by setting up a prepared statement to define the function call. Then, executing the statement with binary transmission of parameters and results substitutes for a fast-path function call.
    org.postgresql.core.QueryExecutor.fastpathCall(int, ParameterList, boolean)
    This API is somewhat obsolete, as one may achieve similar performance and greater functionality by setting up a prepared statement to define the function call. Then, executing the statement with binary transmission of parameters and results substitutes for a fast-path function call.
    org.postgresql.core.QueryExecutor.getBinaryReceiveOids()
    the method returns a copy of the set, so it is not efficient. Use TypeTransferModeRegistry.useBinaryForReceive(int)
    org.postgresql.core.QueryExecutor.getBinarySendOids()
    the method returns a copy of the set, so it is not efficient. Use TypeTransferModeRegistry.useBinaryForSend(int)
    org.postgresql.core.QueryExecutorBase.sendCloseMessage()
    use QueryExecutorBase.getCloseAction() instead
    org.postgresql.Driver.getVersion()
    use Driver.getMajorVersion() and Driver.getMinorVersion() instead
    org.postgresql.ds.common.BaseDataSource.getGroupStartupParameters()
    since we can send the startup parameters as a multistatment transaction
    org.postgresql.ds.common.BaseDataSource.getLoggerFile()
    Configure via java.util.logging
    org.postgresql.ds.common.BaseDataSource.getLoggerLevel()
    Configure via java.util.logging
    org.postgresql.ds.common.BaseDataSource.getPortNumber()
    use BaseDataSource.getPortNumbers()
    org.postgresql.ds.common.BaseDataSource.getServerName()
    use BaseDataSource.getServerNames()
    org.postgresql.ds.common.BaseDataSource.setGroupStartupParameters(boolean)
    since we can send the startup parameters as a multistatment transaction
    org.postgresql.ds.common.BaseDataSource.setLoggerFile(String)
    Configure via java.util.logging
    org.postgresql.ds.common.BaseDataSource.setLoggerLevel(String)
    Configure via java.util.logging
    org.postgresql.ds.common.BaseDataSource.setPortNumber(int)
    use BaseDataSource.setPortNumbers(int[])
    org.postgresql.ds.common.BaseDataSource.setServerName(String)
    use BaseDataSource.setServerNames(String[])
    org.postgresql.fastpath.Fastpath.fastpath(int, boolean, FastpathArg[])
    please use Fastpath.fastpath(int, FastpathArg[])
    org.postgresql.fastpath.Fastpath.fastpath(String, boolean, FastpathArg[])
    Use Fastpath.getData(String, FastpathArg[]) if you expect a binary result, or one of Fastpath.getInteger(String, FastpathArg[]) or Fastpath.getLong(String, FastpathArg[]) if you expect a numeric one
    org.postgresql.geometric.PGpoint.setLocation(Point)
    Will be removed for avoiding a dependency to the java.desktop module.
    org.postgresql.jdbc.PgConnection.addDataType(String, String)
    org.postgresql.jdbc.PgConnection.getTimestampUtils()
    org.postgresql.jdbc.TimestampUtils.toOffsetDateTime(Time)
    was used internally, and not used anymore
    org.postgresql.largeobject.LargeObject.getOID()
    As of 8.3, replaced by LargeObject.getLongOID()
    org.postgresql.largeobject.LargeObjectManager.create()
    As of 8.3, replaced by LargeObjectManager.createLO()
    org.postgresql.largeobject.LargeObjectManager.create(int)
    As of 8.3, replaced by LargeObjectManager.createLO(int)
    org.postgresql.largeobject.LargeObjectManager.delete(int)
    As of 8.3, replaced by LargeObjectManager.delete(long)
    org.postgresql.largeobject.LargeObjectManager.open(int)
    As of 8.3, replaced by LargeObjectManager.open(long)
    org.postgresql.largeobject.LargeObjectManager.open(int, int)
    As of 8.3, replaced by LargeObjectManager.open(long, int)
    org.postgresql.largeobject.LargeObjectManager.unlink(int)
    As of 8.3, replaced by LargeObjectManager.unlink(long)
    org.postgresql.PGConnection.addDataType(String, String)
    As of 8.0, replaced by PGConnection.addDataType(String, Class). This deprecated method does not work correctly for registering classes that cannot be directly loaded by the JDBC driver's classloader.
    org.postgresql.PGProperty.get(Properties)
    use PGProperty.getOrDefault(Properties) instead
    org.postgresql.PGRefCursorResultSet.getRefCursor()
    As of 8.0, replaced with calling getString() on the ResultSet that this ResultSet was obtained from.
    org.postgresql.PGStatement.setUseServerPrepare(boolean)
    As of build 302, replaced by PGStatement.setPrepareThreshold(int)
    org.postgresql.ssl.jdbc4.LibPQFactory.verify(String, SSLSession)
    use PgjdbcHostnameVerifier
    org.postgresql.ssl.jdbc4.LibPQFactory.verifyHostName(String, String)
    use PGjdbcHostnameVerifier
    org.postgresql.util.PasswordUtil.encodeMd5(String, char[])
    prefer PGConnection.alterUserPassword(String, char[], String) or PasswordUtil.encodeScramSha256(char[]) for better security.
    org.postgresql.util.PGbytea.toPGLiteral(Object)
    prefer PGbytea.toPGLiteral(Object, SqlSerializationContext) to clarify the behaviour regarding InputStream objects
  • Deprecated Constructors
    Constructor
    Description
    org.postgresql.core.PGStream(SocketFactory, HostSpec)
    use PGStream(SocketFactory, org.postgresql.util.HostSpec, int, int)
    org.postgresql.core.PGStream(SocketFactory, HostSpec, int)
    use PGStream(SocketFactory, org.postgresql.util.HostSpec, int, int)
    org.postgresql.ssl.jdbc4.LibPQFactory(Properties)
    prefer LibPQFactory
  • Deprecated Enum Constants
    Enum Constant
    Description
    org.postgresql.hostchooser.HostRequirement.master
    we no longer use the terms master or slave in the driver, or the PostgreSQL project.
    org.postgresql.PGProperty.GROUP_STARTUP_PARAMETERS
    since we can send the startup parameters as a multistatment transaction
    org.postgresql.PGProperty.LOGGER_FILE
    Logging is configured via java.util.logging.
    org.postgresql.PGProperty.LOGGER_LEVEL
    Logging is configured via java.util.logging.

Copyright © 2026 PostgreSQL Global Development Group. All rights reserved.