Re: [GENERAL] delete columm help

Tom Ivar Helbekkmo <tih+mail@hamartun.priv.no>

From: Tom Ivar Helbekkmo <tih+mail@Hamartun.Priv.NO>
To: Joao Paulo Felix <felix@cyclades.com>
Cc: "pgsql-general@postgreSQL.org" <pgsql-general@postgreSQL.org>
Date: 1998-05-28T05:32:08Z
Lists: pgsql-hackers
Joao Paulo Felix <felix@cyclades.com> writes:

> 1) Good books/reference on PostgreSQL for a novice?

I've no particular SQL book to recommend, although I hear much good
about Joe Celco's "SQL for Smarties".  For a very good online
tutorial, check out <http://w3.one.net/~jhoffman/sqltut.htm>.

> 2) How do I delete a columm from a table, I have tried to use the
> following:
> 
> DELETE FROM table_name columm_name

That should be

	alter table table_name drop column column_name;

However, it's not yet implemented.  You might rename the table, create
a new one lacking the offending column, and copy the data over.  On
the other hand, you might just not worry about it.  That's one of the
great things about SQL: if you can take the space consumption hit, an
extraneous column doesn't matter.  Just don't "select *", which you
normally shouldn't do anyway.

-tih
-- 
Popularity is the hallmark of mediocrity.  --Niles Crane, "Frasier"