Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBS2usm42327 for ; Thu, 27 Dec 2001 21:56:54 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id fBS2sWm52191 for pgsql-sql@postgresql.org; Thu, 27 Dec 2001 21:54:32 -0500 (EST) (envelope-from news) From: rickd@open-works.com (Rick Dayao) X-Newsgroups: comp.databases.postgresql.sql Subject: Conditional test Date: 27 Dec 2001 18:54:30 -0800 Organization: http://groups.google.com/ Lines: 11 Message-ID: <4eee2f8d.0112271854.276c1152@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Archive-Number: 200201/14 X-Sequence-Number: 6105 I am trying to solve this problem: If a table exists, drop the table, otherwise continue processing. For example, if table X exists, then drop table X. How would I do this in SQL? I can query the pg_tables table to see which tables exist, but I'm looking for an If-Else construct in SQL. Thanks in advance, Rick