Re: [INTERFACES] Re: I am facing a difficult problem..

From: James Olin Oden <joden(at)lee(dot)k12(dot)nc(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Adam Haberlach <haberlaa(at)ricochet(dot)net>, PostgreSQL Interfaces <pgsql-interfaces(at)postgreSQL(dot)org>, steve(at)blast(dot)com
Subject: Re: [INTERFACES] Re: I am facing a difficult problem..
Date: 1999-03-29 16:47:46
Message-ID: 36FFAEB1.45E06316@lee.k12.nc.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Tom Lane wrote:

> Adam Haberlach <haberlaa(at)ricochet(dot)net> writes:
> > I would like to know if there is a simple solution to this as well,
> > or if it will be addressed in the future.
>
> It'll probably get fixed someday, but the solution is not trivial;
> don't hold your breath. I'd guess that it might happen two or three
> releases from now, say six months to a year away. (This has been
> discussed many times before, so check the pgsql-hackers list archives
> if you want details about the technical issues.)
>
> In the meantime, your options for large text fields are (1) split them
> into multiple database records, or (2) store them in "large objects".
> Both are pretty ugly :-(
>
> regards, tom lane

Of course you can store them in your file system as separate files and store
their filename as a column in a table. This approach eats up inodes pretty
quickly, though, so its not the best solution. I recently thought of another
option; instead of storing them as separate files do the following:

1) Write out a file with a unique name (one that is unique to the table in
which you store the name).
2) Now run "ar" and insert the file into an archive named after the column
in the database:

ar r archive filename

3) Now delete the file from the file system.

When you want to retrieve this file from the archive type:

ar p archive filename

When you want to update just repeat the same process as above.

Normally, "ar" is used to create libraries of object files; the thing is that
is it's "normal" use but it will create an _updatable_ archive of any type of
file (text files being the ones in question now).

Cheers...james

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Mount 1999-03-30 08:55:17 Contacting me
Previous Message Wojciech Kromer 1999-03-29 16:19:01 [INTERFACES] type error inserting large obj, Win32 ODBC