On 2 Apr 2012, at 22:28, Bartosz Dmytrak wrote: > That is right, there is no sense to use cursors here... I think you're wrong there: The OP is querying a system table for tables of a certain name, which I expect can contain multiple rows for tables of the same name in different schema's. Of course, that may not be applicable to the her situation. Alban Hertroys -- Screwing up is an excellent way to attach something to the ceiling. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general