Commit Graph

3624 Commits (bf1c1d7848c087c99fb30a67657a5ec3197f7f32)

Author SHA1 Message Date
Florent Viel bf1c1d7848 create ltree extension in pg setup for tests 2024-01-26 09:06:13 -06:00
Florent Viel 0fa533386c add ltree pgtype support 2024-01-26 09:06:13 -06:00
Pavlo Golub c90f82a4e3 make properties of QueuedQuery and Batch public, closes #1878 2024-01-25 18:03:59 -06:00
Edoardo Spadolini a57bb8caea Add `AppendRows` helper 2024-01-23 17:14:24 -06:00
Kirill Malikov 517c654e2c feat: fast encodeUUID 2024-01-20 20:50:01 -06:00
Mitar a4ca0917da Support large large objects.
Fixes #1865.
2024-01-15 08:50:55 -06:00
Mitar 0c35c9e630 Revert "Document max read and write sizes for large objects"
This reverts commit b99e2bb7e0.
2024-01-15 08:50:55 -06:00
Jack Christensen b7de418d46 Release v5.5.2 2024-01-13 11:08:35 -06:00
Jack Christensen b99e2bb7e0 Document max read and write sizes for large objects
https://github.com/jackc/pgx/issues/1865
2024-01-13 10:43:35 -06:00
Jack Christensen 52f2151422 Allow NamedArgs to start with underscore
fixes #1869
2024-01-13 10:20:25 -06:00
Endre Kovács dfb6489612 fix typo in doc.go 2024-01-13 09:40:00 -06:00
Chris Frank 9346d48035 fix OpenDBFromPool example 2024-01-13 09:39:16 -06:00
jeremy.spriet 1fdd17041a feat(pgproto3): expose MaxExpectedBodyLen and ActualBodyLen in ExceededMaxBodyLenErr struct 2024-01-12 18:21:07 -06:00
Jack Christensen f654d61d79 Make note about possible parse config error message redaction change 2024-01-12 17:56:13 -06:00
Jack Christensen 5d26bbefd8 Make pgconn.ConnectError and pgconn.ParseConfigError public
fixes #1773
2024-01-12 17:52:25 -06:00
vahid-sohrabloo 44768b5a01 fix a typo in config_test.go
fix a typo in config_test.go
2024-01-12 17:36:43 -06:00
Jack Christensen 6f2ce92356 Upgrade golang.org/x/crypto to v0.17.0
pgx is unaffected by CVE-2023-48795 because it does not use SSH.
However, dependabot and other vulnerability scanners may complain so
bump the dependency anyway.
2023-12-29 18:14:09 -06:00
Tikhon Fedulov 4367ee0598 Update TestRowToStructByName with snake case support 2023-12-25 09:47:10 -06:00
Tikhon Fedulov d2c9ebc2ef Use local variables in fieldPosByName and fix errors 2023-12-25 09:47:10 -06:00
Tikhon Fedulov 0c7acf9481 Add snake_case support to RowToStructByName 2023-12-25 09:47:10 -06:00
Jack Christensen cbc5a7055f Fix: close conn on read failure in pipeline
Suggested by @jameshartig in https://github.com/jackc/pgx/issues/1847
2023-12-23 12:11:23 -06:00
James Hartig 4c14caae07 update description cache after exec prepare 2023-12-23 12:08:02 -06:00
James Hartig 22fe50149b pgconn: check if pipeline i closed in Sync/GetResults
Otherwise there will be a nil pointer exception accessing the conn
2023-12-23 12:04:21 -06:00
Ryan Fowler dfd198003a Fix panic in Pipeline when PgConn is busy or closed 2023-12-23 10:30:59 -06:00
jeremy.spriet 603c8c1e90 feat(pgproto3/backend): add a SetMaxBodyLen to limit the max body length for the receive 2023-12-23 10:25:35 -06:00
Samuel Stauffer 9ab9e3c40b Unwrap errors in normalizeTimeoutError 2023-12-16 11:15:35 -06:00
Samuel Stauffer 2daeb8dc5f pgconn: normalize starTLS connection error
Normalize the error that is returned by startTLS in pgconn.connect. This
makes it possible to determine if the error was a context error.
2023-12-16 11:15:35 -06:00
Jack Christensen df3c5f4df8 Use "Pg" instead of "PG" in new PgError related identifiers
Arguably, PGError might have been better. But since the precedent is
long since established it is better to be consistent.
2023-12-15 18:33:51 -06:00
James Hartig b1631e8e35 pgconn: add OnPGError to Config for error handling
OnPGError is called on every error response received from Postgres and can
be used to close connections on specific errors. Defaults to closing on
FATAL-severity errors.

