You've probably already figured it out, but this looks workable:
# See this page for some of the statement-related settings:
# PostgreSQL: Documentation: 8.3: Client Connection Defaults
def setStatementTimeout milliseconds
query = "SET statement_timeout = #{milliseconds};"
ActiveRecord::Base.connection().execute query
end