Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id D51FC475498 for ; Thu, 1 Aug 2002 06:43:07 -0400 (EDT) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Thu Aug 01 12:43:00 2002 +0200 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id MAA07803; Thu, 1 Aug 2002 12:42:59 +0200 (METDST) From: Christoph Haller Message-Id: <200208011042.MAA22571@rodos> Subject: Re: determine if a table exists To: joseph@asti.dost.gov.ph (Joseph Syjuco) Date: Thu, 01 Aug 2002 12:42:59 METDST Cc: pgsql-sql@postgresql.org In-Reply-To: <1028239723.2474.8.camel@Askr>; from "Joseph Syjuco" at Aug 1, 102 12:02 (noon) X-Mailer: Elm [revision: 212.4] X-Archive-Number: 200208/8 X-Sequence-Number: 8854 > > how do i determine if a table exists using select statement > i want to find out if it exists if not ill create it if yes then ill do > some editing with it > TIA > do SELECT relname FROM pg_class WHERE relkind='r' AND relname !~ '^pg_' AND relname !~ '^pga_' AND relname !~ '^pgadmin_'; You should also refer to Chapter 3. System Catalogs in the Documentation. Regards, Christoph