Posted by william on Wed Jan 27 13:18:09 1999
In Reply to: transfering data between databases posted by TimJ on January 27, 1999 at 11:49:56:
| Distribution: | paneris@i-way.co.uk |
|---|
>Boys,>is there a standard for moving data between databases
>(ie csv). If so, what is it? If not, what should we do?The obvious standard, which people do in fact seem to use,
is SQL---loads of CREATE TABLE and INSERT statements.I am sure I saw somewhere someone mention that you can
get Abcess to dump out a database as SQL, and in principle
it is trivial to get Postgres to read the SQL---justpsql
There will perhaps be problems to do with data type naming,
nonstandard ways of dealing with autoincrement and so on.
Also psql seemed to me to have some sort of line or
statement or file size limit which caused it to barf on
the Iglu data, but it is probably something simple and
around-workable, and in any case may have been fixed in
6.4.>Will, how did you do this for Access -> Postgres. Can you let us have the code.
I wrote a Perl CGI script to dump out CREATE TABLE and
INSERT commands, based on the data dictionary since there
is no metadata available via the obsolete W32ODBC driver.The script is at
ftp://www.iglu.com/cgi-int/williamc-dump.pl
and you run it with
http://www.iglu.com/cgi-int/williamc-dump.pl
It seems to work though I vaguely remember using one in
cgi-bin which has probably been deleted ...As I said there are some things it doesn't do, such as
making id fields autoincrement and so on. I had a perl
script which further processed the SQL to add postgres-
specific things to do that and create indices, but
it isn't so relevant for 6.4.