Re: Advisable to move SQL from PHP to functions?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Advisable to move SQL from PHP to functions?
Date: 2003-05-13 20:36:13
Message-ID: 200305131336.13296.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2003-05-13 20:43:53 Re: can't alter user with the postgres user
Previous Message Rory Campbell-Lange 2003-05-13 20:20:24 Re: Advisable to move SQL from PHP to functions?