pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dane Springmeyer <blake@hailmail.net>
To: Postgres General List <pgsql-general@postgresql.org>
To: pgsql-php@postgresql.org
Subject: Normalization tools for postgres?
Date: Tue, 20 Nov 2007 23:14:15 -0800
Message-ID: <0ED7C703-6F0A-46DC-93D3-244C9FADE5A5@hailmail.net> (raw)
In-Reply-To: <597066.69415.qm@web31806.mail.mud.yahoo.com>
References: <597066.69415.qm@web31806.mail.mud.yahoo.com>

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 noticed this tool for mySQL which captures what I am looking for:  
http://www.sqldbu.com/eng/sections/tips/normalize.html

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.

Perhaps a customized php script could accomplish the same thing for  
postgres?

Any suggestions would be helpful.

Dane



  field names for which to break out into their own tables
On Nov 20, 2007, at 8:33 PM, Richard Broersma Jr wrote:

> --- On Tue, 11/20/07, Finn Lassen <dcio@AxiomInt.com> wrote:
>> Here is a VB code snippet:
>>     Dim dbOut As ADODB.Connection
>>     Dim rsOut As ADODB.Recordset
>>     Set dbOut = New ADODB.Connection
>>     Set rsOut = New ADODB.Recordset
>>         .ConnectionString = "Driver={PostgreSQL
>> ANSI};Server=localhost;Port=5432;Database=postgres;Uid=postgres;Pwd=n 
>> one;"
>
>> Should I have created the table "Contact1" WITH
>> OIDS ?
>
> I wonder if this is a problem with the way your ODBC driver is  
> configured.   If it is a problem with your ODBC driver  
> configuration, you might also try posting to the PostgreSQL-ODBC  
> mailing list.
>
> Also, why did you choose the ANSI driver over the Unicode driver?
>
> Regards,
> Richard Broersma Jr.
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that  
> your
>        message can get through to the mailing list cleanly




view thread (3+ messages)  latest in thread

Message-ID: <0ED7C703-6F0A-46DC-93D3-244C9FADE5A5@hailmail.net>
Permalink:  ../0ED7C703-6F0A-46DC-93D3-244C9FADE5A5@hailmail.net/
Also on:    postgresql.org/message-id/0ED7C703-6F0A-46DC-93D3-244C9FADE5A5@hailmail.net

 · 

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 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: blake@hailmail.net, pgsql-general@postgresql.org
  Subject: Re: Normalization tools for postgres?
  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>

* 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