Skip site navigation (1) Skip section navigation (2)

Re: storing a text file

From: Mag Gam <magawake(at)gmail(dot)com>
To: Joshua Tolley <eggyknap(at)gmail(dot)com>
Cc: PostgreSQL List - Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: storing a text file
Date: 2010-02-15 18:26:29
Message-ID: (view raw or whole thread)
Lists: pgsql-novice

I would like to load an entire text file into a field of a table.Is
there an easy way to do this or do I have to write a script?


On Sun, Feb 14, 2010 at 2:29 PM, Joshua Tolley <eggyknap(at)gmail(dot)com> wrote:
> On Sun, Feb 14, 2010 at 09:39:13AM -0500, Mag Gam wrote:
>> I would like to index several documents. They are all text files, I
>> was wondering what is the best way to do this. I was thinking to have
>> a column which will have:
>> *docid (serial)
>> date (timestamp)
>> document (varchar)
>> Eventually, I would like to access these documents via a webbrowser
>> and I would like to search these documents. Each document is about 10
>> to 20kb in size.
>> My question is, what datatype would be ideal for "document" field?
>> Also, any thoughts and recommendations ?
> Make it a TEXT type. You can use PostgreSQL's full text search options for
> searching across the set of all documents for given words or phrases.
> --
> Joshua Tolley / eggyknap
> End Point Corporation
> Version: GnuPG v1.4.9 (GNU/Linux)
> XLkAniJqkT7Q/xSrXOdjBG+9s9S6dyk8
> =uuon

In response to


pgsql-novice by date

Next:From: Tom LaneDate: 2010-02-16 04:25:36
Subject: Re: Actions requiring commit
Previous:From: Joshua TolleyDate: 2010-02-15 17:57:02
Subject: Re: Dily health checks to be created in short time

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group