From: Richard Huxton <dev@archonet.com>
To: Dane Springmeyer <blake@hailmail.net>
Cc: Postgres General List <pgsql-general@postgresql.org>
Subject: Re: Normalization tools for postgres?
Date: Wed, 21 Nov 2007 08:34:17 +0000
Message-ID: <4743ED89.5080504@archonet.com> (raw)
In-Reply-To: <0ED7C703-6F0A-46DC-93D3-244C9FADE5A5@hailmail.net>
References: <597066.69415.qm@web31806.mail.mud.yahoo.com>
<0ED7C703-6F0A-46DC-93D3-244C9FADE5A5@hailmail.net>
Please don't start a new thread by replying to another question.
If you are going to do that, please don't cross-post it in addition.
This doesn't appear to be anything to do with PHP.
Dane Springmeyer wrote:
> Anyone have recommendations on tools/utilities or SQL approaches to
> quickly break apart a large imported flat file into normal forms,
> ideally 1NF or 2NF?
I don't know of any tool that could do this automatically. Without
understanding what the columns *mean* how could it.
> I noticed this tool for mySQL which captures what I am looking for:
> http://www.sqldbu.com/eng/sections/tips/normalize.html
Well, given that the example just shows the author doesn't know what 1NF
means, I don't think it does do what you want.
> Given the fields with data to be output into separate tables, it takes a
> csv and automatically generates a set of INSERT queries to build all the
> related tables with new a new primary key for the main table and
> serialized codes for each of the new tables to maintain relationships.
I don't see any reason why the INSERTs won't work for PG just as well.
> Perhaps a customized php script could accomplish the same thing for
> postgres?
>
> Any suggestions would be helpful.
Can you state what problem you are trying to solve? Do people just email
you flat files and ask you to send them a relational database back? Is
there a specific file that gets imported on a regular basis?
--
Richard Huxton
Archonet Ltd
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: dev@archonet.com, blake@hailmail.net, pgsql-general@postgresql.org
Subject: Re: Normalization tools for postgres?
In-Reply-To: <4743ED89.5080504@archonet.com>
References: <597066.69415.qm@web31806.mail.mud.yahoo.com> <0ED7C703-6F0A-46DC-93D3-244C9FADE5A5@hailmail.net> <4743ED89.5080504@archonet.com>
* 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