Re: script - Mailing list pgsql-novice

From Ron Johnson
Subject Re: script
Date
Msg-id 1022245323.631.17.camel@rebel
Whole thread Raw
In response to script  (Annissa Melhenas <melhenas@cogenit.fr>)
List pgsql-novice
On Fri, 2002-05-24 at 03:21, Annissa Melhenas wrote:
>         Hi all,
> I'm new to postgreSQL,a dn I'd like to write a script that will insert all
> my entries (I have almost 800 000 entries)in a pgsql database.so, the
> question is : which script language can I use, and how do I use it (ie,
> how do I run it?)
> Thanks for your replies,

Look in the Novice Archives from earlier this week, for a
thread regarding the _exact_ same topic.

Question: what do your records look like?  Is each field
delimited, or are they fixed-length?  If they are delimited
(by tab, comma, etc.) and there are no double-quotes around
each field (or you can safely get rid of them with tr), then
the COPY will probably work great.

If you can't use COPY, then you must write a small program
(in the language of your choice) to massage the data before
INSERTing it.  I use python, others perl and C.

--
+---------------------------------------------------------+
| Ron Johnson, Jr.        Home: ron.l.johnson@cox.net     |
| Jefferson, LA  USA      http://ronandheather.dhs.org:81 |
|                                                         |
| "I have created a government of whirled peas..."        |
|   Maharishi Mahesh Yogi, 12-May-2002,                   |
!   CNN, Larry King Live                                  |
+---------------------------------------------------------+


pgsql-novice by date:

Previous
From: Ron Johnson
Date:
Subject: Re: discovering an index definition
Next
From: Ron Johnson
Date:
Subject: Why sequential scan when there's a supporting index?