Extracted PGSQL to addon module

extracted PGSQL to own addon module as example.