Thread: FW: Dbf to Pg converter
thank you paul, it is the same itch i have been trying to scratch. I will try it. ronnie > -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Paul M Foster > Sent: Monday, February 19, 2001 7:52 AM > To: pgsql-general@postgresql.org > Subject: Dbf to Pg converter > > > Since it's come up before on this list, let me mention that I have > created a new project on SourceForge: > > http://sourceforge.net/projects/dbfdump/ > > This is a command line C++ program designed to take the structure and/or > contents of a dbf file (dBase, FoxPro) and dump it out, either in a > "browse" format, or as a PostgreSQL SQL script. The SQL script can be > used to create and/or populate a PostgreSQL table. It also handles > FoxPro memo files, but not dBase ones. > > So if your "itch" is the same as the one I scratched, you now have a > resource. Of course, if you find any bugs, umm, well, er, I didn't do it > and I don't know who did. ;-} > > Paul
Was there something wrong with dbf2sql? :-) It used to be in contribs/ I think but it was very simple code that did the job. At the time I was working with 1.x and 6.0x versions of Postgres and made a few mods to it so that I could rename the tables, change field types, just export the data and not the table definitions, etc. The last version I saw was 3.0 but that's been a couple of years. len morgan
On Mon, Feb 19, 2001 at 06:03:37PM -0600, Len Morgan wrote: > Was there something wrong with dbf2sql? :-) It used to be in contribs/ I > think but it was very simple code that did the job. At the time I was > working with 1.x and 6.0x versions of Postgres and made a few mods to it so > that I could rename the tables, change field types, just export the data and > not the table definitions, etc. > > The last version I saw was 3.0 but that's been a couple of years. > > len morgan > I used this originally, but then found some shortcomings whose nature I don't recall. I believe it had odd rules for type conversions between xBase and PostgreSQL, maybe. I had already written code to "browse" xbase tables (dbfdump), so I just grafted SQL scripting onto it. But by all means, if dbf2sql works, use it. Paul
FYI I have hacked around with this to make a another sort of import program for DBF's. First there's a Foxpro export program that exports all databases to individual text files containing SQL This renames invalid field/table names and handles embedded quotes and CR/LF's in text, that sort of thing. On the Linux box, there is a text file of all the text files to be imported (one file per table) A C program reads this and the SQL inside performed (e.g. create table and lots of inserts) If a file imports it is removed from the main file, so it can be re-run in case of failure of any one file. This makes it much easier to handle errors when you have lots of tables/data I used it to import all data from a large Foxpro database but would also work for DBase/Clipper Memo's are not properly supported yet... Its very fast, unlike ODBC which is why I did it in the first place! I anyone is interested I will send it to you, MC. -- NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected.
I am interested. I tryed to use dbfdump 1.6.0 but it crashes on my large databases. Segment fail. Joseph Showalter -----Original Message----- From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org]On Behalf Of martin.chantler@convergys.com Sent: Tuesday, February 20, 2001 4:47 AM To: Len Morgan Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] FW: Dbf to Pg converter FYI I have hacked around with this to make a another sort of import program for DBF's. First there's a Foxpro export program that exports all databases to individual text files containing SQL This renames invalid field/table names and handles embedded quotes and CR/LF's in text, that sort of thing. On the Linux box, there is a text file of all the text files to be imported (one file per table) A C program reads this and the SQL inside performed (e.g. create table and lots of inserts) If a file imports it is removed from the main file, so it can be re-run in case of failure of any one file. This makes it much easier to handle errors when you have lots of tables/data I used it to import all data from a large Foxpro database but would also work for DBase/Clipper Memo's are not properly supported yet... Its very fast, unlike ODBC which is why I did it in the first place! I anyone is interested I will send it to you, MC. -- NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected.
On Tue, 20 Feb 2001, Joseph wrote: > I am interested. > > I tryed to use dbfdump 1.6.0 but it crashes on my large databases. Segment > fail. How big is your table?