Thread: Converting from dbase

Converting from dbase

From
nolan@celery.tssi.com
Date:
> ftp://ftp.postgresql.org/pub/incoming/dbf2pg-3.0.tar.gz, but that does
> not exists.

'incoming' directories are often hidden as a security precaution.

> Also, there is a contrib/dbase in the source of 7.3.2, but can't seem to
> get it to make. The README is more of a manual than installation
> instructions. Anyone familiar with getting contribs installed,
> particularly this one?

What OS/environment are you on?

I had no problems building dbf2pg under Redhat linux.  Under freeBSD I had
to make sure that 'make' references gmake and not the freebSD make utility.

The version of dbf2pg in the contrib/dbase directory has a couple of problems,
it does not handle memo fields and it fails on numeric fields that are all
blanks.  (I have a short patch which corrects the latter problem by setting
the field to 0.)
--
Mike Nolan
nolan@tssi.com


Re: Converting from dbase

From
Darko Prenosil
Date:
On Saturday 05 April 2003 17:18, Robert Fitzpatrick wrote:
> >     I suppose You are familiar with some "DBase" tool like
> > Fox, Clipper etc..
>
> No, but I'll look into it if my current approach doesn't resolve the
> issue.
>
> >     (otherwise where did You get those DBF files?).
>
> These are .dbf files from a program a customer is using called ABRA
> (www.abra.com), it is an HR/Payroll software. We are developing their
> Intranet with PHP/PostgreSQL and want to see if we can build a
> PostgreSQL function or PHP class to import or convert regularly and
> maybe even create triggers to check updated PG tables for information
> that came from the dbf files. Flexibility would be great.
>
> >     If the language You are using apparent to be Fox, I can
> > try to find this
> >     code and send to You.
>
> Appreciated, the current approach has not panned out, yet.
>
> > However, there is "dbase" source from contrib dir (7.2
> > version of postgres).
> > You will probably need to change the Makefile.
>
> This is what I'm trying to use and would like to use, dbf2pg. Do you
> know where I can find docs on this or what to change in Makefile?

Here is a stand-alone Mekefile. All You have to do is show
where are postgreSQL includes(libpg-fe.h) and  libpq.so.

Change the first two lines of Makefile:

    libpq_include    = /usr/local/pgsql/include
    libpq_lib     = /usr/local/pgsql/lib

Other settings should be good enough(Depends on which platform You are using).


Attachment