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

From Greg Stark
Subject Re: Undropping a column?
Date
Msg-id 87llpwcpzg.fsf@stark.dyndns.tv
Whole thread Raw
In response to Undropping a column?  (Greg Stark <gsstark@mit.edu>)
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? I haven't done any other
> updates though autovacuum may have run.

Ok, I seem to have done it with this:

update pg_attribute set attisdropped = 'f',atttypid= 25
 where attrelid = 17839 and attname = '........pg.dropped.9........';

I've now updated the table to copy this data over to the new column and
redropped the old column. Have I messed up my database?

--
greg

pgsql-general by date:

Previous
From: Jonathan Bartlett
Date:
Subject: Re: PostgreSQL from a newcomers perspective
Next
From: Tom Lane
Date:
Subject: Re: Undropping a column?