Re: importing data automatically

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Menke, Kurt" <kmenke(at)edac(dot)unm(dot)edu>, "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: importing data automatically
Date: 2003-10-03 19:55:21
Message-ID: 200310031255.21521.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Kurt,

> I am running PostgreSQL 7.3.2 on RedHat 8. I have many large census tables
> I need to import. I access the Linux box from my Windows 2000 machine via
> Cygwin and can access PostgreSQL similarly via EMS PostgreSQL Manager. I
> understand that a table must be created with the correct fields before
> INSERT or COPY can be used, or before the data import wizard in EMS can be
> used. My problem is that I have some very large tables with hundreds of
> fields to import. Is there a way to get PostgeSQL to honor the database
> schema from an MS Access database and create the appropriate fields on
> import automagically?

Sure. Use pgODBC to connect to the PostgreSQL database from MS Access. Use
that connection to "export" the table design from MS Access to PostgreSQL
(but not the data, just the design!).

Log into PostgreSQL and adjust the data types and of the fields, becuase the
first step will not have worked perfectly.

Create COPY files and use those to load the new tables.

Create your indexes and FKs *after* import.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Nabil Sayegh 2003-10-03 23:18:45 Re: plperl db crash
Previous Message Nabil Sayegh 2003-10-03 19:12:45 Re: plperl db crash