Skip site navigation (1) Skip section navigation (2)

pg_[un]escape_bytea, pgsql 8.2.1, php 5.1.6, Linux

From: "Gary Chambers" <gwchamb(at)gmail(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: pg_[un]escape_bytea, pgsql 8.2.1, php 5.1.6, Linux
Date: 2007-02-02 02:27:23
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-php

Apache 2.2.3, PostgreSQL 8.2.1, PHP 5.1.6, Linux

I have inserted (via pg_query_params) into a bytea field some binary
data (a JPEG image in this case) which I have escaped using
pg_escape_bytea.  It appears, however, that the extracted data is
corrupt (NOT unescaped, more precisely), even after unescaping it with
pg_unescape_bytea.  If I perform another (a subsequent)
pg_unescape_bytea, it appears to be partially unescaped, but there
still remain errors because the rest of the image is severely
distorted -- but minimally recognizeable as part of the original
image.  What am I missing?  I'm using the lo_* functions as an
alternative, but it's hard to dismiss the ease with which it appears
to deal with binary data with a bytea field.

Many thanks in advance!

-- Gary Chambers

// Nothing fancy and nothing Microsoft!


pgsql-php by date

Next:From: ellisDate: 2007-02-02 05:32:59
Subject: Re: pg_[un]escape_bytea, pgsql 8.2.1, php 5.1.6, Linux
Previous:From: Robert TreatDate: 2006-12-31 15:13:00
Subject: phppgadmin-4.1-Beta-1 released

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group