Module org.jooq

Class PostgresUtils

java.lang.Object
org.jooq.util.postgres.PostgresUtils

@Internal public class PostgresUtils extends Object
A collection of utilities to cover the Postgres JDBC driver's missing implementations.

The Postgres JDBC driver is known to miss out on quite a few JDBC feature implementations. This class should fill those gaps.

Author:
Lukas Eder, Peter Ertl
  • Constructor Details

    • PostgresUtils

      public PostgresUtils()
  • Method Details

    • toBytes

      public static byte[] toBytes(String string)
      Parse a Postgres-encoded bytea string
    • toPGInterval

      public static PGInterval toPGInterval(DayToSecond interval)
      Convert a jOOQ DAY TO SECOND interval to a Postgres representation
    • toPGInterval

      public static PGInterval toPGInterval(YearToSecond interval)
      Convert a jOOQ YEAR TO SECOND interval to a Postgres representation
    • toPGInterval

      public static PGInterval toPGInterval(YearToMonth interval)
      Convert a jOOQ YEAR TO MONTH interval to a Postgres representation
    • toDayToSecond

      public static DayToSecond toDayToSecond(Object pgInterval)
      Convert a Postgres interval to a jOOQ DAY TO SECOND interval
    • toDayToSecond

      public static DayToSecond toDayToSecond(PGInterval pgInterval)
      Convert a Postgres interval to a jOOQ DAY TO SECOND interval
    • toYearToMonth

      public static YearToMonth toYearToMonth(Object pgInterval)
      Convert a Postgres interval to a jOOQ YEAR TO MONTH interval
    • toYearToMonth

      public static YearToMonth toYearToMonth(PGInterval pgInterval)
      Convert a Postgres interval to a jOOQ YEAR TO MONTH interval
    • toYearToSecond

      public static YearToSecond toYearToSecond(Object pgInterval)
      Convert a Postgres interval to a jOOQ YEAR TO SECOND interval
    • toPGArray

      public static List<String> toPGArray(String input)
      Tokenize a PGObject input string.
    • toPGObject

      public static List<String> toPGObject(String input)
      Tokenize a PGObject input string.
    • toPGArrayString

      public static String toPGArrayString(Object[] value)
      Create a Postgres string representation of an array
    • toPGString

      public static String toPGString(Object o)
      Create a PostgreSQL string representation of any object.
    • toPGString

      public static String toPGString(Record r)
      Create a PostgreSQL string representation of a record.
    • toPGString

      public static String toPGString(byte[] binary)
      Create a PostgreSQL string representation of a binary.