Re: Conditional ALTER TABLE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dale Seaburg <kg5lt(at)verizon(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Conditional ALTER TABLE
Date: 2009-05-26 23:03:47
Message-ID: 21064.1243379027@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Dale Seaburg <kg5lt(at)verizon(dot)net> writes:
> Is there a way to make a conditional ALTER TABLE command?

Nope, no such feature. Consider writing a plpgsql function that
contains whatever logic you need.

> As an alternative, how best to tell SQL (Query tool) to continue
> processing a script even if an "error" (like no column exists) is
> encountered.

psql will do that happily enough.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Just E. Mail 2009-05-26 23:10:51 Re: Read data from text file
Previous Message Dale Seaburg 2009-05-26 22:59:06 Conditional ALTER TABLE