SELECT and server side functions

Поиск
Список
Период
Сортировка
От Neil Davis
Тема SELECT and server side functions
Дата
Msg-id OE13EEmYDKFJ2I13pL300001253@hotmail.com
обсуждение исходный текст
Список pgsql-general
Hello,
 
I am trying to figure out how to return more than one field using "SETOF".
 
I can concatenate the fields in the select statement down to one and use SETOF Text to return them, then split them back apart in my code. This is a bit kludgy though. I would rather do this the most correct and efficient way possible. In most RDBMS you can easily deal with multiple columns in server side procedures that contain a SELECT, but I can find nothing about how to do this in PostGreSQL Documentation or anywhere else.
 
How can you do this with PostGreSQL? If you can, is it better to do this this way, or better to put the query inline in the code?
 
Testing has shown that doing it this way using SETOF with a server side function is only marginally faster. I have the feeling that if I didn't have to concatenate, then split the results, that that margin would increase from 9% faster (@50 users, 20 records, 7 fields) to much faster than 9%.
 
thx,
Neil P Davis

В списке pgsql-general по дате отправления:

Предыдущее
От: "Vilson farias"
Дата:
Сообщение: CPU killer
Следующее
От: "Ben Souther"
Дата:
Сообщение: Foreign keys, adding to table.