[PATCH] Add schema and table names to partition error

Поиск
Список
Период
Сортировка
От Chris Bandy
Тема [PATCH] Add schema and table names to partition error
Дата
Msg-id 0aa113a3-3c7f-db48-bcd8-f9290b2269ae@gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] Add schema and table names to partition error  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers
Hello,

I'm writing telemetry data into a table partitioned by time. When there 
is no partition for a particular date, my app notices the constraint 
violation, creates the partition, and retries the insert.

I'm used to handling constraint violations by observing the constraint 
name in the error fields. However, this error had none. I set out to add 
the name to the error field, but after a bit of reading my impression is 
that partition constraints are more like a property of a table.

I've attached a patch that adds the schema and table name fields to 
errors for my use case:

- Insert data into a partitioned table for which there is no partition.
- Insert data directly into an incorrect partition.

Thanks,
Chris

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: subplan resets wrong hashtable
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Broken resetting of subplan hash tables