docs: def get_postgresql_args(db_config, extra_args=None):
      """
      Returns an array of argument values that will be passed to a `psql` or
      `pg_dump` process when it is started based on the given database
      configuration.
      """
      db = db_config['NAME']
  
      mapping = [('--username={0}', db_config.get('USER')),
                 ('--host={0}', db_config.get('HOST')),
                 ('--port={0}', db_config.get('PORT'))]
      args = apply_arg_values(mapping)
  
      if extra_args is not None:
          args.extend(shlex.split(extra_args))
      args.append(db)
  
      return args