i don think so. coz i've tried it before. i read a forum saying that it cant be change. don know whether true or not. maybe u can copy out ur data to a file and re-create the table. after re-creating the table, copy back the data from the file into ur new table. it works for me. hope to hear some other suggestions. cheerss...
Using PostgreSQL 7.3.1 you could do something like:
[tt]ALTER TABLE <table> RENAME COLUMN <col> TO tempcol;
ALTER TABLE <table> ADD COLUMN <col> VARCHAR(32);
UPDATE <table> SET <col>=tempcol;
ALTER TABLE <table> DROP COLUMN tempcol;[/tt]
In 7.2, by the way, you could do everything up to the [tt]DROP COLUMN[/tt]. You would not be able to drop the renamed column from the database without creating a new table and copying the data from one to the other.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.