Make dump to csv function work from DB.