Re: [SQL] Using VIEW to simplify code...

2002-11-19 Thread Chris Gamache
--- Tom Lane <[EMAIL PROTECTED]> wrote: > Stephan Szabo <[EMAIL PROTECTED]> writes: > > On Tue, 19 Nov 2002, Chris Gamache wrote: > >> Understood. PostgreSQL 7.2.3. > > > 7.3 will be better for this. There were questions about the safety > > of pushing clauses down in queries with union and inter

Re: [SQL] Using VIEW to simplify code...

2002-11-19 Thread Tom Lane
Stephan Szabo <[EMAIL PROTECTED]> writes: > On Tue, 19 Nov 2002, Chris Gamache wrote: >> Understood. PostgreSQL 7.2.3. > 7.3 will be better for this. There were questions about the safety > of pushing clauses down in queries with union and intersect and > earlier versions wouldn't push down becaus

Re: [SQL] Using VIEW to simplify code...

2002-11-19 Thread Stephan Szabo
On Tue, 19 Nov 2002, Chris Gamache wrote: > > If you want help, you must provide details. The PG version number is > > relevant also. > > Understood. PostgreSQL 7.2.3. 7.3 will be better for this. There were questions about the safety of pushing clauses down in queries with union and intersect

Re: [SQL] Using VIEW to simplify code...

2002-11-19 Thread Chris Gamache
> If you want help, you must provide details. The PG version number is > relevant also. Understood. PostgreSQL 7.2.3. Here's the generated client side sql: select case when (hasflag(ut.flags,1) or (current_timestamp - '1 day'::interval < trl.trans_date)) then case when trl.trans_data

Re: [SQL] Using VIEW to simplify code...

2002-11-19 Thread Tom Lane
Chris Gamache <[EMAIL PROTECTED]> writes: > Right now I dynamicly generate the SQL for an incredibly ugly 4 table join > based on user information client-side. I got the bright idea to create a view > and then run a MUUUCH simpler client-side query on that view. The problem is > that PostgreSQL app

[SQL] Using VIEW to simplify code...

2002-11-19 Thread Chris Gamache
Right now I dynamicly generate the SQL for an incredibly ugly 4 table join based on user information client-side. I got the bright idea to create a view and then run a MUUUCH simpler client-side query on that view. The problem is that PostgreSQL apparantly runs the view FIRST and then applies the c