Re: [OT] PostgreSQL: bytea help needed.

From: Mike Cox (mikecoxlinux_at_yahoo.com)
Date: 02/04/05


Date: 03 Feb 2005 17:15:57 -0800

mlw <mlw@nospam.no> writes:

> Mike Cox wrote:
>
> > Christopher Browne <cbbrowne@acm.org> writes:
> >
> >> Centuries ago, Nostradamus foresaw when Mike Cox <mikecoxlinux@yahoo.com>
> >> would write:
> >> > Does anyone know how to add data to a bytea in PostgreSQL? I googled
> >> > the archives, and they mostly talk about PHP. I'd like to put binary
> >> > data in the bytea from my local filesystem, but google comes up empty
> >> > other than using PHP.
> >>
> >> Well, you draw the data in, and then append it to the field.
> >
> > Well this is elementary stuff. Lets say I wanted to pull a jpg into
> > the database from my local filesystem for example.
>
> My first reaction would be to say you are insane. Using a database as a file
> system isn't its best used.

You are wrong about this. I'm already using it for every text
document, html page via the COPY command. My goal is to have a WinFS
like filesystem on linux machine. You cannot believe how much better
having all my data stored in a database is. I used to have my home
directory cluttered with various data. It was a complete mess.

Now I just do an SQL search and BAM! I get exactly what I want. It
gets even better when you have the tsearch2 from PostgreSQL Contrib
installed. It is like google search squared!

Now I can search for different types of critera with the speed of an
SQL database engine.

>I would store the file path and name and have a
> separate volume or directory for the image. Especially if you are using
> large images.

Nah. I want to be able to do image matching for similar images, mp3s,
etc. If you can specify something with the "like" command to find similar
binary data, it would be totally awesome. WinFS on my desktop years
before Longhorn EVER comes out with it.



Relevant Pages

  • IE mailmerge application recieving "Access Denied" under Win XP SP
    ... database to produce the form (the users need to be able to also edit the data ... The way I did this was I had an ASP page that was mainly client code. ... the local filesystem with SP2, but the ironic thing is I can WRITE the file ... the document on the web server, but our IT group has said no to having IIS ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Storing word documents, spreadsheets... in SQL database
    ... I'll believe WinFS when I see it. ... BLOBs require serialization so they can be transmitted to the server and stored as TEXT or IMAGE types in the database. ...
    (microsoft.public.vb.database)
  • Re: why>?
    ... of ADP and OLAP just as you'd use them with SQL Server? ... Database as file system ain't new. ... talk of WinFS by years. ... Yup, database as storage subsystem. ...
    (microsoft.public.excel)