pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frank Finner <postgresql@finner.de>
To: noor@cs.man.ac.uk
Cc: pgsql-sql@postgresql.org
Subject: Re: flat file database to postgres
Date: Tue, 16 Mar 2004 14:30:23 +0100
Message-ID: <20040316143023.29ad9dbd.postgresql@finner.de> (raw)
In-Reply-To: <4133.80.46.172.2.1079440437.squirrel@popeye.cs.man.ac.uk>
References: <4133.80.46.172.2.1079440437.squirrel@popeye.cs.man.ac.uk>

On Tue, 16 Mar 2004 12:33:57 -0000 (GMT) noor@cs.man.ac.uk sat down, thought long and then wrote:

> 
> Hi
> 
> Does anybody know how to export data from a flatfile (using perl) database
> to postgres?
> 
> Thanks

If it is some kind of CSV (text with separators) you could use DBD::CSV for reading and DBD::Pg for
writing. Or you read the file with Perl´s standard functions, treat the data to be
PostgreSQL-insert-query-compatible (regarding apostrophes for example) and then use DBD::Pg (that´s
what I usually do). If you have some kind of DBase files, you can use DBD::XBase.

Regards, Frank.


view thread (3+ messages)  latest in thread

Message-ID: <20040316143023.29ad9dbd.postgresql@finner.de>
Permalink:  ../20040316143023.29ad9dbd.postgresql@finner.de/
Also on:    postgresql.org/message-id/20040316143023.29ad9dbd.postgresql@finner.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: postgresql@finner.de, noor@cs.man.ac.uk
  Subject: Re: flat file database to postgres
  In-Reply-To: <20040316143023.29ad9dbd.postgresql@finner.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox