Re: Undropping a column? - Mailing list pgsql-general

From Tom Lane
Subject Re: Undropping a column?
Date
Msg-id 25371.1070305986@sss.pgh.pa.us
Whole thread Raw
In response to Undropping a column?  (Greg Stark <gsstark@mit.edu>)
Responses Re: Undropping a column?  (Alex Satrapa <alex@lintelsys.com.au>)
List pgsql-general
Greg Stark <gsstark@mit.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

pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: Undropping a column?
Next
From: "B. van Ouwerkerk"
Date:
Subject: Re: PostgreSQL from a newcomers perspective