Permalink
Browse files

Fix compatibility with PostgreSQL 9.x: bytea output.

The issue that hit many (most?) of PostgreSQL adapters is that libpq-8.x
is unable to unescape bytea data from results in text format received
from PostgreSQL-9.x.

But we're always passing bytea data as is to the client (either from
results in binary format when using "postgres_output binary_value"
or escaped from results in text format), so this isn't problem for us.

Patch from Yichun Zhang (agentzh).
  • Loading branch information...
1 parent 7c1cde3 commit c7d6a04e4ba9eb238e8b0a181e0953bd7bddcd5d @PiotrSikora PiotrSikora committed Nov 10, 2011
Showing with 2 additions and 5 deletions.
  1. +0 −3 TODO.md
  2. +2 −2 t/output.t
View
@@ -1,8 +1,5 @@
Features that sooner or later will be added to `ngx_postgres`:
-* Make sure that we work-around `bytea` data corruption that takes place
- when using 9.0+ database with older client library or vice-versa.
-
* Add support for SSL connections to the database.
* Add support for dropping of idle keep-alived connections to the
View
@@ -292,8 +292,8 @@ GET /postgres
--- error_code: 200
--- response_headers
Content-Type: text/plain
---- response_body chomp
-\001
+--- response_body_like chomp
+^(?:\\001|\\x01)$
--- timeout: 10

0 comments on commit c7d6a04

Please sign in to comment.