From: Josh Berkus <josh@agliodbs.com>
To: Bill Moran <wmoran@potentialtech.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: [PERFORM] Set-Returning Functions WAS: On the performance of views
Date: Thu, 29 Jan 2004 11:21:54 -0800
Message-ID: <200401291121.54048.josh@agliodbs.com> (raw)
In-Reply-To: <40195B0E.3010903@potentialtech.com>
References: <40152FF2.8000007@potentialtech.com>
<200401291041.19017.josh@agliodbs.com>
<40195B0E.3010903@potentialtech.com>
Bill,
First off: discussion moved to the SQL list, where it really belongs.
> Well, I would have agreed with the uselessness, until this project. The
> "source of endless debugging" frightens me!
Well, the last time I tried to use this capability was SQL Server 7. On that
model, the problems I found were:
1) There was no good way to differentiate the recordsets returned; you had to
keep careful track of what order they were in and put in "fillers" for
recordsets that didn't get returned.
2) Most of the MS client technology (ODBC, ADO) was not prepared to handle
multiple recordsets. I ended up hiring a C-based COM hacker to write me a
custom replacement for ADO so that we could handle procedure results
reliably.
All in all, it wasn't worth it and if I had the project to do over again, I
would have chosen a different approach.
> > This can be done with Set Returning Functions. The issue is that the
> > call to the function requires special syntax, and the program calling the
> > function must know what columns are going to be returned at the time of
> > the call. Hmmm, is that clear or confusing?
>
> Clear as mud. In my case, my application simply doesn't care what row of
> what kind are returned. See, I'm writing the server end, and all said and
> done, it's really just glue (frighteningly thick glue, but glue
> nonetheless)
To be clearer: You can create a Set Returning Function (SRF) without a
clearly defined set of return columns, and just have it return "SETOF
RECORD". However, when you *use* that function, the query you use to call
it needs to have a clear idea of what columns will be returned, or you get no
data.
All of this is very hackneyed, as I'm sure you realize. Overall, I'd say
that the programming team you've been inflicted with don't like relational
databases, or at least have no understanding of them.
--
Josh Berkus
Aglio Database Solutions
San Francisco
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: josh@agliodbs.com, wmoran@potentialtech.com
Subject: Re: [PERFORM] Set-Returning Functions WAS: On the performance of views
In-Reply-To: <200401291121.54048.josh@agliodbs.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