PackageTrack
Sign in Get early access

github.com/lib/pq

v1.12.3 #413 most downloaded on Go modules lib/pq

What this package is like to depend on

Last release 3 days ago

20 Aug 2026

Ships unpredictably

gaps range from 8 days to 3 months

Some releases are documented

notes for 10 of 31 stable releases

Nothing withdrawn

no release was ever pulled

14 years old

586 releases · first in 2012

180 releases in the last 12 months

see the full history below

Release timeline

586 releases · Mar 2012 to Aug 2026
2013 2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 60 of 586
  1. v1.12.4-0.20260820222753-451ac10e4e85 20 Aug 2026 pre-release

    Nothing published for this version

  2. v1.12.4-0.20260818200449-4cd6ec55b315 18 Aug 2026 pre-release

    Nothing published for this version

  3. v1.12.4-0.20260816161508-2835785690d5 16 Aug 2026 pre-release

    Nothing published for this version

  4. v1.12.4-0.20260803193607-f4654a41a62b 03 Aug 2026 pre-release

    Nothing published for this version

  5. v1.12.4-0.20260803152524-727c63593b64 03 Aug 2026 pre-release

    Nothing published for this version

  6. v1.12.4-0.20260727205347-10237a65609e 27 Jul 2026 pre-release

    Nothing published for this version

  7. v1.12.4-0.20260726212313-c152f32e977b 26 Jul 2026 pre-release

    Nothing published for this version

  8. v1.12.4-0.20260711203001-d70e69988c9f 11 Jul 2026 pre-release

    Nothing published for this version

  9. v1.12.4-0.20260711194334-b125f757db35 11 Jul 2026 pre-release

    Nothing published for this version

  10. v1.12.4-0.20260408231220-76df97d6b105 08 Apr 2026 pre-release

    Nothing published for this version

  11. v1.12.4-0.20260408150540-004e5e8d262f 08 Apr 2026 pre-release

    Nothing published for this version

  12. v1.12.3 03 Apr 2026
    Release notes
    • Send datestyle startup parameter, improving compatbility with database engines that use a different default datestyle such as EnterpriseDB (#1312).
    Open source →
    Release notes
    • Send datestyle startup parameter, improving compatbility with database engines that use a different default datestyle such as EnterpriseDB (#1312).
    Open source →
  13. v1.12.3-0.20260402111909-32ba56b8f9c0 02 Apr 2026 pre-release

    Nothing published for this version

  14. v1.12.2 02 Apr 2026
    Release notes
    • Treat io.ErrUnexpectedEOF as driver.ErrBadConn so database/sql discards the connection. Since v1.12.0 this could result in permanently broken connections, especially with CockroachDB which frequently sends partial messages (#1299).
    Open source →
    Release notes
    • Treat io.ErrUnexpectedEOF as driver.ErrBadConn so database/sql discards the connection. Since v1.12.0 this could result in permanently broken connections, especially with CockroachDB which frequently sends partial messages (#1299).
    Open source →
  15. v1.12.2-0.20260402094553-859f10493799 02 Apr 2026 pre-release

    Nothing published for this version

  16. v1.12.2-0.20260401120409-6d77ced41719 01 Apr 2026 pre-release

    Nothing published for this version

  17. v1.12.2-0.20260401102757-71daecbc4522 01 Apr 2026 pre-release

    Nothing published for this version

  18. v1.12.1 30 Mar 2026
    Release notes
    • Look for pgpass file in ~/.pgpass instead of ~/.postgresql/pgpass (#1300).

    • Don't clear password if directly set on pq.Config (#1302).

    Open source →
    Release notes
    • Look for pgpass file in ~/.pgpass instead of ~/.postgresql/pgpass (#1300).

    • Don't clear password if directly set on pq.Config (#1302).

    Open source →
  19. v1.12.0 18 Mar 2026
    Release notes
    • The next release may change the default sslmode from require to prefer. See #1271 for details.

    • CopyIn() and CopyInToSchema() have been marked as deprecated. These are simple query builders and not needed for COPY [..] FROM STDIN support (which is not deprecated). (#1279)

      // Old
      tx.Prepare(CopyIn("temp", "num", "text", "blob", "nothing"))
      
      // Replacement
      tx.Prepare(`copy temp (num, text, blob, nothing) from stdin`)
      

    Features

    • Support protocol 3.2, and the min_protocol_version and max_protocol_version DSN parameters (#1258).

    • Support sslmode=prefer and sslmode=allow (#1270).

    • Support ssl_min_protocol_version and ssl_max_protocol_version (#1277).

    • Support connection service file to load connection details (#1285).

    • Support sslrootcert=system and use ~/.postgresql/root.crt as the default value of sslrootcert (#1280, #1281).

    • Add a new pqerror package with PostgreSQL error codes (#1275).

      For example, to test if an error is a UNIQUE constraint violation:

      if pqErr, ok := errors.AsType[*pq.Error](err); ok && pqErr.Code == pqerror.UniqueViolation {
          log.Fatalf("email %q already exsts", email)
      }
      

      To make this a bit more convenient, it also adds a pq.As() function:

      pqErr := pq.As(err, pqerror.UniqueViolation)
      if pqErr != nil {
          log.Fatalf("email %q already exsts", email)
      }
      

    Fixes

    • Fix SSL key permission check to allow modes stricter than 0600/0640 (#1265).

    • Fix Hstore to work with binary parameters (#1278).

    • Clearer error when starting a new query while pq is still processing another query (#1272).

    • Send intermediate CAs with client certificates, so they can be signed by an intermediate CA (#1267).

    • Use time.UTC for UTC aliases such as Etc/UTC (#1283).

    Open source →
    Release notes
    • The next release may change the default sslmode from require to prefer. See #1271 for details.

    • CopyIn() and CopyInToSchema() have been marked as deprecated. These are simple query builders and not needed for COPY [..] FROM STDIN support (which is not deprecated). (#1279)

      // Old
      tx.Prepare(CopyIn("temp", "num", "text", "blob", "nothing"))
      
      // Replacement
      tx.Prepare(`copy temp (num, text, blob, nothing) from stdin`)
      

    Features

    • Support protocol 3.2, and the min_protocol_version and max_protocol_version DSN parameters (#1258).

    • Support sslmode=prefer and sslmode=allow (#1270).

    • Support ssl_min_protocol_version and ssl_max_protocol_version (#1277).

    • Support connection service file to load connection details (#1285).

    • Support sslrootcert=system and use ~/.postgresql/root.crt as the default value of sslrootcert (#1280, #1281).

    • Add a new pqerror package with PostgreSQL error codes (#1275).

      For example, to test if an error is a UNIQUE constraint violation:

      if pqErr, ok := errors.AsType[*pq.Error](err); ok && pqErr.Code == pqerror.UniqueViolation {
          log.Fatalf("email %q already exsts", email)
      }
      

      To make this a bit more convenient, it also adds a pq.As() function:

      pqErr := pq.As(err, pqerror.UniqueViolation)
      if pqErr != nil {
          log.Fatalf("email %q already exsts", email)
      }
      

    Fixes

    • Fix SSL key permission check to allow modes stricter than 0600/0640#1265 (#1265).

    • Fix Hstore to work with binary parameters (#1278).

    • Clearer error when starting a new query while pq is still processing another query (#1272).

    • Send intermediate CAs with client certificates, so they can be signed by an intermediate CA (#1267).

    • Use time.UTC for UTC aliases such as Etc/UTC (#1282).

    Open source →
  20. v1.11.3-0.20260330125404-5a64c116462d 30 Mar 2026 pre-release

    Nothing published for this version

  21. v1.11.3-0.20260318141442-6d40f13cfefe 18 Mar 2026 pre-release

    Nothing published for this version

  22. v1.11.3-0.20260318010440-09624587cd3d 18 Mar 2026 pre-release

    Nothing published for this version

  23. v1.11.3-0.20260317182133-620d6d50817f 17 Mar 2026 pre-release

    Nothing published for this version

  24. v1.11.3-0.20260317141723-b36c912fcb98 17 Mar 2026 pre-release

    Nothing published for this version

  25. v1.11.3-0.20260316120615-1e8ca8d7fb67 16 Mar 2026 pre-release

    Nothing published for this version

  26. v1.11.3-0.20260316104545-cae0adb26cdd 16 Mar 2026 pre-release

    Nothing published for this version

  27. v1.11.3-0.20260314210848-a2005c145155 14 Mar 2026 pre-release

    Nothing published for this version

  28. v1.11.3-0.20260312213958-5e55bb7c2a77 12 Mar 2026 pre-release

    Nothing published for this version

  29. v1.11.3-0.20260311235152-2a2614c3ca9d 11 Mar 2026 pre-release

    Nothing published for this version

  30. v1.11.3-0.20260311225402-5db0f0d39a1d 11 Mar 2026 pre-release

    Nothing published for this version

  31. v1.11.3-0.20260311160221-5d20cc3a9487 11 Mar 2026 pre-release

    Nothing published for this version

  32. v1.11.3-0.20260311035911-7517e07b3228 11 Mar 2026 pre-release

    Nothing published for this version

  33. v1.11.3-0.20260310152740-f3ef532aae5a 10 Mar 2026 pre-release

    Nothing published for this version

  34. v1.11.3-0.20260310015834-59491bdcfc17 10 Mar 2026 pre-release

    Nothing published for this version

  35. v1.11.3-0.20260309162715-c321a5776763 09 Mar 2026 pre-release

    Nothing published for this version

  36. v1.11.3-0.20260309134739-3b56ab470bab 09 Mar 2026 pre-release

    Nothing published for this version

  37. v1.11.3-0.20260305160911-335685473c46 05 Mar 2026 pre-release

    Nothing published for this version

  38. v1.11.3-0.20260218182013-89e7b23fe859 18 Feb 2026 pre-release

    Nothing published for this version

  39. v1.11.3-0.20260212140111-262be4adbb8c 12 Feb 2026 pre-release

    Nothing published for this version

  40. v1.11.3-0.20260212120307-91f52d151a86 12 Feb 2026 pre-release

    Nothing published for this version

  41. v1.11.2 10 Feb 2026
    Release notes

    This fixes two regressions:

    • Don't send startup parameters if there is no value, improving compatibility with Supavisor (#1260).

    • Don't send dbname as a startup parameter if database=[..] is used in the connection string. It's recommended to use dbname=, as database= is not a libpq option, and only worked by accident previously. (#1261)

    Open source →
    Release notes

    This fixes two regressions:

    • Don't send startup parameters if there is no value, improving compatibility with Supavisor (#1260).

    • Don't send dbname as a startup parameter if database=[..] is used in the connection string. It's recommended to use dbname=, as database= is not a libpq option, and only worked by accident previously. (#1261)

    Open source →
  42. v1.11.1 29 Jan 2026
    Release notes

    This fixes two regressions present in the v1.11.0 release:

    • Fix build on 32bit systems, Windows, and Plan 9 (#1253).

    • Named []byte types and pointers to []byte (e.g. *[]byte, json.RawMessage) would be treated as an array instead of bytea (#1252).

    Open source →
    Release notes

    This fixes two regressions present in the v1.11.0 release:

    • Fix build on 32bit systems, Windows, and Plan 9 (#1253).

    • Named []byte types and pointers to []byte (e.g. *[]byte, json.RawMessage) would be treated as an array instead of bytea (#1252).

    Open source →
  43. v1.11.0 28 Jan 2026
    Release notes

    This version of pq requires Go 1.21 or newer.

    pq now supports only maintained PostgreSQL releases, which is PostgreSQL 14 and newer. Previously PostgreSQL 8.4 and newer were supported.

    Features

    • The pq.Error.Error() text includes the position of the error (if reported by PostgreSQL) and SQLSTATE code (#1219, #1224):

      pq: column "columndoesntexist" does not exist at column 8 (42703)
      pq: syntax error at or near ")" at position 2:71 (42601)
      
    • The pq.Error.ErrorWithDetail() method prints a more detailed multiline message, with the Detail, Hint, and error position (if any) (#1219):

      ERROR:   syntax error at or near ")" (42601)
      CONTEXT: line 12, column 1:
      
           10 |     name           varchar,
           11 |     version        varchar,
           12 | );
                ^
      
    • Add Config, NewConfig(), and NewConnectorConfig() to supply connection details in a more structured way (#1240).

    • Support hostaddr and $PGHOSTADDR (#1243).

    • Support multiple values in host, port, and hostaddr, which are each tried in order, or randomly if load_balance_hosts=random is set (#1246).

    • Support target_session_attrs connection parameter (#1246).

    • Support sslnegotiation to use SSL without negotiation (#1180).

    • Allow using a custom tls.Config, for example for encrypted keys (#1228).

    • Add PQGO_DEBUG=1 print the communication with PostgreSQL to stderr, to aid in debugging, testing, and bug reports (#1223).

    • Add support for NamedValueChecker interface (#1125, #1238).

    Fixes

    • Match HOME directory lookup logic with libpq: prefer $HOME over /etc/passwd, ignore ENOTDIR errors, and use APPDATA on Windows (#1214).

    • Fix sslmode=verify-ca verifying the hostname anyway when connecting to a DNS name (rather than IP) (#1226).

    • Correctly detect pre-protocol errors such as the server not being able to fork or running out of memory (#1248).

    • Fix build with wasm (#1184), appengine (#745), and Plan 9 (#1133).

    • Deprecate and type alias pq.NullTime to sql.NullTime (#1211).

    • Enforce integer limits of the Postgres wire protocol (#1161).

    • Accept the passfile connection parameter to override PGPASSFILE (#1129).

    • Fix connecting to socket on Windows systems (#1179).

    • Don't perform a permission check on the .pgpass file on Windows (#595).

    • Warn about incorrect .pgpass permissions (#595).

    • Don't set extra_float_digits (#1212).

    • Decode bpchar into a string (#949).

    • Fix panic in Ping() by not requiring CommandComplete or EmptyQueryResponse in simpleQuery() (#1234)

    • Recognize bit/varbit (#743) and float types (#1166) in ColumnTypeScanType().

    • Accept PGGSSLIB and PGKRBSRVNAME environment variables (#1143).

    • Handle ErrorResponse in readReadyForQuery and return proper error (#1136).

    • CopyIn() and CopyInSchema() now work if the list of columns is empty, in which case it will copy all columns (#1239).

    • Treat nil []byte in query parameters as nil/NULL rather than "" (#838).

    • Accept multiple authentication methods before checking AuthOk, which improves compatibility with PgPool-II (#1188).

    Open source →
    Release notes

    This version of pq requires Go 1.21 or newer.

    pq now supports only maintained PostgreSQL releases, which is PostgreSQL 14 and newer. Previously PostgreSQL 8.4 and newer were supported.

    Features

    • The pq.Error.Error() text includes the position of the error (if reported by PostgreSQL) and SQLSTATE code (#1219, #1224):

      pq: column "columndoesntexist" does not exist at column 8 (42703)
      pq: syntax error at or near ")" at position 2:71 (42601)
      
    • The pq.Error.ErrorWithDetail() method prints a more detailed multiline message, with the Detail, Hint, and error position (if any) (#1219):

      ERROR:   syntax error at or near ")" (42601)
      CONTEXT: line 12, column 1:
      
           10 |     name           varchar,
           11 |     version        varchar,
           12 | );
                ^
      
    • Add Config, NewConfig(), and NewConnectorConfig() to supply connection details in a more structured way (#1240).

    • Support hostaddr and $PGHOSTADDR (#1243).

    • Support multiple values in host, port, and hostaddr, which are each tried in order, or randomly if load_balance_hosts=random is set (#1246).

    • Support target_session_attrs connection parameter (#1246).

    • Support sslnegotiation to use SSL without negotiation (#1180).

    • Allow using a custom tls.Config, for example for encrypted keys (#1228).

    • Add PQGO_DEBUG=1 print the communication with PostgreSQL to stderr, to aid in debugging, testing, and bug reports (#1223).

    • Add support for NamedValueChecker interface (#1125, #1238).

    Fixes

    • Match HOME directory lookup logic with libpq: prefer $HOME over /etc/passwd, ignore ENOTDIR errors, and use APPDATA on Windows (#1214).

    • Fix sslmode=verify-ca verifying the hostname anyway when connecting to a DNS name (rather than IP) (#1226).

    • Correctly detect pre-protocol errors such as the server not being able to fork or running out of memory (#1248).

    • Fix build with wasm (#1184), appengine (#745), and Plan 9 (#1133).

    • Deprecate and type alias pq.NullTime to sql.NullTime (#1211).

    • Enforce integer limits of the Postgres wire protocol (#1161).

    • Accept the passfile connection parameter to override PGPASSFILE (#1129).

    • Fix connecting to socket on Windows systems (#1179).

    • Don't perform a permission check on the .pgpass file on Windows (#595).

    • Warn about incorrect .pgpass permissions (#595).

    • Don't set extra_float_digits (#1212).

    • Decode bpchar into a string (#949).

    • Fix panic in Ping() by not requiring CommandComplete or EmptyQueryResponse in simpleQuery() (#1234)

    • Recognize bit/varbit (#743) and float types (#1166) in ColumnTypeScanType().

    • Accept PGGSSLIB and PGKRBSRVNAME environment variables (#1143).

    • Handle ErrorResponse in readReadyForQuery and return proper error (#1136).

    • Detect COPY even if the query starts with whitespace or comments (#1198).

    • CopyIn() and CopyInSchema() now work if the list of columns is empty, in which case it will copy all columns (#1239).

    • Treat nil []byte in query parameters as nil/NULL rather than "" (#838).

    • Accept multiple authentication methods before checking AuthOk, which improves compatibility with PgPool-II (#1188).

    Open source →
  44. v1.10.10-0.20260124225939-f1fae2ee3828 24 Jan 2026 pre-release

    Nothing published for this version

  45. v1.10.10-0.20260124163306-3815d03993a5 24 Jan 2026 pre-release

    Nothing published for this version

  46. v1.10.10-0.20260124145109-589ad43c7e1f 24 Jan 2026 pre-release

    Nothing published for this version

  47. v1.10.10-0.20260122160210-dd34b7111be1 22 Jan 2026 pre-release

    Nothing published for this version

  48. v1.10.10-0.20260121132927-91312493ea55 21 Jan 2026 pre-release

    Nothing published for this version

  49. v1.10.10-0.20260120205106-35ce81bceb29 20 Jan 2026 pre-release

    Nothing published for this version

  50. v1.10.10-0.20260120192248-f1b4c41caf27 20 Jan 2026 pre-release

    Nothing published for this version

  51. v1.10.10-0.20260120171330-7666f295e00e 20 Jan 2026 pre-release

    Nothing published for this version

  52. v1.10.10-0.20260120165352-e5e969c25453 20 Jan 2026 pre-release

    Nothing published for this version

  53. v1.10.10-0.20260119174321-e1fe05871beb 19 Jan 2026 pre-release

    Nothing published for this version

  54. v1.10.10-0.20260119170123-fc449c66bdf6 19 Jan 2026 pre-release

    Nothing published for this version

  55. v1.10.10-0.20260119154117-9f5555d0b3b0 19 Jan 2026 pre-release

    Nothing published for this version

  56. v1.10.10-0.20260119141459-27a1c3ae5dcd 19 Jan 2026 pre-release

    Nothing published for this version

  57. v1.10.10-0.20260119135242-dcaeb5e40f89 19 Jan 2026 pre-release

    Nothing published for this version

  58. v1.10.10-0.20260118193048-13013dbb2e00 18 Jan 2026 pre-release

    Nothing published for this version

  59. v1.10.10-0.20260113193107-cda033a1a467 13 Jan 2026 pre-release

    Nothing published for this version

  60. v1.10.10-0.20260113130451-8a6eab49af6e 13 Jan 2026 pre-release

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive