Re: [GENERAL] Change table structure.

From: Stuart Rison <rison(at)biochemistry(dot)ucl(dot)ac(dot)uk>
To: "Michal A(dot) Kowalski" <mak(at)minfo(dot)com(dot)pl>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Change table structure.
Date: 1999-09-23 15:03:29
Message-ID: Pine.LNX.4.10.9909231601281.25020-100000@bsmlx17
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

AFAIK, you can add and and rename columns no problem:

functions=> \h alter table
Command: alter table
Description: add/rename attributes, rename tables
Syntax:
ALTER TABLE class_name [*] ADD COLUMN attr type
ALTER TABLE class_name [*] RENAME [COLUMN] attr1 TO attr2
ALTER TABLE class_name1 RENAME TO class_name2

But you can't drop a column without a DROP and CREATE again.

On Thu, 23 Sep 1999, Michal A. Kowalski wrote:

> Hi,
>
> is there any way to change table structure without doing DROP and CREATE
> again?
>
> Regards,
> MAK.
> ___________________________________________________________________________
> -- Michal A. Kowalski -- http://www.minfo.com.pl -- mak(at)minfo(dot)com(dot)pl --
>
> ************
>

Stuart C. G. Rison
Department of Biochemistry and Molecular Biology
6th floor, Darwin Building, University College London (UCL)
Gower Street, London, WC1E 6BT, United Kingdom
Tel. 0207 504 2303, Fax. 0207 380 7033
e-mail: rison(at)biochem(dot)ucl(dot)ac(dot)uk

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Teodor Cimpoesu 1999-09-23 15:46:05 Re: [GENERAL] Change table structure.
Previous Message Michal A. Kowalski 1999-09-23 14:48:01 Change table structure.