Advertisement

07.23.2008 at 04:36PM PDT, ID: 23590581
[x]
Attachment Details

Store binary files with PostgreSQL

Asked by Luxana in PostgreSQL Database, Linux, Perl Programming Language

Tags: PostgreSQL, 8.1

Hello,

can someone provide me with hints on how to store binary files with postgreSQL. I have followed this short perl tutorial. http://www.linuxconfig.org/Simple_Perl_example_how_to_store_and_retrieve_binary_file_in_and_from_the_postgresql_database

It works and I'm able to store and retrieve data using the scripts on that page. However I have error messages coming up on my stderr:
DBD::Pg::st execute failed: ERROR:  invalid byte sequence for encoding
"UTF8": 0x8b

where I'm trying to store gziped file. This I assume is because I need to escape binary strings before storing them on UTF8 ( Unicode ) database.  This can mean that escape_bytea subroutine is not working properly.

can anyone help in this matter?

thank you

luboStart Free Trial
[+][-]07.23.2008 at 04:42PM PDT, ID: 22074950

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2008 at 04:12AM PDT, ID: 22097993

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PostgreSQL Database, Linux, Perl Programming Language
Tags: PostgreSQL, 8.1
Sign Up Now!
Solution Provided By: Luxana
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628