Re: alter table performance - Mailing list pgsql-general

From Antonio Goméz Soto
Subject Re: alter table performance
Date
Msg-id 4B2D4087.7090405@gmail.com
Whole thread Raw
In response to Re: alter table performance  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: alter table performance  (Jaime Casanova <jcasanov@systemguards.com.ec>)
Re: alter table performance  (Jaime Casanova <jcasanov@systemguards.com.ec>)
List pgsql-general
Hi,

is there a way in sql to dynamically test for version 7.3, so I can run the

   alter table add column
   update table set column = .. where column IS NULL;
   alter table alter column set not null

on 7.3, and on newer versions:

   alter table add column ... not null default '';

Maybe I can create pg/SQL function, that does this, and remove it
afterwards.
or is there a better way?

Thanks
Antonio

Op 17-12-09 23:46, Tom Lane schreef:
> Thomas Kellerer<spam_eater@gmx.net>  writes:
>
>> What's wrong with:
>> alter table person add column address varchar(64) not null default '';
>>
> This:
>
> regression=# alter table person add column address varchar(64) not null default '';
> ERROR:  Adding columns with defaults is not implemented.
>          Add the column, then use ALTER TABLE SET DEFAULT.
> regression=# \q
>
> This is just one of many many things that could be improved by getting
> off of 7.3.  In general, complaining about performance (or features)
> of a seven-year-old, long since EOL'd release is not a productive use of
> anybody's time.
>
>             regards, tom lane
>


pgsql-general by date:

Previous
From: Dave Page
Date:
Subject: Re: Charset Win1250 on Windows and Ubuntu
Next
From: Adrian Klaver
Date:
Subject: Re: Charset Win1250 on Windows and Ubuntu