Re: Normalization tools for postgres? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Normalization tools for postgres?
Date
Msg-id 4743ED89.5080504@archonet.com
Whole thread Raw
In response to Normalization tools for postgres?  (Dane Springmeyer <blake@hailmail.net>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: PostgreSQL is not behaving consistently across platforms
Next
From: "Sander Steffann"
Date:
Subject: Re: IP addresses