Re: alter table performance

From: Antonio Goméz Soto <antonio(dot)gomez(dot)soto(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: alter table performance
Date: 2009-12-19 21:07:19
Message-ID: 4B2D4087.7090405@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmx(dot)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
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2009-12-19 21:09:08 Re: Charset Win1250 on Windows and Ubuntu
Previous Message Dave Page 2009-12-19 21:04:30 Re: Charset Win1250 on Windows and Ubuntu