O$: postgres and 'returning'
Phil Sparmilk
phil at mophilly.com
Thu May 10 11:00:52 EDT 2012
All good suggestions.
It is not necessary to use $insertnames and so on if you are using the Schema + Table classes, and the table class has an appropriately written custom $insert method. You can append text to the SQL statement simply by assigning a string to the $extraquerytext property of the Table instance.
As for functions, they are scary at first but the improvements in database performance, reduction of bits traveling over the wire (or wifi) and a more clear implementation of MVC theory is darned attractive. I have found the functions extremely useful for many complex queries and updates.
The benefits of functions (aka stored proc's in other dbms) shine rather brightly in cases where one or more return values are desired. You can return far more than a single column using a function, and time for a round trip is very low as the SQL parser is "pre-heated" by the function definition.
hth,
- Mark Phillips
More information about the omnisdev-en
mailing list