[GENERAL] SELECT * in a view

2010-04-21 Thread Rob Richardson
Greetings! Today's request for the impossible: My database has a view that is not filtered enough for one of my reports. The report (done in CR XI) has a dynamic parameter based on that view, but only records with a certain field (complete = 1) should be shown. The easiest way to do that is

Re: [GENERAL] SELECT * in a view

2010-04-21 Thread Tom Lane
Rob Richardson rob.richard...@rad-con.com writes: The old view and the new view should have the same fields. So, I tried something like this: CREATE VIEW new_view AS SELECT * FROM old_view WHERE complete = 1; The query was accepted and the new_view was created. But when I

Re: [GENERAL] SELECT * in a view

2010-04-21 Thread Merlin Moncure
On Wed, Apr 21, 2010 at 1:59 PM, Tom Lane t...@sss.pgh.pa.us wrote: Rob Richardson rob.richard...@rad-con.com writes: The old view and the new view should have the same fields.  So, I tried something like this: CREATE VIEW new_view AS     SELECT * FROM old_view     WHERE complete = 1; The

Re: [GENERAL] SELECT * in a view

2010-04-21 Thread Andreas Kretschmer
Tom Lane t...@sss.pgh.pa.us wrote: That's not what I want. That means that if old_view changes, new_view will not reflect the changes. Is there any way to get new_view to automatically include all fields from old_view, no matter how many or how few fields there are? No. This

Re: [GENERAL] SELECT * in a view

2010-04-21 Thread Merlin Moncure
On Wed, Apr 21, 2010 at 2:14 PM, Andreas Kretschmer akretsch...@spamfence.net wrote: Tom Lane t...@sss.pgh.pa.us wrote: That's not what I want.  That means that if old_view changes, new_view will not reflect the changes.  Is there any way to get new_view to automatically include all fields