Skip site navigation (1) Skip section navigation (2)

Re: Importing Data into Postgresql from MS Access

From: "Tony Simopoulos" <karkalis(at)earthling(dot)net>
To: "Jean-Christophe Boggio" <cat(at)thefreecat(dot)org>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Importing Data into Postgresql from MS Access
Date: 2000-10-12 22:12:59
Message-ID: 037501c03499$94e32a50$0382a8c0@metavera.com (view raw or flat)
Thread:
Lists: pgsql-novice
> Kevin,
>
> Ref : Thursday, October 12, 2000 11:05:10 PM
>
> KL> Does anyone know of a utility which can easily convert MS Access tables into
> KL> Postgres?
>
> KL> Alternatively, I can export to any format that MSAccess supports (e.g.
> KL> comma-delimited text), but would like to know if there are any import
> KL> utilities which will simplify the import process into postgres so I don't
> KL> have to write a script for 100 fields X thousands of records.
>
> KL> Thanks for your help!
> KL> Kevin
>
>
> RTFM !
>
> 1) Create a table in postgres
>    create table foo
>    (
>    name text,
>    phone text,
>    age integer
>    );
>
> 2) export your table in "tab" delimited format from access with the
>    fields in the same order as in postgres :
>    john          5551212     25
>    paul          5551313     26
>    georges       5551414     30
>    ringo         5551515     27
>
> 3) use "copy table from..." command
>    copy foo from myaccessexportfile.txt;
>
this is such a manual process it stinks.  i too asked recently for a nice loading tool.  the advice i got was to hack together some
perl scripts.  although this would probably work fine, i think there is justification to build a real utility.

i'm currently working on one which can convert data from one format to another.  any database uploading or download will be done
through ODBC.  formats support will be TEXT(DELIMITED, FIXED_WIDTH, ENCLOSED), XBASE, and of course any SQL DB through ODBC.

utilizing the tool will entail the preparation of a specification file, where the input file or data table or data query is
specified and the output file or data table is also specified, along with column positions/names, field delimiters, etc.  the idea
is to approach the functionality of oracle's sqlload tool, while making it more flexible through ODBC.

although it will only suit my immediate needs and not be extremely robust, when its finished, i will probably release it to the
contrib directory.

the COPY command is the sorriest excuse for a data load tool i have ever had the displeasure of working with.  i hope i never have
to again.

tonys.


In response to

Responses

pgsql-novice by date

Next:From: Jean-Christophe BoggioDate: 2000-10-12 22:46:27
Subject: Re[2]: Importing Data into Postgresql from MS Access
Previous:From: Anthony E . GreeneDate: 2000-10-12 22:11:28
Subject: Re: Web pages tables over intranet

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group