Re: database abstraction -> functions

From: Dmitry Tkach <dmitry(at)openratings(dot)com>
To: Jeroen Olthof <j(dot)olthof(at)millipede(dot)nl>
Subject: Re: database abstraction -> functions
Date: 2002-09-25 14:03:22
Message-ID: 3D91C22A.2060500@openratings.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Johnson, Shaunn 2002-09-25 14:12:54 dumping a pg_* table
Previous Message Lee Kindness 2002-09-25 13:34:37 Re: Postmaster Uptime

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitry Tkach 2002-09-25 14:28:08 Re: Is there a better way than this to get the start and end of a month?
Previous Message Jeroen Olthof 2002-09-25 07:17:02 function return multiply rows