Thanks to Joe Conway for pointing out a couple of typos in what I posted
(the original code that I used didn't have quite as many, I edited it to
try to simplify). He also pointed out that I had not initialised my
'count' variable, which was a genuine mistake. I am pleased to say that
the correct
What I'd like to do is use dblink to extract a few rows from a remote
database and manipulate these within a function in pl/pgsql. Something
like this:
CREATE OR REPLACE FUNCTION find() RETURNS INTEGER AS '
DECLARE
count INTEGER:
myrec RECORD;
BEGIN
FOR myrec IN SELECT * FROM DBLINK