pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: George A.J <jinujosein@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: Temporary tables
Date: Tue, 30 Sep 2003 20:17:40 -0700 (PDT)
Message-ID: <20031001031740.66479.qmail@web14901.mail.yahoo.com> (raw)
In-Reply-To: <BAY2-F50EiLFkSOMF5Y0002892d@hotmail.com>


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

view thread (12+ messages)

Message-ID: <20031001031740.66479.qmail@web14901.mail.yahoo.com>
Permalink:  ../20031001031740.66479.qmail@web14901.mail.yahoo.com/
Also on:    postgresql.org/message-id/20031001031740.66479.qmail@web14901.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jinujosein@yahoo.com
  Subject: Re: Temporary tables
  In-Reply-To: <20031001031740.66479.qmail@web14901.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox