Best way to input data
Best way to input data
От:
"Morgan Kita" <mkita@verseon.com>
Дата:
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? Thanks, Morgan
Re: Best way to input data
От:
Sean Davis <sdavis2@mail.nih.gov>
Дата:
On 3/18/05 18:10, "Morgan Kita" 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 --