Re: Question about functions - Mailing list pgsql-sql

From Richard Huxton
Subject Re: Question about functions
Date
Msg-id 43538843.5000308@archonet.com
Whole thread Raw
In response to Question about functions  (Mike Plemmons <mikeplemmons@gmail.com>)
List pgsql-sql
Mike Plemmons wrote:
>>
>>These are great tips! I will be more specific the next time I post.
>>Regarding the ineffiencient query. What do you suggest as a better way? I
>>would rather learn proper methods than continue to use improper ones.

Just send the query directly from the application - the way you're doing 
it, the function will have to assemble the query, execute it, fetch all 
the results and then return them to your application. Of course, if your 
query altered each row as it fetched them (e.g. to calculate a running 
total) then this would be a sensible approach.

PS - don't forget to CC: the list when replying - that's the convention 
around here.
--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Question about functions
Next
From: David Pradier
Date:
Subject: Re: Design problem : using the same primary keys for inherited objects.