Search Postgresql Archives

queriing the version of libpq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With 9.0 there is the new hex encoding for BYTEA, which is activated by default.

libpq BEFORE 9.0 are not able to decode that encoding.Â

I am programming with Python, using psycopg2. When psycopg2 is linked with libpq 9.0, everything works fine with hex-encoding; if psycopg2 is linked with libpq < 9.0, decoding hex-encoded bytea fails (it stays hexencoded).

This happens because in default configuration psycopg2 calls the libpq-decode-encoded-bytea function (which is the way it should be done). Â

Now I would love to have an additional check "is the used psycopg2 linked to an advanced-enough libpq", to be able to set bytea_output to 'escape' if the libpq is not worthy.

My question: Which way is available to query the linked libpq version?Â

My other option is toÂselect 'something_that_gets_casted_to_bytea'::bytea, and check the return value. BUT that requires a round-trip to the server....

Harald
--
GHUM GmbH
Harald Armin Massa
Spielberger StraÃe 49
70435 Stuttgart
0173/9409607

Amtsgericht Stuttgart, HRB 734971
-
persuadere.
et programmare

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux