Bug #30886
Problems with Postgresql 9
Status: | Closed | Start date: | 2011-10-13 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | DBAL | Spent time: | - | |
Target version: | - | |||
TYPO3 Version: | 4.5 | Is Regression: | No | |
PHP Version: | Sprint Focus: | |||
Complexity: |
Description
I encountered the following problem using typo3 (v. 4.5.6) with postgresql9:
Blobs (data type "bytea") in postgres9 are returned in a HEX-output-format (at least with a default configuration of postgres9).
see: http://www.postgresql.org/docs/9.0/static/datatype-binary.html:
"The bytea type supports two external formats for input and output: PostgreSQL's historical "escape" format, and "hex" format. Both of these are always accepted on input. The output format depends on the configuration parameter bytea_output; the default is hex. (Note that the hex format was introduced in PostgreSQL 9.0; earlier versions and some tools don't understand it.)"
This results in the inability of typo3 to read data from bytea-fields.
Examples would be:
- table "cache_hash", field "content".
(The symtomatic of this is, that a typo3-page is output correctly with an empty cache, but after that only a blank page is returned.
- table "fe_session_data", field "content".
(This results in the inability to return fe-user-session-data, e.g. for extensions, etc.)
A workaround is to change the parameter "bytea_output" of the postgres-config from it's default value "hex" to the value "escape".
But imho, typo3 should also work with a default-installation of postgres.
A different solution would be to set the "bytea_output" for every db-connection. Postgres allows this via the following command:
"set bytea_output to escape". Unfortunatelely a postgres-connection via dbal does not allow a "setDBinit"-configuration, thus a user cannot add this by himself by editing his localconf.php. But a hardcoded solution would probably be better anyway.
But i guess the base of the problem is that adodb is seemingly not fully compatible with postgres9.
Related issues
History
#1 Updated by Ernesto Baschny about 3 years ago
- Target version deleted (
4.5.7) - TYPO3 Version set to 4.5
We have updated AdoDB (5.14) in TYPO3 4.5.8, this problem is fixed? Acording to the Changelog of AdoDB 5.12:
- Postgres: Use pg_unescape_bytea() in _decode.
Source: http://sourceforge.net/projects/adodb/files/adodb-php5-only/adodb-512-for-php5/
So this is potentially fixed already. Could you please re-check? Thanks!
#2 Updated by Michael Stucki over 1 year ago
- Category deleted (
PostgreSQL)
#3 Updated by Michael Stucki over 1 year ago
- Project changed from DBAL to Core
#4 Updated by Michael Stucki over 1 year ago
- Category set to DBAL
#5 Updated by Mathias Schreiber 6 months ago
- Status changed from New to Closed
- Is Regression set to No
We will continue in the Epic #64459. I think 99% of these reports can be drilled down to the same root cause.