Search Postgresql Archives

Re: database design and refactoring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Jan 3, 2007, at 5:24 , Luca Ferrari wrote:

Running the database, the users
decided to place numbers as strings, so values like 00110002 and so on.

Note that '00110002' is not a number (i.e., it's not equal to 110002): it's a string of digits.

is there a tool or a
way to easily do such refactoring or should I write a program on my own to do
this?

Not that I know of, though ALTER TABLE <table> ALTER <column> TYPE ... is pretty easy to use.

And moreover a database design question: is a better idea to choose always
(when possible) numeric keys?

Depends on your requirements. This is an oft-discussed topic about which you can find many more opinions by googling on natural and surrogate keys.

Michael Glaesemann
grzm seespotcode net




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux