How to capture error message and save to a table in PostgreSQL?

Поиск
Список
Период
Сортировка
От Shaozhong SHI
Тема How to capture error message and save to a table in PostgreSQL?
Дата
Msg-id CA+i5Jwa84QGO87znD8WBMqYMGB=t-6ZrDxUJ+UHbtF2fDyZQng@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to capture error message and save to a table in PostgreSQL?  (Steve Midgley <science@misuse.org>)
Re: How to capture error message and save to a table in PostgreSQL?  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-sql
Hi, All, 

I wish to test out to produce a table when data violates constraints when insert into a new table with constraint set.  How to capture and save error message to a new table?

INSERT INTO test3 ("Record Type", "Unique Reference Number", "Supplier Reference Number", "Post Code")
SELECT "Record Type", "Unique Reference Number", "Supplier Reference Number", "Post Code" from test;

ERROR:  new row for relation "test3" violates check constraint "test3_Post Code_check"
DETAIL:  Failing row contains (L, 14986526, 1207174, null, null, null, null, null, null, SURREY, null, null, null, null, null, null, null, null).
SQL state: 23514

Regards,
David

В списке pgsql-sql по дате отправления:

Предыдущее
От: Metin Ulusinan
Дата:
Сообщение: Re: Create trigger on after logon on schema
Следующее
От: Shaozhong SHI
Дата:
Сообщение: A new scenario for check constraints