Re: importing data automatically - Mailing list pgsql-novice

From Josh Berkus
Subject Re: importing data automatically
Date
Msg-id 200310031255.21521.josh@agliodbs.com
Whole thread Raw
In response to importing data automatically  ("Menke, Kurt" <kmenke@edac.unm.edu>)
List 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


pgsql-novice by date:

Previous
From: "Menke, Kurt"
Date:
Subject: importing data automatically
Next
From: Nabil Sayegh
Date:
Subject: Re: plperl db crash