I submitted a solution here once in the past, please use search before asking. the exception handling will be quicker in general, cos you won't have to test for existence of the table before every insert.
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных