Re: Trigger on Postgres for tables syncronization

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Prabu Subroto <prabu_subroto(at)yahoo(dot)com>
Cc: Postgres General Milis <pgsql-general(at)postgresql(dot)org>
Subject: Re: Trigger on Postgres for tables syncronization
Date: 2004-07-27 13:59:01
Message-ID: 1090936741.909.14.camel@coppola.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Prabu,

Views show you the exact content of the table(s) they are built upon,
filtered by some conditions.
Just try to create appointment0 and appointment1 like this:

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

CREATE VIEW appointment1 AS SELECT * FROM appointment WHERE done = 'N';

Now you can use appointment0 and appointment1 for selects exactly as you
would use any other table, and they will show you exactly the data in
appointment, filtered by the values of the "done" column.

If you still don't understand how all this works, then you should take
an SQL tutorial and read up on views.
In any case you should read the postgres documentation which is quite
good:
http://www.postgresql.org/docs/7.4/static/index.html

HTH,
Csaba.

On Tue, 2004-07-27 at 15:35, Prabu Subroto wrote:
> But I think, the modification of records to the table
> "appointment0" dan "appointment1" must be done
> automatically if my program modifies the
> "appointment". That's why I think I should use trigger
> and function.
>
> Please tell me more detail.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Prabu Subroto 2004-07-27 14:09:01 Re: Trigger on Postgres for tables syncronization
Previous Message Prabu Subroto 2004-07-27 13:55:43 Re: Trigger on Postgres for tables syncronization