database design and refactoring

From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: database design and refactoring
Date: 2007-01-03 11:24:12
Message-ID: 200701031224.12618.fluca1978@infinito.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,
in my database I've got a table with a key that is char string, since it was
supposed to support values like strings. Running the database, the users
decided to place numbers as strings, so values like 00110002 and so on.
Now I was wondering to refactor my database and change the char field into a
numeric one but here comes problems: the field is referenced by other tables
and views.
I guess there's not, but you'll never know until you try: is there a tool or a
way to easily do such refactoring or should I write a program on my own to do
this?

And moreover a database design question: is a better idea to choose always
(when possible) numeric keys? I'm thinking about the database portability,
since not all databases support sequences (that can be used with a concat to
provide an automatic string key).

Thanks,
Luca

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Enrico 2007-01-03 11:41:10 Index Scanning
Previous Message JTyrrell 2007-01-03 10:55:24 pg_dump problems