Re: [GENERAL] Was: Triggers, Stored Procedures, PHP

2003-11-30 Thread Joe Conway
Alvaro Herrera wrote: Me too. I've created many functions to extract data that are joined to other functions. All in all the result is not as optimal as it could be, because the optimizer can not poke into the functions, and the estimates about functions are only guesses. If one could use parame

Re: [GENERAL] Was: Triggers, Stored Procedures, PHP

2003-11-30 Thread Alvaro Herrera
On Mon, Dec 01, 2003 at 09:38:06AM +1100, Alex Satrapa wrote: > create or replace function get_transactions (INTEGER) returns set of > record as ' > DECLARE >cust_id ALIAS FOR $1; > BEGIN > for r in select ... from ... loop > return next r; > end loop; > return; > END > ' language 'plpgsq

Re: [GENERAL] Was: Triggers, Stored Procedures, PHP

2003-11-30 Thread Chris Travers
"Shane D" <[EMAIL PROTECTED]> Wrote: > >Could someone explain to me the usefulness of views? I understand > how they are created. I understand a single query can be created as a > view returning all records in a single column of a single table, or > maybe even multiple columns across many ta

Re: [GENERAL] Was: Triggers, Stored Procedures, PHP

2003-11-29 Thread Doug McNaught
Shane D <[EMAIL PROTECTED]> writes: >But what if the films table also had a field for the production > company. This implies based on the view definition that it too, has > the field (call it prod_co). Could I use the following query to > select all Comedy films distributed by the 'Small Com

Re: [GENERAL] Was: Triggers, Stored Procedures, PHP

2003-11-29 Thread Shane D
Doug McNaught wrote: It's false. You can treat a view just like a table and add clauses to your query that restrict it beyond what the view gives you. I think that's what you're asking about... Thanks for your reply. I found an example in the postgresql reference manual in the "CREATE VIEW

Re: [GENERAL] Was: Triggers, Stored Procedures, PHP

2003-11-29 Thread Doug McNaught
Shane D <[EMAIL PROTECTED]> writes: >Could someone explain to me the usefulness of views? I understand > how they are created. I understand a single query can be created as a > view returning all records in a single column of a single table, or > maybe even multiple columns across many table

[GENERAL] Was: Triggers, Stored Procedures, PHP

2003-11-29 Thread Shane D
Jason Tesser wrote: [snip] A programmer that doesn't document stuff needs to find a new job :-) This is more of an issue with management. Anyone who does database apps for on any kind of a large scale will tell you that views, triggers, etc.. are essential. I am currently in teh process of writi