From 21bb0f40b075e7b878e7ae0fd6c40c9a9ad5b00a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 7 Jun 2008 13:39:03 -0700 Subject: PostgreSQL: quote bare table names --- .../lib/active_record/connection_adapters/postgresql_adapter.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 7dbfbb41f6..049e6f61de 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -506,7 +506,7 @@ module ActiveRecord end end - execute "CREATE DATABASE #{name}#{option_string}" + execute "CREATE DATABASE #{quote_table_name(name)}#{option_string}" end # Drops a PostgreSQL database @@ -514,7 +514,7 @@ module ActiveRecord # Example: # drop_database 'matt_development' def drop_database(name) #:nodoc: - execute "DROP DATABASE IF EXISTS #{name}" + execute "DROP DATABASE IF EXISTS #{quote_table_name(name)}" end @@ -676,7 +676,7 @@ module ActiveRecord # Renames a table. def rename_table(name, new_name) - execute "ALTER TABLE #{name} RENAME TO #{new_name}" + execute "ALTER TABLE #{quote_table_name(name)} RENAME TO #{quote_table_name(new_name)}" end # Adds a new column to the named table. -- cgit v1.2.3