Обсуждение: inheritance

Поиск
Список
Период
Сортировка

inheritance

От
Bernhard Matthias Ertl
Дата:
Hi,

only two short questions:
+ does the postgresql 6.2.1 already support inheritance and
+ if I have the tables cities and capitals (like in the tutorial), how can
I add attributes of a city to a capital? Before the capital attributes,
after the capital attributes or do I have to insert a capital citiy into
the table city as well as into the table capital?

Thanx, Bernhard



*********************************************************************
* Bernhard Matthias Ertl  *  email: ertl@bigfoot.com                *
* Calslaan 1-107          *                                         *
* NL-7522 MH Enschede     *         ertl@edupsy.uni-muenchen.de     *
* Tel: ++31 53 489 5001   *                                         *
*********************************************************************


Re: [SQL] inheritance

От
"Oliver Elphick"
Дата:
Bernhard Matthias Ertl wrote:
  >Hi,
  >
  >only two short questions:
  >+ does the postgresql 6.2.1 already support inheritance and
  >+ if I have the tables cities and capitals (like in the tutorial), how can
  >I add attributes of a city to a capital? Before the capital attributes,
  >after the capital attributes or do I have to insert a capital citiy into
  >the table city as well as into the table capital?
A descendant automatically inherits all attributes from its ancestor(s).

Try \d and see.

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "Let no man despise thy youth; but be thou an example
      of the believers, in word, in conversation, in
      charity, in spirit, in faith, in purity."
                                       I Timothy 4:12