Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group