diff options
author | Miles Georgi <azimux@gmail.com> | 2008-08-17 23:45:25 -0700 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-08-21 16:22:14 +0100 |
commit | 0d74e72e6de7b96e158950a449ea1ccce6f5b8d7 (patch) | |
tree | 8ee229cf784134649b3b04cd170c7c5908be5f91 | |
parent | 49c0e1e594c95d7e8446ebabecc9147afa62de7d (diff) | |
download | rails-0d74e72e6de7b96e158950a449ea1ccce6f5b8d7.tar.gz rails-0d74e72e6de7b96e158950a449ea1ccce6f5b8d7.tar.bz2 rails-0d74e72e6de7b96e158950a449ea1ccce6f5b8d7.zip |
Fix postgres bug when change_column is called with invalid parameters. [#861 state:resolved]
Signed-off-by: Tarmo Tänav <tarmo@itech.ee>
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 856435517a..74da0d9c85 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -761,7 +761,8 @@ module ActiveRecord begin execute "ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quote_column_name(column_name)} TYPE #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}" - rescue ActiveRecord::StatementInvalid + rescue ActiveRecord::StatementInvalid => e + raise e if postgresql_version > 80000 # This is PostgreSQL 7.x, so we have to use a more arcane way of doing it. begin begin_db_transaction |