Re: Undropping a column?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Undropping a column?
Date: 2003-12-01 19:13:06
Message-ID: 25371.1070305986@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greg Stark <gsstark(at)mit(dot)edu> writes:
> I just dropped a column that I wish I hadn't. Is there some simple update i
> could do to the pg_* tables that would undrop it?

Lessee ... unset 'attisdropped', put attname back the way you want,
restore atttype to the right thing. You'll need to restore any
constraints, default value, etc as well.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2003-12-01 19:28:48 Re: PostgreSQL Advocacy, Thoughts and Comments
Previous Message Greg Stark 2003-12-01 19:11:47 Re: Undropping a column?