Re: How to store text files in the postgresql? - Mailing list pgsql-general

From Emanuel Calvo Franco
Subject Re: How to store text files in the postgresql?
Date
Msg-id f205bb120906120653x72eea583m42c73319c5fd2dfc@mail.gmail.com
Whole thread Raw
In response to How to store text files in the postgresql?  (DimitryASuplatov <genesup@gmail.com>)
Responses Re: How to store text files in the postgresql?
List pgsql-general
2009/6/6 DimitryASuplatov <genesup@gmail.com>:
> Hello,
>
> I am very new to postgresql database. I`ve used a little of MySql
> previously.
>
> My task is to store a lot (10^5) of small ( <10 MB) text files in the
> database with the ability to restore them back to the hard drive on
> demand.
>
> That means that I need two functions. First - grab file from the
> directory, store it in the database and delete from the disk; second -
> recreate in back to the disk.
>
> 1/ Is it possible?
> 2/ Could you give me some quick tips on how to manage it from the start
> so that I knew what to look for in the manual?
>
> Thank you for your time.
> Dimitry
>


You can use the function pg_read_file(text,bigint,bigint)?

like:
inser into table foo values(1,2,3 [...], pg_read_file(filename,1,[?]);

The problem is to write it on the disc, there is not a function for that AFAIK.

--
              Emanuel Calvo Franco
ArPUG [www.arpug.com.ar] / AOSUG Member
        www.emanuelcalvofranco.com.ar

pgsql-general by date:

Previous
From: Andy Colson
Date:
Subject: Re: How to store text files in the postgresql?
Next
From: "James B. Byrne"
Date:
Subject: Re: search for partial dates