Skip to content

Instantly share code, notes, and snippets.

View felipedeboni's full-sized avatar

Felipe K. De Boni felipedeboni

  • Hello Innovation
  • Porto Alegre
View GitHub Profile
@felipedeboni
felipedeboni / CEP.sql
Created August 13, 2013 00:03
Import data from GPBE tables (format as .csv, with ; as delimiter and quotes with ")
/* ===============================================================================================================================
This will get data from GBPE (previously) converted to CSV and:
* Create temporary tables
* Import data from: LOG_LOGRADOURO.csv, LOG_LOCALIDADE.csv, LOG_BAIRRO.csv into the temp tables
* Decrypt CEP column and create a new table with the following fields: cep, logradouro, bairro, cidade, uf, uf_sigla
* Dropping the temp shit
* Update PG Query Builder with an EXPLAIN ANALYZE
This script can be used to update an existing table (with same struct of course)