Rails: How to get PostgreSQL version being used

Posted . Visible to the public.

To check the currently running PG version from your Rails application (e.g. Rails console on your production server), simply do this:

ActiveRecord::Base.connection.select_value('SELECT version()')
Arne Hartherz
Last edit
Arne Hartherz
Keywords
postgres
License
Source code in this card is licensed under the MIT License.
Posted by Arne Hartherz to makandra dev (2016-08-22 13:06)