Re: [GENERAL] delete columm help - Mailing list pgsql-general

From Tom Ivar Helbekkmo
Subject Re: [GENERAL] delete columm help
Date
Msg-id 86k9772c6f.fsf@barsoom.Hamartun.Priv.NO
Whole thread Raw
In response to Off-topic: Communication. (was: Connect string again)  (Tom Ivar Helbekkmo <tih+mail@Hamartun.Priv.NO>)
List pgsql-general
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"

pgsql-general by date:

Previous
From: Peter T Mount
Date:
Subject: Re: [HACKERS] Off-topic: Communication. (was: Connect string again)
Next
From: Jaosn Tan
Date:
Subject: JDBC drivers