Take a look here first : http://www.postgresql.org/docs/9.2/interactive/datatype-binary.html
then here : http://www.dbforums.com/postgresql/1666200-insert-jpeg-files-into-bytea-column.html
didnt try it myself tho.
Most of the time people manipulate bytea's using a higher level programming lang.
On Πεμ 09 Μαΐ 2013 10:34:35 Nelson Green wrote: On Thu, May 9, 2013 at 10:20 AM, Achilleas Mantzios <achill@xxxxxxxxxxxxxxxxxxxxx> wrote: why not bytea? Hi Achilleas, Actually I was asking if bytea is the correct datatype, and if so, would someone mind providing a simple example of how to insert and retrieve the image through the psql client. Let's say I have an employee named Paul Kendell, who's employee ID is 880918. Their badge number will be PK00880918, and their badge photo is named /tmp/PK00880918.jpg. What would the INSERT statement look like to put that information into the security_badge table, and what would the SELECT statement look like to retrieve that record? Thanks for your time.
much more control, much more information, IMHO. In our DB evolving from an initial 7.1 back in 2001, and currently on 9.0, we have been storing everything binary in bytea's.
There are downsides in both solutions, you just have to have good reasons to not use bytea.
On Πεμ 09 Μαΐ 2013 10:04:18 Nelson Green wrote: Good morning list, - Achilleas Mantzios IT DEV IT DEPT Dynacom Tankers Mgmt - Achilleas Mantzios IT DEV IT DEPT Dynacom Tankers Mgmt |