Bug #655: win32 client and bytea column

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #655: win32 client and bytea column
Дата
Msg-id 20020502165345.E7A69476BF6@postgresql.org
обсуждение исходный текст
Ответы Re: Bug #655: win32 client and bytea column  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-bugs
Krzysztof Stachlewski (stach@toya.net.pl) reports a bug with a severity of 1
The lower the number the more severe it is.

Short Description
win32 client and bytea column

Long Description
I have a problem with using bytea column with PHP.
I am using Apache 1.3.24 on Windows 2000, PHP 4.2.0
installed as Apache module.
PostgreSQL 7.2.1 on Linux (Debian).
When trying to manipulate the bytea column I get the following error:
pg_exec() query failed: pqReadData() -- read() failed: errno=0 No error
The guys from PHP told me this is not a problem with their code, but
with postgresql. (I submitted a bug report to php.net)
The error message is shown only when the code is runned from PHP on
Windows system. Exactly the same code, runned on Linux version
of PHP 4.1.2 causes no
problems at all. The problem does not appear when the amount of
data in the bytea column or data to be inserted into bytea
column is small enough.
"Small enough" seems to be sth about few hundred bytes.
I thought this is a problem with the libpq.dll  - the version of
the one that shipped with PHP was 7.0.2.
I have downloaded the latest source code of Postgres and compiled
the 7.2.1 version of the dll. That didn't solve the problem.

Sample Code
create table bin(id int primary key, dat bytea not null);

php code below:
<?
$connection = pg_connect("your favourite connection string");
$data = base64_encode(str_repeat("example", 1000));
$query = "insert into bin values (1, decode('$data', 'base64'))");
pg_exec($connection, $query)
?>



No file was uploaded with this report

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Re: LIKE Command
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #656: timestamp function generates parsing errors when used as specified in the documentation