Re: OOP real life example (was Re: Why is MySQL more

Поиск
Список
Период
Сортировка
От Greg Copeland
Тема Re: OOP real life example (was Re: Why is MySQL more
Дата
Msg-id 1029169813.25246.119.camel@mouse.copelandconsulting.net
обсуждение исходный текст
Ответ на Re: OOP real life example (was Re: Why is MySQL more  (Oliver Elphick <olly@lfix.co.uk>)
Ответы Re: OOP real life example (was Re: Why is MySQL more
Re: OOP real life example (was Re: Why is MySQL more
Список pgsql-hackers
On Mon, 2002-08-12 at 10:39, Oliver Elphick wrote:
> On Mon, 2002-08-12 at 15:00, Greg Copeland wrote:
> > How exactly would you create an abstract base class for table type?
>
> CREATE TABLE abstract_base (
>    cols ...,
>    CONSTRAINT "No data allowed in table abstract_base!" CHECK (1 = 0)
> )
>
> This assumes that the constraint is not inherited or can be removed in
> child tables.
>

Why would I assume that constraints would not be inherited?  Seems as a
general rule of thumb, you'd want the constraints to be inherited.  Am I
missing something?

Also, if I remove the constraint on the child table, doesn't that really
mean I'm removing the constraint on the parent table?  That would seem
to violate the whole reason of having constraints.  If a constraint is
placed in an ABC and we find that we later need to remove it for EVERY
derived class, doesn't that imply it shouldn't of been in there to begin
with?  After all, in this case, we're saying that each and every derived
class needs to overload or drop a specific constraint.  That strikes me
as being rather obtuse.

That, in it self, I find rather interesting.  Is there any papers or
books which offers explanation of how constraints should handled for
table inheritance?

Greg


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

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: [GENERAL] Linux Largefile Support In Postgresql RPMS
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: [GENERAL] Linux Largefile Support In Postgresql RPMS