By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,649 Members | 696 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,649 IT Pros & Developers. It's quick & easy.

Storing images in a field

P: n/a
Hi All,
I use PG 7.3.2 an 7.4.1 on RH 7.1.
I'd like to store small (~ 100x100 px jpeg, or gif) images in a field in
binary format.
I tried to understand the documentation of the large objects but I'm afraid
I coluldn't.
I found some functions to import and export binary files into the db, but
these functions work on the server side.
How can I insert a block of binary data into a given field form the client
(WinXP, pgsqlODBC 7.03.01)? And on the other side how can I retrive that
data from there, how can I delete or modifay that?

In general which data type is the most powerful for this. The only purpose
of this field to store a photo or drawing of the product represented by the
record. It's not required to be parsed. Is it possible to have it compressed
or it should be done by the client?

Thank you,

-- Csaba Egyd
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Monday 19 April 2004 16:28, Egyd Csaba wrote:
Hi All,
I use PG 7.3.2 an 7.4.1 on RH 7.1.
I'd like to store small (~ 100x100 px jpeg, or gif) images in a field in
binary format. How can I insert a block of binary data into a given field form the client
(WinXP, pgsqlODBC 7.03.01)? And on the other side how can I retrive that
data from there, how can I delete or modifay that?

In general which data type is the most powerful for this. The only purpose
of this field to store a photo or drawing of the product represented by the
record. It's not required to be parsed. Is it possible to have it
compressed or it should be done by the client?


Well there are two options: bytea or text (where you encode the image yourself
to make sure it contains only permitted values - e.g. with base64). Which one
you use depends on your client code.

If you look in the mailing list archives you'll see plenty of discussion of
this.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.