Thanks to all of you for your suggestions. the problem is solved by creating a function
istableexist() that returns whether a table exist or not. the function is bellow.
CREATE FUNCTION istableexist(varchar) RETURNS bool AS '
DECLARE
BEGIN
/* check the table exist in database and is visible*/
PERFORM relname,relnamespace FROM pg_class
WHERE relkind = ''r''
AND Upper(relname) = Upper($1)
AND pg_table_is_visible(oid);
IF FOUND THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
END;'
LANGUAGE 'plpgsql';
thanks again
jinujose
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search