openego / data_processing

(geo)data processing, database setup, data validation
GNU Affero General Public License v3.0
7 stars 5 forks source link

Error: Duplicate key (subst_id) in ego_grid_mv_griddistrict in ego_dp_mv_griddistrict.sql #360

Open OriolRaventos opened 4 years ago

OriolRaventos commented 4 years ago

When executing ego_dp_mv_griddistrict.sql I get the following error:

sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "ego_grid_mv_griddistrict_pkey" DETAIL: Key (subst_id)=(155) already exists.

but looking at the code and the input / temporary tables I am not able to find where the duplication comes from (many of the temporary table also have a primary key, hence there could not be a duplicated key in them either).