def load_postgresql(self):
        # Drop all the records from the target model's real table
        self.cursor.execute('TRUNCATE TABLE "%s" CASCADE' % (
            self.model._meta.db_table
        ))

        c = CopyMapping(
            self.model,
            self.csv,
            dict((f.name, f.db_column) for f in self.model._meta.fields),
            using=self.database,
        )
        c.save(silent=True)

        # Print out the results
        if self.verbosity > 2:
            csv_count = self.get_row_count()
            model_count = self.model.objects.count()
            self.finish_load_message(model_count, csv_count)
Load the file into a PostgreSQL database using COPY
dataset/ETHPy150Open california-civic-data-coalition/django-calaccess-raw-data/calaccess_raw/management/commands/loadcalaccessrawfile.py/Command.load_postgresql