|
From: Karl O. P. <ko...@me...> - 2015-04-23 20:34:43
|
On Thu, 23 Apr 2015 14:07:14 -0500
Siddhartha Basu <bi...@gm...> wrote:
> Secondly, it really does not matter if i start from scratch with
> bigint, but what about existing installation.
> Is it just executing bunch of alter datatype queries
> and everything will be bigint, no issues whatsoever. Is
> there is any precaution have to be taken.
Without having done it, I'd say the main precaution
is ensuring that when a key is changed to bigint
that all the related foreign keys are also changed.
I suppose that if you miss one and try to insert a
bigint value into a int column you'll just get a
integer out of range error and the transaction will
roll back. So, as long as you've got sensible
transactions things would be ok and you'd just
have to alter the foreign key to bigint and
retry the transaction.
So, the main concern would be having sensible
transactions in your applications in case you goof.
Given performance concerns, perhaps the best approach
is to let people convert specific foreign keys to bigint on
an as-needed basis.
Karl <ko...@me...>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
|