New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rooms model's method select_server gives error on postgres #4
Comments
One more thing is that when server was already assigned to the room, then there is no need (or even against user's selection) to forcibly select another server with less number of rooms |
@naumenko thanks for the issue. We haven't used it with postgres yet, so I didn't know about this error. If you found a way to fix it and are willing to submit a pull request it would be great. Otherwise I'll try it someday in the future. Also, you are probably right about the selection of servers. The idea was to dynamically select a server when a meeting is about to be started (https://github.com/mconf/bigbluebutton_rails/blob/master/app/models/bigbluebutton_room.rb#L119), as a way to balance the load. But that's not really effective and it's not the best way to do it. It as well might be better to let the application associate servers and rooms. |
I found a solution for the PG error; just replace the parameter in the group_by clause. The second line of the query should look like this:
I can create a pull request for this but I dont have a mysql server setup and so wont be able to test against that. Hopefully that helped though it is 2 years too late. |
@mkuchhal, yes, send a pull request, please. If the changes are really that small, we can start testing the gem on mysql and postgres to support both. |
Closing this because it's an old issue. If PostgreSQL is supported in the future, this will be solved. |
Just to let you know this method on postgres gives error
This method can be overridden to change the way the server is selected
before a room is created
This one selects the server with less rooms in it
def select_server
BigbluebuttonServer.
select("bigbluebutton_servers.*, count(bigbluebutton_rooms.id) as room_count").
joins(:rooms).group(:server_id).order("room_count ASC").first
end
Error:
ActiveRecord::StatementInvalid (PG::Error: ERROR: column "bigbluebutton_servers.id" must appear in the GROUP BY clause or be used in an aggregate function
The text was updated successfully, but these errors were encountered: