1. ODBC is not fast by nature adding a layer on top of the direct access libraries. Can you dump from cobol to text delimited file (or fixed length) and then up into Postgres ?
2. when you say 'Raises an error': what error do you get ?
3. 4 millions rows seems like a fairly sizeable amount of data, have you checked you have enough space on the disk where the Postgres DB resides ?
4. Can't you do your upload piece by piece; I would have thought that out of the n millions rows, a large chunk are historical data which do not need to be exported on a daily basis.