Re: Trigger on Postgres for tables syncronization

Поиск
Список
Период
Сортировка
От Arguile
Тема Re: Trigger on Postgres for tables syncronization
Дата
Msg-id 1090960608.4530.13545.camel@broadswd.local
обсуждение исходный текст
Ответ на Re: Trigger on Postgres for tables syncronization  (Prabu Subroto <prabu_subroto@yahoo.com>)
Список pgsql-general
On Tue, 2004-07-27 at 09:55, Prabu Subroto wrote:
> PS>and if the view changes, does it also change the
> related record in table "appointment0" and "appointment1"?

Yes, because a view is pretty much just a stored query (Pg does't have
materialised views).

    CREATE VIEW apointment0 AS
        SELECT *
            FROM appointment
            WHERE done = 'Y';

You can then do further queries on that view in the same way as a table.
If you want to treat the view as a table for DML as well -- or to see
how views work internally -- see the "Rules" section of the Pg
documentation.

P.S. Consider using "done BOOLEAN NOT NULL DEFAULT FALSE" (the boolean
is what really matters) instead of "done CHAR(1) NOT NULL CHECK(done
IN('Y', 'N'))".. You might also consider some sort of index that
includes "done" depending on your data and usage.



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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: NNTP server
Следующее
От: Bill Moran
Дата:
Сообщение: PostgreSQL running in FreeBSD jail corrupts PostgreSQL running on the host system