Fixes #1803
2023-12-15 18:29:32 -06:00
Jack Christensen ba05097642 Release v5.5.1 2023-12-09 12:59:44 -06:00
Evan Jones 384fe7775c Batch.Queue: document always uses the conn's DefaultQueryExecMode
The only way to change the query mode used by Batch.Queue and
SendBatch is to use a connection with a different
DefaultQueryExecMode. Add this to the function documentation.

Conn.SendBatch: Move where mode is defined to make this clearer in
the code. I spent time looking for the option that does not exist.
2023-12-09 11:47:56 -06:00
Eshton Robateau 20bf953a17 pull out changes into new public function 2023-12-09 11:20:14 -06:00
Eshton Robateau 12582a0fd4 bitsize largest option is 64 2023-12-09 11:20:14 -06:00
Eshton Robateau 905f252667 uncomment tests 2023-12-09 11:20:14 -06:00
Eshton Robateau 9927e14bbf remove dead line 2023-12-09 11:20:14 -06:00
Eshton Robateau 95b2f85e60 support scientific notation big floats 2023-12-09 11:20:14 -06:00
Jack Christensen 913e4c8487 Update changelog 2023-12-02 09:36:03 -06:00
Jack Christensen 31321c2017 Add race detector to bug report template 2023-12-02 09:27:57 -06:00
maksymnevajdev 319c3172f2 fix panic in prepared sql 2023-12-01 18:34:41 -06:00
Simon Paredes 4678e69599 fix error message to print the unexpected rune 2023-12-01 18:23:23 -06:00
Simon Paredes 89d699c2e8 wrap errors instead of just formatting them 2023-12-01 18:23:23 -06:00
Jacopo 7ebced92b5 Fix issue with order of json encoding #1805 2023-11-24 19:01:48 -06:00
Sam Whited 94e56e61ba Fix usage of logger in stdlib docs
The documentation previously showed the old way of logging and not the
newer tracer adapter. This patch updates the example to build correctly
with pgx/v5.

Signed-off-by: Sam Whited <sam@samwhited.com>
2023-11-22 08:15:05 -06:00
Jack Christensen 9103457384 Improve docs 2023-11-18 07:44:24 -06:00
Jack Christensen 9782306287 Only remove statement from map if deallocate succeeds
https://github.com/jackc/pgx/pull/1795
2023-11-18 07:44:24 -06:00
Jack Christensen 7d5a3969d0 Improve docs and tests 2023-11-18 07:44:24 -06:00
Jack Christensen e5015e2fac pgx.Conn.Deallocate uses PgConn.Deallocate
This uses the PostgreSQL protocol to deallocate a prepared statement
instead of a SQL statement. This allows it to work even in an aborted
transaction.
2023-11-18 07:44:24 -06:00
Jack Christensen 4dbd57a7ed Add PgConn.Deallocate method
This method uses the PostgreSQL protocol Close method to deallocate a
prepared statement. This means that it can succeed in an aborted
transaction.
2023-11-18 07:44:24 -06:00
Jack Christensen 0570b0e196 Better document PgConn.Prepare implementation 2023-11-18 07:44:24 -06:00
Jack Christensen df5d00eb60 Remove PostgreSQL 11 from supported versions 2023-11-11 10:09:47 -06:00