pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dmitry Tkach <dmitry@openratings.com>
To: Jeroen Olthof <j.olthof@millipede.nl>
Subject: Re: database abstraction -> functions
Date: Wed, 25 Sep 2002 10:03:22 -0400
Message-ID: <3D91C22A.2060500@openratings.com> (raw)
References: <amp565$2h8r$1@news.hub.org>


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




view thread (2+ messages)

Message-ID: <3D91C22A.2060500@openratings.com>
Permalink:  ../3D91C22A.2060500@openratings.com/
Also on:    postgresql.org/message-id/3D91C22A.2060500@openratings.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: dmitry@openratings.com, j.olthof@millipede.nl
  Subject: Re: database abstraction -> functions
  In-Reply-To: <3D91C22A.2060500@openratings.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox