Re: changing the size of a column without losing data
От | paul butler |
---|---|
Тема | Re: changing the size of a column without losing data |
Дата | |
Msg-id | T5ce2612611ac1785c21bc@pcow053o.blueyonder.co.uk обсуждение исходный текст |
Ответ на | changing the size of a column without losing data ("Mark Seftel" <mark@trustemail.com>) |
Список | pgsql-novice |
From: "Mark Seftel" <mark@trustemail.com> To: <pgsql-novice@postgresql.org> Subject: [NOVICE] changing the size of a column without losing data Date sent: Thu, 22 Aug 2002 19:43:57 +0200 Mark Alter colummn isn't implemented beyond renaming as far as I know, I do it by brute force, eg: Begin; ALTER TABLE table RENAME TO table2; DROP INDEX table_pkey; CREATE TEMPORARY TABLE tabletemp() INHERITS (table2); INSERT INTO tabletemp SELECT * FROM table2; CREATE TABLE table( field varchar(150) PRIMARY KEY); INSERT INTO table SELECT * FROM tabletemp; DROP table2; DROP tabletemp; End; I always do these things in a transaction (wonderful things) as I often make typo's Hope this helps Paul Butler > hi, > > How would i change a field which is currently char100 to char50? > > have tried: > ALTER TABLE outlets MODIFY description varchar(50); > > but get error: > parser: parse error at or near "modify" > > what is the correct command. > > Thx > > Mark > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
В списке pgsql-novice по дате отправления: