Re: Temporary tables

From: "George A(dot)J" <jinujosein(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Temporary tables
Date: 2003-10-01 03:17:40
Message-ID: 20031001031740.66479.qmail@web14901.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rute Solipa 2003-10-01 09:28:12 Unsubscribe
Previous Message Tom Lane 2003-09-30 22:26:52 Re: [SQL] plpgsql doesn't coerce boolean expressions to