Rory,
> I'll take that to mean "yes, do it in functions and views"! I'm cautious
> about doing a month's work and then having to move that work back into
> php -- hence the question. I'm hoping that the function/view approach
> will provide faster database access too.
Well, let's put it this way: I've supported a thriving small business, for
the past two years building applications *only* that way.
> OK, this makes sense. I'm not sure how to return multiple tuples though;
> I'm hoping the ability to do this isn't limited on Postgresql 7.2.x;
> most of the servers I have access have this version. I believe that the
> ability to manage "Set Returning Functions" has been much improved in
> 7.3.
Actually, it is significantly impaired in 7.2.x. You should force an
upgrade; 7.3.x has been out for 6+ months and 7.4 is due out soon. Also 7.3
has better performance and debugging tools than 7.2.
If you're upagainst a wall, you can do what I did for my 7.2 apps: write
functions returning TEXT and have them return a query to the PHP, which it
then executes.
--
-Josh Berkus
Aglio Database Solutions
San Francisco