Ok, my insert issue was a postgres user permissions issue. Cleaned up some code now that that kind of works