Example #1
0
    def create_table(self):
        """Create a table and commit.

        PostgreSQL needs to commit operations individually.
        Enable PostGis extensions if a script has a non tabular table.
        """
        if self.table and self.table.dataset_type and \
                not self.table.dataset_type == "TabularDataset":
            try:
                # Check if Postgis is installed and EXTENSION are Loaded
                self.execute("SELECT PostGIS_full_version();")
            except BaseException as e:
                print(e)
                print("Make sure that you have PostGIS installed\n"
                      "Open Postgres CLI or GUI(PgAdmin) and run:\n"
                      "CREATE EXTENSION postgis;\n"
                      "CREATE EXTENSION postgis_topology;")
                exit()
            return
        Engine.create_table(self)
        self.connection.commit()
Example #2
0
    def create_table(self):
        """Create a table and commit.

        PostgreSQL needs to commit operations individually.
        Enable PostGis extensions if a script has a non tabular table.
        """
        if (self.table and self.table.dataset_type
                and not self.table.dataset_type == "TabularDataset"):
            try:
                # Check if Postgis is installed and EXTENSION are Loaded
                self.execute("SELECT PostGIS_full_version();")
            except BaseException as e:
                print(e)
                print("Make sure that you have PostGIS installed\n"
                      "Open Postgres CLI or GUI(PgAdmin) and run:\n"
                      "CREATE EXTENSION postgis;\n"
                      "CREATE EXTENSION postgis_topology;")
                sys.exit()
            return
        Engine.create_table(self)
        self.connection.commit()
Example #3
0
 def create_table(self):
     """PostgreSQL needs to commit operations individually."""
     Engine.create_table(self)
     self.connection.commit()
Example #4
0
 def create_table(self):
     """PostgreSQL needs to commit operations individually."""
     Engine.create_table(self)
     self.connection.commit()