added connection to pg and hability to generate txt