On Mar 19, 7:37 am, Jeff Schmitz <jeffrey.j.schm...@gmail.com> wrote:
> Do you mind sharing the nature of the incompatibilities between SQLite and 
> PG?  I ask bc I use SQLite in development and am worried that I should switch 
> to PG there too.

@Jeff: I found very few incompatibilities using pure Rails code.  My
app requires a few massive N-way joins that are written in raw SQL --
that's where I was getting the problem.  I wrote up a technique for
testing SQLite and PG and MySQL on the same code base in:

  
http://stackoverflow.com/questions/5316645/ror-how-do-i-test-my-app-against-multiple-databases

(Hint: upvote that if you like it!)

But to answer your question, if you're doing anything with timestamps
or dates (in raw SQL), you're likely to run into incompatibilities.
If you're returning selected fields from a query (again, in raw SQL),
you may find some results returned as strings in one DB and some cast
to ints or floats in the other.  The one place I found that "pure
rails" was sensitive to the db was in a "create_table" call -- PG
doesn't accept a :limit on a binary field:

    create_table :cached_web_pages do |t|
      t.string    :key
      if ActiveRecord::Base.connection.adapter_name == "PostgreSQL"
        t.binary    :value
      else
        t.binary    :value, :limit => 16777215
      end
      t.timestamp :succeeded_at
      t.timestamp :attempted_at
    end

HTH.

- ff

-- 
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to heroku@googlegroups.com.
To unsubscribe from this group, send email to 
heroku+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en.

Reply via email to