Heroku - Rails 3 to 3.1 migration issues with PosgreSQL: relation “users” does not exist?

Look at the first error message: "ERROR: must be owner of database hvifyyqdjs You (or your program) are not allowed to drop it.

Look at the first error message: "ERROR: must be owner of database hvifyyqdjs" You (or your program) are not allowed to drop it.

Hvifyyqdjs error line is just there because I used the reset command. It doesn't show up when I try to reset the app or anything else. In all other cases I get stuck with the "user" reference error mentioned above.

Check the new logs from heroku I just added to see what happens when I restart the app. It seems like something is up with the postgresql_adapter. Rb – alik Sep 28 at 17:30 But the net result is that your app is not able to drop the DB, and is not able to recreate it, and that the objects it expects there are not found, or have different structures.

– wildplasser Sep 28 at 18:10 I see. My guess is, hvifyyqdjs seems to be a database related to Heroku, so I can't quite get access to it. As Erwin pointed out, the issue is the WHERE a.

Attrelid = '"users"'::regclass line using '"users"'. The double quotes in quotes. Why it is using that and how to change that is something I don't know and could use help with.

– alik Sep 28 at 18:25 BTW: in the case of database errors, it is often better to check the database logfile. Frameworks tend to bend errors wrong and cause a lot of cascading errors. That was also the nature of my "look at the first error, ignore the rest" reflex.

– wildplasser Sep 28 at 19:20.

Your query reads: WHERE a. Attrelid = '"users"'::regclass This should most probably be: WHERE a. Attrelid = 'users'::regclass Ergo: ERROR: relation "users" does not exist No extra double quotes inside the single quotes!

More info on the lexical structure in PostgreSQL.

Doesn't that mean that some version upgrade/downgrade needs to be done with the postgresql_adapter. Rb:962 file? Because the line WHERE a.

Attrelid = '"users"'::regclass is no where in my code. – alik Sep 28 at 17:56 @alik: I don't know about postgresql_adapter. Rb, but maybe you try searching your code for just "users"?

In postgres you only need to enclose identifiers in "" if you want them to retain upper case letters or be a reserved word. Neither is the case with users. – Erwin Brandstetter Sep 28 at 18:12 Thanks Erwin.My code has "users" in 3 lines, all in the schema.

Rb file, like this: create_table "users", :force => true do |t| and add_index "users", "email", :name => "index_users_on_email", :unique => true add_index "users", "reset_password_token", :name => "index_users_on_reset_password_token", :unique => true im guessing the quotes are just the ruby syntax I need to stick with, no? – alik Sep 28 at 18:22 @alik: I cannot help you with Ruby syntax, I am afraid.My expertise here is limited to PostgreSQL. You might try removing the "" from users?

– Erwin Brandstetter Sep 28 at 18:32 tried doing that, but it doesn't seem to have any affect and doesn't seem to be the source.My hunch is that its some version thing that generates this SQL in the wrong format. Any help from anyone is much appreciated – alik Sep 28 at 18:37.

I was able to solve this. One of my initializer files was doing a find_or_create_by_id which worked fine while development, but since I was now deploying on a fresh new application, the absence of tables was the source of that error, and was also blocking the migrate command from running and creating the missing tables. It had nothing to do with syntax of PostgerSQL.

PGError: ERROR: relation "posts" does not exist: SELECT a. I did a bundle update. Now, I am trying to push my app to Heroku and it is not working: Here is the error that I am getting: Installing pg (0.12.1) with native extensions /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/installer.

Got a strange problem: Boolean field not getting saved on Heroku (works fine locally) Details: Rails 2.3 on Heroku (bamboo-ree-1.8.7). Migration def self. Up add_column :users, :send_contact_emails, :boolean, :default = false end On Heroku: you = User.

I'm trying to push a brand new Ruby on Rails app to Heroku. Currently, it sits on MySQL. It looks like Heroku doesn't really support MySQL and so we are considering using PostgreSQL, which they DO support.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions