Re: Conditional ALTER TABLE - Mailing list pgsql-novice

From Tom Lane
Subject Re: Conditional ALTER TABLE
Date
Msg-id 21064.1243379027@sss.pgh.pa.us
Whole thread Raw
In response to Conditional ALTER TABLE  (Dale Seaburg <kg5lt@verizon.net>)
List pgsql-novice
Dale Seaburg <kg5lt@verizon.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

pgsql-novice by date:

Previous
From: Dale Seaburg
Date:
Subject: Conditional ALTER TABLE
Next
From: "Just E. Mail"
Date:
Subject: Re: Read data from text file