Thread: DROP COLUMN really work?

DROP COLUMN really work?

From
Ruslan A Dautkhanov
Date:
Hi all,


  isbs=# select version();
                                version
  -------------------------------------------------------------------
   PostgreSQL 7.3 on i386-unknown-freebsd4.7, compiled by GCC 2.95.4
  (1 row)

  isbs=# create table abba (x int4, y int4);
  CREATE TABLE
  isbs=# \d abba
         Table "abba"
   Column |  Type   | Modifiers
  --------+---------+-----------
   x      | integer |
   y      | integer |

  isbs=# alter table abba drop column x;
  ALTER TABLE
  isbs=# \d abba
                    Table "abba"
            Column            |  Type   | Modifiers
  ------------------------------+---------+-----------
   ........pg.dropped.1........ | integer |
   y                            | integer |


Why the first column not really deleted from table? How to make it work?
I tries using VACUUM FULL abba, but this didn't help. Thanks a lot for comments.


P.S. btw, I upgrade my DBs from 7.2.1 to 7.3 version without any problems, but
  found, that psql's help messages (\h, \h alter table etc.) not from 7.3
  version. For example, it do not contain \h CREATE SCHEMA help message.


--
 best regards,
Ruslan A Dautkhanov  rusland@scn.ru

Re: DROP COLUMN really work?

From
Rod Taylor
Date:
Sounds to me like your using an old version of psql with the new
database -- it will show the stale columns, but they're not really
there.

On Sun, 2002-12-01 at 07:27, Ruslan A Dautkhanov wrote:
> Hi all,
>=20
>=20
>   isbs=3D# select version();
>                                 version
>   -------------------------------------------------------------------
>    PostgreSQL 7.3 on i386-unknown-freebsd4.7, compiled by GCC 2.95.4
>   (1 row)
>=20
>   isbs=3D# create table abba (x int4, y int4);
>   CREATE TABLE
>   isbs=3D# \d abba
>          Table "abba"
>    Column |  Type   | Modifiers
>   --------+---------+-----------
>    x      | integer |
>    y      | integer |
>=20
>   isbs=3D# alter table abba drop column x;
>   ALTER TABLE
>   isbs=3D# \d abba
>                     Table "abba"
>             Column            |  Type   | Modifiers
>   ------------------------------+---------+-----------
>    ........pg.dropped.1........ | integer |
>    y                            | integer |
>=20
>=20
> Why the first column not really deleted from table? How to make it work?
> I tries using VACUUM FULL abba, but this didn't help. Thanks a lot for co=
mments.
>=20
>=20
> P.S. btw, I upgrade my DBs from 7.2.1 to 7.3 version without any problems=
, but
>   found, that psql's help messages (\h, \h alter table etc.) not from 7.3
>   version. For example, it do not contain \h CREATE SCHEMA help message.
>=20
>=20
> --
>  best regards,
> Ruslan A Dautkhanov  rusland@scn.ru
--=20
Rod Taylor <rbt@rbt.ca>