Hello.

cat config/database.yml
development:
  adapter: postgresql
  database: brun.trionet.ru_development
  username: brun

> rake test:units
NOTICE:  database "brun.trionet.ru_test" does not exist, skipping
PGError: ERROR:  syntax error near "."
LINE 1: CREATE DATABASE brun.trionet.ru_test ENCODING = 'utf8'

This is a patch, that fix this problem (adding " around database name)
--- /home/brun/postgresql_adapter.rb    2008-06-07 16:49:57.000000000
+0400
+++ lib/active_record/connection_adapters/postgresql_adapter.rb
2008-06-07 16:50:18.000000000 +0400
@@ -506,7 +506,7 @@
           end
         end

-        execute "CREATE DATABASE #{name}#{option_string}"
+        execute "CREATE DATABASE \"#{name}\"#{option_string}"
       end

       # Drops a PostgreSQL database
@@ -514,7 +514,7 @@
       # Example:
       #   drop_database 'matt_development'
       def drop_database(name) #:nodoc:
-        execute "DROP DATABASE IF EXISTS #{name}"
+        execute "DROP DATABASE IF EXISTS \"#{name}\""
       end



PS Sorry for my english.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to