Skip to content

Configuration options

Nathan Pierce edited this page Jun 6, 2018 · 11 revisions

This page is not a required read. Consult it only if you're looking for something specific.

Put all your configs in your RAILS Capistrano deploy/environment files: config/deploy/production.rb

Here's the list of options and the defaults for each option:

  • set :pg_database
    Name of the database for your app. Defaults to #{application}_#{stage}, example: myface_production.

  • set :pg_username
    Name of the database user. Defaults to whatever is set for pg_database option.

  • set :pg_password
    Password for the database user. It's suggested you use an ENV in your config/deploy/*.rb files instead of plaintext passwords.

  • set :pg_ask_for_password
    Default false. Set this option to true if you want to be prompted for the password when database user is created. This is safer than setting the password via pg_password. The downside is you have to choose and remember yet another password.
    Versions < v4.8.0 : pg_password takes precedence over pg_ask_for_password
    Versions >= v4.8.0 : pg_password is ignored if pg_ask_for_password is true.

  • set :pg_generate_random_password
    Default false. Set this option to true if you want the gem to generate a random password for you.

  • set :pg_system_user
    Default postgres. Set this option to the user that owns the postgres process on your system. Normally the default is fine, but for instance on FreeBSD the default postgres user is pgsql.

  • set :pg_system_db
    Default postgres. Set this if the system database doesn't have the standard name. Usually, there should be no reason to change this from the default.

  • set :pg_extensions
    Defaults to empty array []. If for example, you want to install "hstore" extension, just add it to the array with set :pg_extension, ["hstore"].

database.yml template-only settings:

  • set :pg_env
    DB environment. Defaults to the value of rails_env option. If rails_env is not set, it defaults to stage option.

  • set :pg_encoding
    encoding config in database.yml template. Defaults to unicode.

  • set :pg_pool
    Pool config in database.yml template. Defaults to 5.

  • set :pg_host
    hostname config in database.yml template. Defaults to localhost.

Versions >= v4.8.0:

  • set :pg_socket
    Defaults to an empty string

  • set :pg_port
    Defaults to 5432.

  • set :pg_timeout
    Defaults to 5000 (5 seconds; activerecord default).