Re: PERSISTANT PREPARE (another point of view)

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: PERSISTANT PREPARE (another point of view)
Дата
Msg-id 487F0335.9020207@archonet.com
обсуждение исходный текст
Ответ на Re: PERSISTANT PREPARE (another point of view)  (Milan Oparnica <milan.opa@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "Pavel Stehule"
Дата:
Сообщение: Re: PERSISTANT PREPARE (another point of view)
Следующее
От: Florian Weimer
Дата:
Сообщение: Generating table rows from arrays