Re: ALTER Table

From: Shridhar Daithankar <shridhar_daithankar(at)myrealbox(dot)com>
To: Gaetano Mendola <mendola(at)bigfoot(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ALTER Table
Date: 2003-10-31 12:57:46
Message-ID: 3FA25C4A.6090606@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gaetano Mendola wrote:

> Shridhar Daithankar wrote:
>
>> Alex wrote:
>>
>>> is it possible to add a column to a table at a specific place ?
>>> Reading the man pages i could not figure that out.
>>
>>
>>
>> Why do you want to add it at specific location? What does it achieve?
>
>
> I miss the same feature too, this is my reason:
> is just to keep clean your schema, I have in my revision control system
> all tables with fields grouped for tipology:
>
> CREATE TABLE a(
>
> G1 as INTEGER,
> ...
> Gn as INTEGER,
> H1 as INTEGER,
> ...
> Hm as INTEGER
> );
>
> when I add let me say Gn+1 in my RCS I have:
>
> CREATE TABLE a(
>
> G1 as INTEGER,
> ...
> Gn as INTEGER,
> Gn+1 as INTEGER,
> H1 as INTEGER,
> ...
> Hm as INTEGER
> );
>
> and will be nice to have in my fourther dumps
> the same structure, just to do a DIFF betwen two schemas
> without become crazy!

Well, if you diff two schema dumps, you will find one line added to correct
scope i.e. {} block because it belongs to same table. And anyway there is big
difference between schema diffs and database diffs. Sure you can not produce an
SQL script which would bring two databases to same state.

Only thing that can be done is to manually reordering the schema since it gives
you pretty localised view of changes due to repository.

Also check http://www.varlena.com/varlena/GeneralBits/30.html. The last bit
summerises another discussion on this.

HTH

Shridhar

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Carmen Gloria Sepulveda Dedes 2003-10-31 13:26:28 Problem with ecpg
Previous Message Gaetano Mendola 2003-10-31 12:23:09 Re: ALTER Table