automated 'discovery' of a table : potential primary key, columns functional dependencies ...

From: Rémi Cura <remi(dot)cura(at)gmail(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: automated 'discovery' of a table : potential primary key, columns functional dependencies ...
Date: 2019-11-22 22:05:01
Message-ID: CAJvUf_vLNn51OdhDDF94VwxmCyEiQDn3LwuumMY6sGsP7muc=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello dear List,
I'm currently wondering about how to streamline the normalization of a new
table.

I often have to import messy CSV files into the database, and making clean
normalized version of these takes me a lot of time (think dozens of columns
and millions of rows).

I wrote some code to automatically import a CSV file and infer the type of
each column.
Now I'd like to quickly get an idea of
- what would be the most likely primary key
- what are the functional dependencies between the columns

The goal is **not** to automate the modelling process,
but rather to automate the tedious phase of information collection
that is necessary for the DBA to make a good model.

If this goes well, I'd like to automate further tedious stuff (like
splitting a table into several ones with appropriate foreign keys /
constraints)

I'd be glad to have some feedback / pointers to tools in plpgsql or even
plpython.

Thank you very much
Remi

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-11-22 22:48:50 Re: automated 'discovery' of a table : potential primary key, columns functional dependencies ...
Previous Message stan 2019-11-22 18:32:35 Re: A question about user atributes