From: Christoph Haller <ch@rodos.fzk.de>
To: joseph@asti.dost.gov.ph
Cc: pgsql-sql@postgresql.org
Subject: Re: determine if a table exists
Date: Thu, 01 Aug 2002 12:42:59 METDST
Message-ID: <200208011042.MAA22571@rodos> (raw)
In-Reply-To: <1028239723.2474.8.camel@Askr>
>
> 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
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: ch@rodos.fzk.de, joseph@asti.dost.gov.ph
Subject: Re: determine if a table exists
In-Reply-To: <200208011042.MAA22571@rodos>
* 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