From e.mauviere@emc3.fr Wed Apr 12 14:53:28 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id 1016411F6934 for ; Wed, 12 Apr 2006 11:53:28 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -0.049 X-Spam-Level: X-Spam-Status: No, score=-0.049 required=5 tests=[BAYES_40=-0.185, FORGED_RCVD_HELO=0.135, HTML_MESSAGE=0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id G81LaSnKi9Yq for ; Wed, 12 Apr 2006 11:53:17 -0300 (ADT) X-Greylist: delayed 00:32:28.634292 by SQLgrey- Received: from emc3.fr (unknown [62.23.182.143]) by postgresql.org (Postfix) with ESMTP id 34D7511F68FF for ; Wed, 12 Apr 2006 11:53:14 -0300 (ADT) Received: from EMC3 [82.125.154.40] by emc3.fr with ESMTP (SMTPD32-8.15) id ACB520002F8; Wed, 12 Apr 2006 16:20:37 +0200 Message-ID: <01e001c65e3c$3e9070e0$0200a8c0@EMC3> From: =?iso-8859-1?Q?Eric_Mauvi=E8re?= To: Subject: binary cursor returning truncated data Date: Wed, 12 Apr 2006 16:20:17 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01DD_01C65E4C.FCCC9830" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Archive-Number: 200604/10 X-Sequence-Number: 3480 This is a multi-part message in MIME format. ------=_NextPart_000_01DD_01C65E4C.FCCC9830 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, i am trying to retrieve binary content of a bytea field (or postgis = geometry field) with a binary cursor with PHP : $sql=3D"BEGIN;DECLARE mycursor BINARY CURSOR FOR SELECT shape FROM = $layerName; fetch all in mycursor;" ....pg_query...=20 But my shape field shows only two bytes of data. =20 Does someone know if it is a current PHP restriction ? Thanks by advance, Eric ------=_NextPart_000_01DD_01C65E4C.FCCC9830 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
 
i am trying to retrieve binary content = of a bytea=20 field (or postgis geometry field) with a binary cursor with PHP = :
 
$sql=3D"BEGIN;DECLARE mycursor BINARY = CURSOR FOR=20 SELECT shape FROM $layerName; fetch all in mycursor;"
....pg_query...
 
But my shape field shows only two = bytes of=20 data.
 
Does someone know if it is a current = PHP=20 restriction ?
 
Thanks by advance,
 
Eric
------=_NextPart_000_01DD_01C65E4C.FCCC9830-- From e.mauviere@geoclip.fr Wed Apr 12 14:22:11 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 12C8811F6931 for ; Wed, 12 Apr 2006 11:22:11 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.001 X-Spam-Level: X-Spam-Status: No, score=0.001 required=5 tests=[HTML_MESSAGE=0.001] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id HVjAd4r3ZNRm for ; Wed, 12 Apr 2006 11:21:57 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id B2C1211F6928 for ; Wed, 12 Apr 2006 11:22:01 -0300 (ADT) Received: from smtp10.wanadoo.fr (smtp10.wanadoo.fr [193.252.22.21]) by svr4.postgresql.org (Postfix) with ESMTP id DABF45AF84C for ; Wed, 12 Apr 2006 14:22:02 +0000 (GMT) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1009.wanadoo.fr (SMTP Server) with ESMTP id 4E81E2800122 for ; Wed, 12 Apr 2006 16:21:59 +0200 (CEST) Received: from EMC3 (AToulouse-152-1-44-40.w82-125.abo.wanadoo.fr [82.125.154.40]) by mwinf1009.wanadoo.fr (SMTP Server) with SMTP id 1D6FA280012B for ; Wed, 12 Apr 2006 16:21:59 +0200 (CEST) X-ME-UUID: 20060412142159120.1D6FA280012B@mwinf1009.wanadoo.fr Message-ID: <020401c65e3c$70721050$0200a8c0@EMC3> From: =?iso-8859-1?Q?Eric_Mauvi=E8re?= To: Subject: binary cursor returning truncated data Date: Wed, 12 Apr 2006 16:21:49 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0201_01C65E4D.33A9DA20" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Archive-Number: 200604/8 X-Sequence-Number: 3478 This is a multi-part message in MIME format. ------=_NextPart_000_0201_01C65E4D.33A9DA20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, i am trying to retrieve binary content of a bytea field (or postgis = geometry field) with a binary cursor with PHP : $sql=3D"BEGIN;DECLARE mycursor BINARY CURSOR FOR SELECT shape FROM = $layerName; fetch all in mycursor;" ....pg_query...=20 But my shape field shows only two bytes of data. Does someone know if it is a current PHP restriction ? Thanks by advance, Eric ------=_NextPart_000_0201_01C65E4D.33A9DA20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
 
i am trying to retrieve binary content = of a bytea=20 field (or postgis geometry field) with a binary cursor with PHP = :
 
$sql=3D"BEGIN;DECLARE mycursor BINARY = CURSOR FOR=20 SELECT shape FROM $layerName; fetch all in mycursor;"
....pg_query...
 
But my shape field shows only two = bytes of=20 data.
 
Does someone know if it is a current = PHP=20 restriction ?
 
Thanks by advance,
 
Eric =
------=_NextPart_000_0201_01C65E4D.33A9DA20-- From mike@fuhr.org Sun Apr 16 16:39:42 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 6261B11F66F8 for ; Sun, 16 Apr 2006 13:39:42 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.132 X-Spam-Level: X-Spam-Status: No, score=0.132 required=5 tests=[AWL=0.132] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id riswRC5fOCYm for ; Sun, 16 Apr 2006 13:39:39 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id 16B4E11F66EC for ; Sun, 16 Apr 2006 13:39:39 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id k3GGdYfB042024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 16 Apr 2006 10:39:36 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id k3GGdXh0033601; Sun, 16 Apr 2006 10:39:33 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id k3GGdWFa033600; Sun, 16 Apr 2006 10:39:32 -0600 (MDT) (envelope-from mfuhr) Date: Sun, 16 Apr 2006 10:39:32 -0600 From: Michael Fuhr To: Eric =?iso-8859-1?Q?Mauvi=E8re?= Cc: pgsql-php@postgresql.org Subject: Re: binary cursor returning truncated data Message-ID: <20060416163932.GA30082@winnie.fuhr.org> References: <020401c65e3c$70721050$0200a8c0@EMC3> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <020401c65e3c$70721050$0200a8c0@EMC3> X-Archive-Number: 200604/9 X-Sequence-Number: 3479 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 From e.mauviere@geoclip.fr Tue Apr 18 08:24:45 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id F25B611F7AF3 for ; Tue, 18 Apr 2006 05:24:45 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.599 X-Spam-Level: X-Spam-Status: No, score=-2.599 required=5 tests=[BAYES_00=-2.599] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id abBCKtTfjEKk for ; Tue, 18 Apr 2006 05:24:36 -0300 (ADT) X-Greylist: delayed 00:23:09.911319 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 4B7F711F76EA for ; Tue, 18 Apr 2006 05:24:28 -0300 (ADT) Received: from smtp9.wanadoo.fr (smtp9.wanadoo.fr [193.252.22.22]) by svr4.postgresql.org (Postfix) with ESMTP id E71DF5AF836 for ; Tue, 18 Apr 2006 08:01:19 +0000 (GMT) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0909.wanadoo.fr (SMTP Server) with ESMTP id A16A52400114 for ; Tue, 18 Apr 2006 10:01:16 +0200 (CEST) Received: from EMC3 (AToulouse-152-1-74-109.w83-200.abo.wanadoo.fr [83.200.174.109]) by mwinf0909.wanadoo.fr (SMTP Server) with SMTP id 69AF12400102 for ; Tue, 18 Apr 2006 10:01:16 +0200 (CEST) X-ME-UUID: 20060418080116433.69AF12400102@mwinf0909.wanadoo.fr Message-ID: <015501c662be$419d6460$0200a8c0@EMC3> From: =?iso-8859-1?Q?Eric_Mauvi=E8re?= To: References: <020401c65e3c$70721050$0200a8c0@EMC3> <20060416163932.GA30082@winnie.fuhr.org> Subject: Re: binary cursor returning truncated data Date: Tue, 18 Apr 2006 10:01:10 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Archive-Number: 200604/11 X-Sequence-Number: 3481 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" To: "Eric Mauvière" Cc: 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@postgresql.org so that your > message can get through to the mailing list cleanly > > From chris.kings-lynne@calorieking.com Tue Apr 18 08:28:13 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id AA10911F602E for ; Tue, 18 Apr 2006 05:28:13 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.224 X-Spam-Level: X-Spam-Status: No, score=0.224 required=5 tests=[AWL=0.224] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 1Qi-iUPb3h+l for ; Tue, 18 Apr 2006 05:28:09 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from houston.familyhealth.com.au (houston.au.fhnetwork.com [203.22.197.21]) by postgresql.org (Postfix) with ESMTP id B1F1E11F6C96 for ; Tue, 18 Apr 2006 05:28:09 -0300 (ADT) Received: from houston.familyhealth.com.au (localhost [127.0.0.1]) by houston.familyhealth.com.au (Postfix) with ESMTP id 347292542F; Tue, 18 Apr 2006 16:28:05 +0800 (WST) Received: from [127.0.0.1] (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (Postfix) with ESMTP id 3FC47253E9; Tue, 18 Apr 2006 16:28:03 +0800 (WST) Message-ID: <4444A324.20904@calorieking.com> Date: Tue, 18 Apr 2006 16:28:20 +0800 From: Christopher Kings-Lynne User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Eric_Mauvi=E8re?= Cc: pgsql-php@postgresql.org Subject: Re: binary cursor returning truncated data References: <020401c65e3c$70721050$0200a8c0@EMC3> <20060416163932.GA30082@winnie.fuhr.org> <015501c662be$419d6460$0200a8c0@EMC3> In-Reply-To: <015501c662be$419d6460$0200a8c0@EMC3> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-familyhealth-MailScanner-Information: Please contact the ISP for more information X-familyhealth-MailScanner: Found to be clean X-familyhealth-MailScanner-From: chris.kings-lynne@calorieking.com X-Archive-Number: 200604/12 X-Sequence-Number: 3482 > 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. I think you're rather confused. The BINARY CURSOR is for emitted binary data, not reading it. If you declare a normal cursor over a binary (bytea) field, you will get its text representation quite happily. Chris From e.mauviere@geoclip.fr Tue Apr 18 08:44:35 2006 X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (mx2.hub.org [200.46.204.254]) by postgresql.org (Postfix) with ESMTP id B08A411F6CEC for ; Tue, 18 Apr 2006 05:44:35 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: -2.549 X-Spam-Level: X-Spam-Status: No, score=-2.549 required=5 tests=[AWL=0.050, BAYES_00=-2.599] Received: from postgresql.org ([200.46.204.71]) by localhost (mx2.hub.org [200.46.204.254]) (amavisd-new, port 10024) with ESMTP id RgIg2BKUoo9U for ; Tue, 18 Apr 2006 05:44:29 -0300 (ADT) X-Greylist: delayed 00:43:09.169541 by SQLgrey- Received: from smtp9.wanadoo.fr (smtp9.wanadoo.fr [193.252.22.22]) by postgresql.org (Postfix) with ESMTP id 3336F11F6CCD for ; Tue, 18 Apr 2006 05:44:27 -0300 (ADT) Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf0902.wanadoo.fr (SMTP Server) with ESMTP id 0C0A31C001E5 for ; Tue, 18 Apr 2006 10:44:27 +0200 (CEST) Received: from EMC3 (AToulouse-152-1-74-109.w83-200.abo.wanadoo.fr [83.200.174.109]) by mwinf0902.wanadoo.fr (SMTP Server) with SMTP id D10B91C001C9 for ; Tue, 18 Apr 2006 10:44:26 +0200 (CEST) X-ME-UUID: 20060418084426856.D10B91C001C9@mwinf0902.wanadoo.fr Message-ID: <019601c662c4$49f171f0$0200a8c0@EMC3> From: =?iso-8859-1?Q?Eric_Mauvi=E8re?= To: References: <020401c65e3c$70721050$0200a8c0@EMC3> <20060416163932.GA30082@winnie.fuhr.org> <015501c662be$419d6460$0200a8c0@EMC3> <4444A324.20904@calorieking.com> Subject: Re: binary cursor returning truncated data Date: Tue, 18 Apr 2006 10:44:21 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-Archive-Number: 200604/13 X-Sequence-Number: 3483 Hello Christopher, i simply want to retrieve the content of a binary field in a Postgresql table, and use that information in a PHP script. That binary field contains binary information that must be read with PHP binary functions (unpack). The current way : POSTGRES cursor -> text version of the binary field in PHP -> conversion back to a binary string with pg_unescape_bytea is tedious and brings performance issues. best regards, Eric Mauvière ----- Original Message ----- From: "Christopher Kings-Lynne" To: "Eric Mauvière" Cc: Sent: Tuesday, April 18, 2006 10:28 AM Subject: Re: [PHP] binary cursor returning truncated data >> 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. > > I think you're rather confused. The BINARY CURSOR is for emitted binary > data, not reading it. If you declare a normal cursor over a binary > (bytea) field, you will get its text representation quite happily. > > Chris > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > > From samokhvalov@gmail.com Thu Sep 7 09:14:35 2006 X-Original-To: pgsql-php-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 6946C9FA4CB for ; Thu, 7 Sep 2006 06:14:35 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 95302-03-8 for ; Thu, 7 Sep 2006 09:14:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.202]) by postgresql.org (Postfix) with ESMTP id CF1829FA5CE for ; Thu, 7 Sep 2006 06:13:18 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id 14so59897nzn for ; Thu, 07 Sep 2006 02:13:17 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=jayy00rUs3vT1krlNNvsLbWuLEDYN8AmQBZFbzB/QX5UFoyKfMJmbJnm0A9WuCJqozZXC3DWmNfF14GJxl/8yFVahhlimOZHtJXU0gDovSynCYVRfZU/g+n+/Bw5MG28j0LasA9Z/s5FM3vJDL0QlT5ALWg09X//wzWADcvcKE4= Received: by 10.65.122.15 with SMTP id z15mr317486qbm; Thu, 07 Sep 2006 02:13:17 -0700 (PDT) Received: by 10.64.250.15 with HTTP; Thu, 7 Sep 2006 02:13:17 -0700 (PDT) Message-ID: Date: Thu, 7 Sep 2006 13:13:17 +0400 From: "Nikolay Samokhvalov" Reply-To: nikolay@samokhvalov.com To: "=?ISO-8859-1?Q?Eric_Mauvi=E8re?=" Subject: Re: binary cursor returning truncated data Cc: pgsql-php@postgresql.org In-Reply-To: <019601c662c4$49f171f0$0200a8c0@EMC3> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <020401c65e3c$70721050$0200a8c0@EMC3> <20060416163932.GA30082@winnie.fuhr.org> <015501c662be$419d6460$0200a8c0@EMC3> <4444A324.20904@calorieking.com> <019601c662c4$49f171f0$0200a8c0@EMC3> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200609/1 X-Sequence-Number: 3598 Is this issue still open? Some guys say me that they experience similar troubles and this may prevent them from migrating from OneBigWellKnownDBMS to Postgres. On 4/18/06, Eric Mauvi=E8re wrote: > Hello Christopher, > > i simply want to retrieve the content of a binary field in a Postgresql > table, and use that information in a PHP script. > That binary field contains binary information that must be read with PHP > binary functions (unpack). > > The current way : POSTGRES cursor -> text version of the binary field in > PHP -> conversion back to a binary string with pg_unescape_bytea > is tedious and brings performance issues. > > best regards, > > Eric Mauvi=E8re > > ----- Original Message ----- > From: "Christopher Kings-Lynne" > To: "Eric Mauvi=E8re" > Cc: > Sent: Tuesday, April 18, 2006 10:28 AM > Subject: Re: [PHP] binary cursor returning truncated data > > > >> 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 an= d > >> 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. > > > > I think you're rather confused. The BINARY CURSOR is for emitted binar= y > > data, not reading it. If you declare a normal cursor over a binary > > (bytea) field, you will get its text representation quite happily. > > > > Chris > > > > > > > > ---------------------------(end of broadcast)--------------------------= - > > TIP 5: don't forget to increase your free space map settings > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match > --=20 Best regards, Nikolay