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 | [EMAIL PROTECTED]
--
Richard Huxton
Archonet Ltd
--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql