Received: from Donald.bks (unknown [203.145.133.13]) by postgresql.org (Postfix) with ESMTP id 86D7C474E42 for ; Thu, 14 Mar 2002 00:44:44 -0500 (EST) Received: from Larry.bks (root@Larry.bks [200.2.1.10]) by Donald.bks (8.11.6/8.11.2) with ESMTP id g2E5lJW01920 for ; Thu, 14 Mar 2002 11:17:20 +0530 Received: from localhost (bhuvan@localhost) by Larry.bks (8.9.3/8.8.5) with ESMTP id LAA01060 for ; Thu, 14 Mar 2002 11:10:35 +0530 X-Authentication-Warning: Larry.bks: bhuvan owned process doing -bs Date: Thu, 14 Mar 2002 11:10:35 +0530 (IST) From: Bhuvan A X-Sender: bhuvan@Larry To: pgsql-sql@postgresql.org Subject: checking for existence of a table in plpgsql. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200203/178 X-Sequence-Number: 7058 hi, here i use postgresql 7.2. how can one know that a particular table exists or not in plpgsql? need is something like this.. from plpgsql, i wish to insert a record in a table (create and insert, if not exists). --- create function ftest() returns int as 'declare begin if then insert into
(...) values (...); else create
(...); insert into
(...) values (...); end if; return row_count; end;' language 'plpgsql'; ---- hope to get some lights. Regards, Bhuvaneswaran.