Re: database abstraction -> functions

Поиск
Список
Период
Сортировка
От Dmitry Tkach
Тема Re: database abstraction -> functions
Дата
Msg-id 3D91C22A.2060500@openratings.com
обсуждение исходный текст
Список pgsql-sql
Jeroen Olthof wrote:
> Hi,
>
> When developing applications is a good thing to create abstraction between
> different layers
> The one concerning the database would be the persistence layer. To create
> such abstraction I want all mij datababase activitie runned through
> functions. But how can I return a set of rows instead of a single datatype
> (I looked into the setof but never found a clear simple)?
>

A very simple answer - there is no way to do what you want :-(
They promise to have it in 7.3...

I am using a workaround, where my functions glue all the columns together into a pipe-separated
line, that I then parse back into columns in my application...

Also, note that, unless your functions are in C (anything like plpgsql, or just sql), they are slow like hell...
In that case, you are much better off implementing your abstraction layer through views...

Dima


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

Предыдущее
От: Manfred Koizar
Дата:
Сообщение: Re: [GENERAL] CURRENT_TIMESTAMP
Следующее
От: Dmitry Tkach
Дата:
Сообщение: Re: Is there a better way than this to get the start and end of a month?