Re: binary cursor returning truncated data

From: Eric Mauvière <e(dot)mauviere(at)geoclip(dot)fr>
To: <pgsql-php(at)postgresql(dot)org>
Subject: Re: binary cursor returning truncated data
Date: 2006-04-18 08:01:10
Message-ID: 015501c662be$419d6460$0200a8c0@EMC3
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Thank you Michael,
for that confirmation

I reported the bug to the PHP team, and they issued a patch.

I would also suggest to postgres developpers to simplify their code and go
back to SQL standards :)
That BINARY CURSOR thing should be avoided. With MySQL for instance, a
cursor will read the same way any type of data, binary or text.

Best regards,

Eric Mauvière

----- Original Message -----
From: "Michael Fuhr" <mike(at)fuhr(dot)org>
To: "Eric Mauvière" <e(dot)mauviere(at)geoclip(dot)fr>
Cc: <pgsql-php(at)postgresql(dot)org>
Sent: Sunday, April 16, 2006 6:39 PM
Subject: Re: [PHP] binary cursor returning truncated data

> On Wed, Apr 12, 2006 at 04:21:49PM +0200, Eric Mauvire wrote:
>> i am trying to retrieve binary content of a bytea field (or postgis
>> geometry field) with a binary cursor with PHP :
>>
>> $sql="BEGIN;DECLARE mycursor BINARY CURSOR FOR SELECT shape FROM
>> $layerName; fetch all in mycursor;"
>> ....pg_query...
>>
>> But my shape field shows only two bytes of data.
>
> The PHP source code (ext/pgsql/pgsql.c) doesn't have any calls to
> PQfformat or PQbinaryTuples so PHP appears to expect text data.
> Looks like you'll have to fetch data in text format and use
> pg_unescape_bytea.
>
> Maybe the PHP developers would consider adding support for binary
> data (or maybe they already have and rejected the idea; I don't
> know). Try asking on a PHP mailing list.
>
> --
> Michael Fuhr
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>
>

In response to

Responses

Browse pgsql-php by date

  From Date Subject
Next Message Christopher Kings-Lynne 2006-04-18 08:28:20 Re: binary cursor returning truncated data
Previous Message Michael Fuhr 2006-04-16 16:39:32 Re: binary cursor returning truncated data