Re: [GENERAL] Storing small image files

2013-05-10 Thread Eduardo Morras
Hi Nelson. I worked with images and Postgresql, and want to add some comments: On Thu, 9 May 2013 13:40:15 -0500 Nelson Green nelsongree...@gmail.com wrote: OK, this is kind of convoluted, but I got a couple of test cases that work for me. The steps to make the first one are below. First I

Re: [GENERAL] Storing small image files

2013-05-10 Thread Thomas Kellerer
Nelson Green wrote on 09.05.2013 19:05: On Thu, May 9, 2013 at 10:51 AM, Achilleas Mantzios wrote: then here : http://www.dbforums.com/postgresql/1666200-insert-jpeg-files-into-bytea-column.html Thanks Achilleas. I usually do the physical design in vi using sql scripts, and I like to include a

Re: [GENERAL] Storing small image files

2013-05-10 Thread Misa Simic
2013/5/10 Eduardo Morras emorr...@yahoo.es Hi Nelson. I worked with images and Postgresql, and want to add some comments: On Thu, 9 May 2013 13:40:15 -0500 Nelson Green nelsongree...@gmail.com wrote: OK, this is kind of convoluted, but I got a couple of test cases that work for me. The

Re: [GENERAL] Storing small image files

2013-05-10 Thread Nelson Green
On Fri, May 10, 2013 at 2:59 AM, Eduardo Morras emorr...@yahoo.es wrote: Hi Nelson. I worked with images and Postgresql, and want to add some comments: On Thu, 9 May 2013 13:40:15 -0500 Nelson Green nelsongree...@gmail.com wrote: OK, this is kind of convoluted, but I got a couple of test

Re: [GENERAL] Storing small image files

2013-05-10 Thread Nelson Green
On Fri, May 10, 2013 at 5:24 AM, Misa Simic misa.si...@gmail.com wrote: 2013/5/10 Eduardo Morras emorr...@yahoo.es Hi Nelson. I worked with images and Postgresql, and want to add some comments: On Thu, 9 May 2013 13:40:15 -0500 Nelson Green nelsongree...@gmail.com wrote: OK, this is

Re: [GENERAL] Storing small image files

2013-05-09 Thread Achilleas Mantzios
why not bytea? 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 Μαΐ

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
On Thu, May 9, 2013 at 10:20 AM, Achilleas Mantzios ach...@matrix.gatewaynet.com 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

Re: [GENERAL] Storing small image files

2013-05-09 Thread Achilleas Mantzios
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

Re: [GENERAL] Storing small image files

2013-05-09 Thread Karl Denninger
On 5/9/2013 10:51 AM, Achilleas Mantzios wrote: 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

Re: [GENERAL] Storing small image files

2013-05-09 Thread Karl Denninger
On 5/9/2013 11:12 AM, Karl Denninger wrote: On 5/9/2013 10:51 AM, Achilleas Mantzios wrote: 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

Re: [GENERAL] Storing small image files

2013-05-09 Thread Alvaro Herrera
Karl Denninger escribió: To encode: write_conn = Postgresql communication channel in your software that is open to write to the table char*out; size_tout_length, badge_length; badge_length = function-to-get-length-of(badge_binary_data); /* You have to know how long

Re: [GENERAL] Storing small image files

2013-05-09 Thread Karl Denninger
On 5/9/2013 11:34 AM, Alvaro Herrera wrote: Karl Denninger escribió: To encode: write_conn = Postgresql communication channel in your software that is open to write to the table char*out; size_tout_length, badge_length; badge_length =

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
On Thu, May 9, 2013 at 10:51 AM, Achilleas Mantzios ach...@matrix.gatewaynet.com wrote: ** 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

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
Thanks Karl, but I'm trying to do this from a psql shell. I can't use the C functions there, can I? On Thu, May 9, 2013 at 11:21 AM, Karl Denninger k...@denninger.net wrote: On 5/9/2013 11:12 AM, Karl Denninger wrote: On 5/9/2013 10:51 AM, Achilleas Mantzios wrote: Take a look here first

Re: [GENERAL] Storing small image files

2013-05-09 Thread Misa Simic
2013/5/9 Nelson Green nelsongree...@gmail.com Thanks Karl, but I'm trying to do this from a psql shell. I can't use the C functions there, can I? On Thu, May 9, 2013 at 11:21 AM, Karl Denninger k...@denninger.netwrote: On 5/9/2013 11:12 AM, Karl Denninger wrote: On 5/9/2013 10:51 AM,

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
On Thu, May 9, 2013 at 12:05 PM, Nelson Green nelsongree...@gmail.comwrote: On Thu, May 9, 2013 at 10:51 AM, Achilleas Mantzios ach...@matrix.gatewaynet.com wrote: ** Take a look here first : http://www.postgresql.org/docs/9.2/interactive/datatype-binary.html then here :

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
Hi Misa, That gives me a ERROR: must be superuser to use server-side lo_import() on the client. I think this is enforced to preserve file permissions on the server? I appreciate the suggestion, and I will keep it, but I think I found a solution that meets my immediate need. Thanks! On Thu,

Re: [GENERAL] Storing small image files

2013-05-09 Thread Misa Simic
2013/5/9 Nelson Green nelsongree...@gmail.com Hi Misa, That gives me a ERROR: must be superuser to use server-side lo_import() on the client. I think this is enforced to preserve file permissions on the server? I appreciate the suggestion, and I will keep it, but I think I found a solution

Re: [GENERAL] Storing small image files

2013-05-09 Thread Nelson Green
Thanks Misa, for confirming my suspicions about server permissions. Like I said, what I came up will work for my simple needs. I have a script that creates the table, inserts a test row, and successfully retrieves it, which is all I need at this point. I appreciate all the help from everyone.

Re: [GENERAL] Storing small image files

2013-05-09 Thread Karl Denninger
On 5/9/2013 12:08 PM, Nelson Green wrote: Thanks Karl, but I'm trying to do this from a psql shell. I can't use the C functions there, can I? On Thu, May 9, 2013 at 11:21 AM, Karl Denninger k...@denninger.net mailto:k...@denninger.net wrote: On 5/9/2013 11:12 AM, Karl Denninger wrote: