Mark,
Whoa! Based on this, you are ready to join the pgsql-sql list. This is not a
novice question!
> Can someone tell me if there's a fairly obvious reason why when I run a
> function I've written it runs twice?
>
> Here's the code (replete with debug - sorry). The basic structure has a
> number of nested 'for' loops. The trace debug
> reveals that it's running twice through yet I'm only issueing "select
> generateshiftcandidatedata();" x 1.
Um ... how are you calling the function? From psql? And when you say "it runs
twice", what do you mean, exactly? Myabe you could paste the relevant portion
of the debug output?
-Josh
______AGLIO DATABASE SOLUTIONS___________________________
Josh Berkus
Complete information technology josh@agliodbs.com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco