On Thu, 2002-03-14 at 06:40, Bhuvan A wrote:
> how can one know that a particular table exists or not in plpgsql?
How about :
SELECT INTO cnt count( * ) FROM pg_class WHERE relname='mytable';
IF FOUND THEN
...
END IF;
or
IF cnt > 0 THEN
...
END IF;
This plpgsql snip, will find the number of classes that have the
"mytable" name.
Would this do the trick ?
/BL