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. ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org