Re: Undropping a column?

From: Alex Satrapa <alex(at)lintelsys(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Undropping a column?
Date: 2003-12-01 21:59:11
Message-ID: 3FCBB9AF.4020908@lintelsys.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> 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?

You could rsync the database back from your live off-site backup, or
rifle through the piles of backups to recover from last night's archive
backup :)

Another alternative, if it's just the schema not the data you need back,
is simply to "alter table add column ..." the column back. Note that if
you want it to be "not null" or "default x" you have to add the column,
update the table with the default value in each column, alter the column
to be not null then alter the column to be default x.

Though this probably isn't what you were looking for, it's still on the
archives for someone else to stumble across c/o Google

Alex

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2003-12-01 22:09:08 Re: export FUNC_MAX_ARGS as a read-only GUC variable
Previous Message Rick Gigger 2003-12-01 21:54:59 Re: Large objects [BLOB] again - general howto