{"action":"closed","issue":{"number":136,"created_at":"2011-10-25T22:08:29Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi there, \r\nI have just updated with a new column ('subscribe_newsletter') my user model (which uses geocoder).  Suddenly the #near method has stopped working and throws the following error:\r\n\r\n    User.near([51.499900, -0.110502])\r\n   \r\n    ActiveRecord::StatementInvalid: PGError: ERROR:  column \"users.subscribe_newsletter\" must appear in the GROUP BY clause or be used in an aggregate function : \r\n    SELECT *, 3958.755864232 * 2 * ASIN(SQRT(POWER(SIN((51.4999 - lat) * PI() / 180 / 2), 2) + COS(51.4999 * PI() / 180) * COS(lat * PI() / 180) * POWER(SIN((-0.110502 - lng) * PI() / 180 / 2), 2) )) AS distance, CAST(DEGREES(ATAN2( RADIANS(lng - -0.110502), RADIANS(lat - 51.4999))) + 360 AS decimal) % 360 AS bearing FROM \"users\" WHERE (lat BETWEEN 51.2104364337783 AND 51.7893635662217 AND lng BETWEEN -0.575491759360445 AND 0.354487759360445) GROUP BY users.id,users.email,users.encrypted_password,users.reset_password_token,users.reset_password_sent_at,users.remember_created_at,users.sign_in_count,users.current_sign_in_at,users.last_sign_in_at,users.current_sign_in_ip,users.last_sign_in_ip,users.authentication_token,users.name,users.username,users.is_venue,users.is_admin,users.location,users.country,users.tel,users.website,users.opentimes,users.bio\r\n\r\n\r\nI noticed this problem only after deploying to Heroku (bamboo-ree-1.8.7 stack); The query works just fine instead on my machine, where I am running Postgres 9.1.\r\n","comments":1,"title":"(Heroku) #near method errors after schema update","updated_at":"2011-10-25T22:17:20Z","url":"https://api.github.com/repos/alexreisner/geocoder/issues/136","id":2050667,"assignee":null,"milestone":null,"closed_at":"2011-10-25T22:17:20Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/2754c2df5eeda76cebc314a29e885fef?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"2754c2df5eeda76cebc314a29e885fef","url":"https://api.github.com/users/afiore","id":63361,"login":"afiore"},"html_url":"https://github.com/alexreisner/geocoder/issues/136","labels":[],"state":"closed"},"legacy":{"number":136,"action":"closed","issue":2050667}}