Rick Dayao wrote:
> 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.
You can drop the table and ignore the error if returned. We will have
CREATE OR REPLACE in 7.2, but no conditional DROP.
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026