almost working revised postgres load script