Re: User Management

From: Nabil Sayegh <nsmail(at)sayegh(dot)de>
To: Giorgio "A(dot)" <jh(at)libero(dot)it>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: User Management
Date: 2001-07-05 11:22:53
Message-ID: 994332173.2966.2.camel@billy.labor.localnet
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Kristensen Poul 2001-07-05 12:47:43 RE: Only 350 inserts(should be1000) at a time to postpgr es(or mysql) using odbc(win) ...
Previous Message Nabil Sayegh 2001-07-05 11:22:42 Re: User Management