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
>