Thread: a problem
hello
How do i change the definition of a column? one of the columns width is not sufficient to store the data. I want to change the width. how to do that in postgres? I tried doing alter table + change/modify. both of them doesn't work in postgres.
and what is the maximum size to which a postgres database can grow? I have huge data to store.
regards
sharvari
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
if your table is named foo and the field you want to chage is bar, then:
BEGIN;
ALTER TABLE foo RENAME bar TO bar_old;
ALTER TABLE foo ADD bar VARCHAR(<new_size>);
UPDATE foo SET bar=bar_old;
*if everything went ok then*
ALTER TABLE foo DROP bar_old;
COMMIT;
same goes for CHAR data type.
about limitations:
http://www.postgresql.org/users-lounge/limitations.html
On Fri, 2003-08-22 at 06:01, sharvari N wrote:
BEGIN;
ALTER TABLE foo RENAME bar TO bar_old;
ALTER TABLE foo ADD bar VARCHAR(<new_size>);
UPDATE foo SET bar=bar_old;
*if everything went ok then*
ALTER TABLE foo DROP bar_old;
COMMIT;
same goes for CHAR data type.
about limitations:
http://www.postgresql.org/users-lounge/limitations.html
On Fri, 2003-08-22 at 06:01, sharvari N wrote:
hello
How do i change the definition of a column? one of the columns width is not sufficient to store the data. I want to change the width. how to do that in postgres? I tried doing alter table + change/modify. both of them doesn't work in postgres.
and what is the maximum size to which a postgres database can grow? I have huge data to store.
regards
sharvari
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software