storing binary data - Mailing list pgsql-hackers

From Jason Orendorff
Subject storing binary data
Date
Msg-id HFEKILOLEFEFMKAECNDLOEJMCAAA.jason@jorendorff.com
Whole thread Raw
Responses Re: storing binary data
Re: storing binary data
Re: storing binary data
List pgsql-hackers
Reply-To: sender

Hi.  I was surprised to discover today that postgres's
character types don't support zero bytes.  That is,
Postgres isn't 8-bit clean.  Why is that?

More to the point, I need to store about 1k bytes per row
of varying-length 8-bit binary data.  I have a few options:
+ BLOBs.  PostgreSQL BLOBs make me nervous.  I worry about  the BLOB not being deleted when the corresponding row in
thetable is deleted.  The documentation is vague.
 
+ What I really need is a binary *short* object type.  I have heard rumors of a legendary "bytea" type that might  help
me,but it doesn't appear to be documented anywhere,  so I hesitate to use it.
 
+ I can base64-encode the data and store it in a "text"  field.  But postgres is a great big data-storage system;
surelyit can store binary data without resorting to  this kind of hack.
 

What should I do?  Please help.  Thanks!

-- 
Jason Orendorff

P.S.  I would love to help improve PostgreSQL's documentation.     Whom should I contact?



pgsql-hackers by date:

Previous
From: "Steven Vajdic"
Date:
Subject: PostgreSQL 7.1.3 installation on Windows platforms
Next
From: Bill Studenmund
Date:
Subject: For John Havard, please ignore otherwise