okay. i seem to recall some discussion on pl/pgsql wherein a
function called via SELECT can't do an INSERT.
is there a way to do something like
select get_or_create(...);
which runs some pl/pgsql such as
select * from tbl where...;
if not found
insert into tbl values (...);
select * from tbl where...;
end if;
return found stuff, even if we had to create it...
or not?
i'm looking for results similar to perl code like
$something ||= &make_new();
# which translates to (more or less, for this application)
if ( ! defined( $something ) ) {
$something = &make_new();
}
return $something;
i've tried conceiving of a rule that might intervene properly,
but i'm stymied...
--
What do I need manners for? I already got me a wife.
-- Adam Pontipee, "Seven Brides for Seven Brothers"
will@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!