"OO" stored procedures? - Mailing list pgsql-general

From Walker Aumann
Subject "OO" stored procedures?
Date
Msg-id 7919.1021948007@fiduciaryasset.com
Whole thread Raw
List pgsql-general
Hi all,

I'm about to start on my first serious SQL development project, and I'm
wondering about a feature that I can't find any information about.

Brief overview: we need a database to store lots of little bits of
information about various customer accounts.  Every month, some customers
want reports.  The problem is that the customers want different reports.
Ideally, I'd like to have a stored procedure associated with each
particular customer, so I can do something like (excuse the horrible mix
of SQL and perl here):

foreach $cust ('SELECT DISTINCT customers FROM accounts WHERE
    monthly_report IS NOT NULL')
{
    $cust.report($cust, $date);
}

Is this doable, or am I supposed to define a number of
customer1_monthly_report stored procedures in the global namespace and
use those?

Walker

pgsql-general by date:

Previous
From: Dan Weston
Date:
Subject: Added index ability for isbn-issn contrib example
Next
From: Steve Lane
Date:
Subject: Re: MacOS X Shared Buffers (SHMMAX)?