Conditional test

From: rickd(at)open-works(dot)com (Rick Dayao)
To: pgsql-sql(at)postgresql(dot)org
Subject: Conditional test
Date: 2001-12-28 02:54:30
Message-ID: 4eee2f8d.0112271854.276c1152@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message guard 2001-12-28 04:42:47 pltcl function -> plpgsql
Previous Message Roland Roberts 2001-12-27 21:14:23 Working with array value columns in PL/pgSQL triggers/functions