<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def replace_postgres_db(self, file_url):
 """ Replace postgres database with database from specified source. """

        self.print_message("Replacing postgres database")

        if file_url:
            self.print_message("Sourcing data from online backup file '%s'" % file_url)
            source_file = self.download_file_from_url(self.args.source_app, file_url)
        elif self.databases['source']['name']:
            self.print_message("Sourcing data from database '%s'"
                               % self.databases['source']['name'])
            source_file = self.dump_database()
        else:
            self.print_message("Sourcing data from local backup file %s" % self.args.file)
            source_file = self.args.file

        self.drop_database()
        self.create_database()

        source_file = self.unzip_file_if_necessary(source_file)

        self.print_message("Importing '%s' into database '%s'"
                           % (source_file, self.databases['destination']['name']))
        args = [
            "pg_restore",
            "--no-acl",
            "--no-owner",
            "--dbname=%s" % self.databases['destination']['name'],
            source_file,
        ]
        args.extend(self.databases['destination']['args'])
        subprocess.check_call(args)