Re: Need to change the size of a field

From: "postgresql" <pgsql(at)symcom(dot)com>
To: suresh(at)mithi(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: Need to change the size of a field
Date: 2002-02-18 14:23:54
Message-ID: 200202181406.g1IE6hE57383@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

suresh

This is pretty simple.... Just do a pg_dump of the of the database,
edit the text file, and reimport the new definitions.

something like

dg_dump 'targetdb' > outputfile

This is the same thing you are doing to backup your data. : )

Next open the outputfile in a text editor. Notice that you have all the
create table directives. Edit the value in the definition area and save
the file.

drop the original database. then reimport the dump file (you will first
have to createdb because you dropped it remember).

That's it. Your pg_dump files are your friends.

Ted

-----Original Message-----
From: <suresh(at)mithi(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Date: Mon, 18 Feb 2002 19:00:49 +0530
Subject: [SQL] Need to change the size of a field

> Hi
>
> I have a table with one of the fields as a varchar(32) field. This
> table has
> about 100,000 records.
> I want to increase the size of the varchar field to 64. How can this
be
> done
> without affecting the data already present ?
> Thanx in advance.
> regards
> suresh
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Shane Wright 2002-02-18 14:39:25 table locking
Previous Message Nick Fankhauser 2002-02-18 13:56:14 Re: Need to change the size of a field