> There are two forms to iterate over the query: > > 1. FOR target IN query LOOP > 2. FOR target IN EXECUTE text_expression LOOP
Thanks for your answer. > My suggestion is to eliminate the string you created (_WHERECLAUSE) and > add the proper conditions to the query expression you already have. But the problem here is that the where-clause depends on the relkind. That is why I'm trying to solve the problem this way. How do I then write EXECUTE queries on multiple lines, if I go with this solution? Regards Jan ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster