Re: Best way to input data

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Morgan Kita <mkita(at)verseon(dot)com>, <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Best way to input data
Date: 2005-03-19 01:29:41
Message-ID: BE60EAB5.3E0E%sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 3/18/05 18:10, "Morgan Kita" <mkita(at)verseon(dot)com> wrote:

> I was hoping I could get some advice on the best interface for loading up my
> tables. To populate the different tables from the initial files, I am going to
> be running a lot of different processing steps in between as I populate
> individual records. To integrate this all I was wondering what the best
> interface to the postgres database would be? It seems from the manual online
> that the embedded C API would work well for starters, but maybe my time would
> be better spent learning something that will be quicker in the long run?

If you are starting with columnar text files, just load them into "loader"
tables. Then you can do your "processing steps" using SQL or procedure
language functions from the "loader" tables into your final schema.

As for loading, you can simply use the client psql by doing something like:

\copy tablename from 'tablename.txt'

Of course, you have to create the table first.

If you need something more complicated, there are APIs for working with
databases in perl, java, python, R, C, etc. I think the going answer (and I
am happy to be corrected) is that you should choose the language with which
you are most comfortable. There are also many other clients besides psql
that you could use.

I hope I understood your question and that this helps.

Sean

--
NHGRI/NIH
Johns Hopkins
Clinical Fellow
Pediatric Hematology/Oncology
--

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Michael Fuhr 2005-03-19 02:56:41 Re: output a single and double quote in a string
Previous Message George Weaver 2005-03-18 23:13:32 Re: output a single and double quote in a string