Re: User Management - Mailing list pgsql-novice

From Nabil Sayegh
Subject Re: User Management
Date
Msg-id 994332162.2966.1.camel@billy.labor.localnet
Whole thread Raw
In response to Re: User Management  ("Giorgio A." <jh@libero.it>)
List pgsql-novice
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



pgsql-novice by date:

Previous
From: Andrew McMillan
Date:
Subject: Re: User Management
Next
From: Nabil Sayegh
Date:
Subject: Re: User Management