Calculated fileds in pg

Поиск
Список
Период
Сортировка
От Jean-Christian Imbeault
Тема Calculated fileds in pg
Дата
Msg-id 3DE08AB2.3020904@mega-bucks.co.jp
обсуждение исходный текст
Ответы Re: Calculated fileds in pg  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
Is it possible to set up a field during table creation to be a
"calculated" field, i.e. the value is calculated from other values.

For example:

Table A:

id   integer primary key,
B_id integer references B(id),
cost integer default 0

Table B:

id    integer primary key,
total integer -- select sum(cost) from A where B_id=id;

If not should I be looking at implementing this with a view or maybe a
trigger?

Thanks,

Jc


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

Предыдущее
От: Aleksei Wolff
Дата:
Сообщение: GUI for Postgres Management? PostgreSQL vs MySQL.
Следующее
От: Justin Clift
Дата:
Сообщение: Re: GUI for Postgres Management? PostgreSQL vs MySQL.