fix env setting script, also fix postgresl passes