     #pgclient.on('drain', pgclient.end.bind(pgclient))
     pgclient.connect()
     callWhenEnded()
-
-
-
-
-
-
-  (callWhenEnded) ->
-    console.log "> Ensure aiddata indices"
-  
-    mongodb.collection 'aiddata', (err, coll) =>
-      if err? then callWhenEnded(err)
-      else
-
-        indices = [
-          { aiddata_id : 1 }
-          { origin : 1 }
-          { dest : 1 }
-          { origin : 1, dest : 1 }
-          { coalesced_purpose_code : 1 }
-        ]
-
-        ensure = (index, ended) ->
-          console.log "Ensuring index #{JSON.stringify(index)}"
-          coll.ensureIndex index, (err) ->
-            if err? then callWhenEnded(err)
-            else 
-              ended()
-
-
-        q = queue(1)  # no parallelism
-        indices.forEach (index) -> q.defer ensure, index
-        q.await -> callWhenEnded()
-
-
 
 
 

        callWhenEnded()






        if err? then callWhenEnded(err)
        else

          reader = linereader.open PATH + AIDDATA_TEMP_FILE

          nextRow = ->
            if reader.hasNextLine()
