script
script
От:
Annissa Melhenas <melhenas@cogenit.fr>
Дата:
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, cya all, -- Annissa, The computer slayer
Re: script
От:
Ewald Geschwinde <webmaster@geschwinde.net>
Дата:
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, > >cya all, > > try to use the COPY Command. language I sugest is perl Ewald Geschwinde
Re: script
От:
Ron Johnson <ron.l.johnson@cox.net>
Дата:
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 | +---------------------------------------------------------+