Re: BUG #15212: Default values in partition tables don't work asexpected and allow NOT NULL violation

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #15212: Default values in partition tables don't work asexpected and allow NOT NULL violation
Дата
Msg-id 20181112140051.yv5m77esq5jz6rkg@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: BUG #15212: Default values in partition tables don't work asexpected and allow NOT NULL violation  (Jürgen Strobel <juergen+postgresql@strobel.info>)
Ответы Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 2018-Nov-12, Jürgen Strobel wrote:

> With all due respect I suspect your view of implementation issues biases
> your judgement here. For me the partition's default handling was
> completely unexpected, especially with the documentation silent about
> default-applying behavior, and inconsistent with how check constraints
> work with partitions.

This is valuable input.  It would be good to have more opinions from
users, particularly those accustomed to how things work in other RDBMS
systems, so that we can inform our own opinions on how we should make it
work here in PG going forward.

One of the guiding principles that I think we should hold for
partitioning is that operating directly into the partition should be
seen as only an optimization compared to inserting into the parent table
-- thus it should not behave differently.  Applying different default
values depending on where you're inserting into goes counter to that
principle.

> Maybe there's another way to implement this. Like mark early and apply
> defaults later, and handle meta data like constraints. Sorry if this
> sounds stupid.

It does not sound stupid -- it seems exactly what I was thinking.
Admittedly, it's a bit hand-wavy and we'd need to understand more how it
work in more detail, as well as how it works currently (and why it
does).

However, I'm not ATM in a position to design or write a patch for this.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: move PartitionBoundInfo creation code
Следующее
От: Jeremy Finzel
Дата:
Сообщение: Re: Changes to error handling for background worker initialization?