Re: PERSISTANT PREPARE (another point of view) - Mailing list pgsql-sql

From Richard Huxton
Subject Re: PERSISTANT PREPARE (another point of view)
Date
Msg-id 487F0335.9020207@archonet.com
Whole thread Raw
In response to Re: PERSISTANT PREPARE (another point of view)  (Milan Oparnica <milan.opa@gmail.com>)
List pgsql-sql
Milan Oparnica wrote:
> Milan Oparnica wrote:
>>
>> It's simply to complicated to return recordsets through server-side 
>> stored procedures. They are obviously designed to do complex data 
>> manipulation, returning few output variables informing the caller 
>> about final results. Returning records through sets of 
>> user-defined-types is memory and performance waste (please see my 
>> previous post as reply to Steve for more details).

I'm not convinced it's always a win one way or another.
>> Plus it's hard to
>> maintain and make improvements to such a system. I hate to see 800 
>> user types made for every query we made as stored procedure.
> 
> Is this topic completely out of scope in Postgre ?
> If I'm missing something too obvious or too important, please let me 
> know what.

You still haven't said what's "too complicated" about defining a function:

CREATE FUNCTION users_at_dotcom(text) RETURNS SETOF users AS $$  SELECT * FROM users WHERE email LIKE '%@' || $1 ||
'.com';
$$ LANGUAGE SQL;

SELECT * FROM users_at_dotcom('archonet'); uid |  uname  |         email
-----+---------+-----------------------   1 | richard | richardh@archonet.com


--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: PERSISTANT PREPARE (another point of view)
Next
From: Florian Weimer
Date:
Subject: Generating table rows from arrays