Search Postgresql Archives

Re: alter table performance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>  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


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux