Re: inherited table and rules

Поиск
Список
Период
Сортировка
От Klint Gore
Тема Re: inherited table and rules
Дата
Msg-id 4241F0BB3C8.0B19KG@129.180.47.120
обсуждение исходный текст
Ответ на Re: inherited table and rules  (Scott Frankel <leknarf@pacbell.net>)
Ответы Re: inherited table and rules  (Scott Frankel <leknarf@pacbell.net>)
Список pgsql-general
On Wed, 23 Mar 2005 11:48:46 -0800, Scott Frankel <leknarf@pacbell.net> wrote:
>
> Close.  Thanks for the very helpful suggestions!
>
> As I read the doco on rules and dissect the rule I've constructed, one
> issue
> remains:  the UPDATE in my rule causes additional rows to be added to
> the parent table.  How is that possible?  How can it be suppressed?

Rows inserted into inherited tables are visible to the parent.  It's
effectively the same as having a union all on the 2 tables.  Using the
only qualifier is how you stop the "union" happening.

> Here's what my sample code (below) yields:
>
> cs_test=# SELECT * FROM people;

you need to put the only on this query.

Do you really want inheritance or do you just need an table with the
same/similar structure?  Maybe people_history should use like instead of
inherits.

klint.

+---------------------------------------+-----------------+
: Klint Gore                            : "Non rhyming    :
: EMail   : kg@kgb.une.edu.au           :  slang - the    :
: Snail   : A.B.R.I.                    :  possibilities  :
: Mail      University of New England   :  are useless"   :
:           Armidale NSW 2351 Australia :     L.J.J.      :
: Fax     : +61 2 6772 5376             :                 :
+---------------------------------------+-----------------+

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

Предыдущее
От: Lonni J Friedman
Дата:
Сообщение: Re: postgres oracle emulation question
Следующее
От: Sven Willenberger
Дата:
Сообщение: plperl doesn't release memory