PgDBF is a program for converting XBase databases - particularly FoxPro tables with memo files - into a format that PostgreSQL can directly import. It is the successor to the XBaseToPg project, which works well but is comparatively slow and big and complicated. The smallest changes touched lots of files, and the scope of that project is far larger than I actually needed on a daily basis.
Thus, PgDBF. It's a small C project comprising two files with no dependencies other than standard Unix libraries. While the project is relatively tiny and simple, it's also heavily optimized via profiling. I routinely got benchmark results that were many times faster than with XBaseToPg. In fact, even on slower systems, conversions were typically limited by hard drive speed.
Features
PgDBF was designed with a few core principles:
- Simplicity. This code should be understandable by anyone who wants to hack it.
- Robustness. Every syscall is checked for success.
- Speed. I wanted the fastest conversion available anywhere.
- Completeness. It has full support for FoxPro memo files.
- Portable. PgDBF runs on 32- and 64-bit systems, and both little-endian (eg x86) and big-endian (eg PowerPC) architectures.