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

Re: Storing Binary Large Objects

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Mark Wong <markwkm(at)gmail(dot)com>
Cc: "Rich Shepard" <rshepard(at)appl-ecosys(dot)com>, pdxpug(at)postgresql(dot)org
Subject: Re: Storing Binary Large Objects
Date: 2007-03-29 18:00:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pdxpug
On Mar 29, 2007, at 08:35, Mark Wong wrote:

> On paper, using bytea looks more straightforward the oid datatype.
> Does bytea have its own difficulties, other than having to find a way
> to escape the data?

Only that it's not chunked, so when you do a select, you get the  
entire data back, not just a pointer. That's the primary difference,  

Tools like DBD::Pg do the escaping for you, provided you tell them  
that it's bytea:

   my $sth = $dbh->prepare('INSERT INTO foo (bytea_col) VALUES(?)');
   $sth->bind_param(1, $binary_data, { pg_type => DBD::Pg::PG_BYTEA });



In response to

pdxpug by date

Next:From: Thomas J KellerDate: 2007-03-30 17:38:06
Subject: data integrity
Previous:From: Ian BurrellDate: 2007-03-29 17:37:13
Subject: Re: Storing Binary Large Objects

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