Insert image into bytea question - Mailing list pgsql-novice

From George Roberge
Subject Insert image into bytea question
Date
Msg-id 1398904752.5570.0.camel@debian
Whole thread Raw
Responses Re: Insert image into bytea question  (David G Johnston <david.g.johnston@gmail.com>)
Re: Insert image into bytea question  (Chris Campbell <ccampbell@cascadeds.com>)
List pgsql-novice
Greetings, all.

This might be a stupid question, but I have not found one good post or article on the syntax for inserting an image into a PostgreSQL table bytea field on the Internet.

I am currently learning version 9.1, which I had read should work pretty well for inserting and retrieving images in the bytea format, but i don't know how.  I have seen examples of the bytea_import command (which I couldn't get to work), and other posts that state that the image must be encoded  using a "SELECT encode(XXXX)" statement in the query.  I had originally intended to store the location of the image into a field in the database and just pull that reference from the table, and was hopeful when I saw that PostgreSQL can handle storing images directly, and that it may be even be the preferred method in some cases.

I have been looking online for a couple of hours and have left the Net about as confused as when I started!  I think that some of the reason is that this appears to be a newer method of doing things, and I have been reading older information.

Any guidance that anyone can offer would be greatly appreciated.
George R.

pgsql-novice by date:

Previous
From: Rajmohan C
Date:
Subject: hooks not working in postgresql 9.3 (building from source)
Next
From: David G Johnston
Date:
Subject: Re: Insert image into bytea question