On 05 Jul 2001 11:09:29 +0200, Giorgio A. wrote:
> hi, i have this very lame problem: i created a column as varchar(15) but now
> i need to have more than 15 char... how can i change this ? changing it into
> "text" will also be good !
You can't change the type of fields.
You could create a new table with proper cols and 'INSERT INTO newtable
SELECT * FROM oldtable;DROP TABLE oldtable;ALTER TABLE newtable RENAME
TO oldtable;' or something like that.
This leaves you in a mess if there are triggers involved (references
etc.)
I would suggest you 'pg_dump -D dbname > db.sql' modify the table
definitions, 'dropdb dbname;createdb dbname;psql dbname -f db.sql'
(If you can live with a short downtime and loosing some information like
oids, but that should be irrelevant in most cases)
cu
--
Nabil Sayegh