Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0UCMDq11513 for ; Tue, 30 Jan 2001 07:22:13 -0500 (EST) (envelope-from olly@lfix.co.uk) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-31.mail.demon.net with esmtp (Exim 2.12 #1) id 14NZnS-0005a3-0V; Tue, 30 Jan 2001 12:22:06 +0000 Received: from lfix.co.uk (olly@localhost [127.0.0.1]) by linda.lfix.co.uk (8.11.2/8.11.2/Debian 8.11.2-1) with ESMTP id f0UCM5F17760; Tue, 30 Jan 2001 12:22:05 GMT Message-Id: <200101301222.f0UCM5F17760@linda.lfix.co.uk> X-Mailer: exmh version 2.2 06/23/2000 (debian 2.2-1) with nmh-1.0.4+dev X-URL: http://www.lfix.co.uk/oliver X-face: "xUFVDj+ZJtL_IbURmI}!~xAyPC"Mrk=MkAm&tPQnNq(FWxv49R}\>0oI8VM?O2VY+N7@F- KMLl*!h}B)u@TW|B}6 cc: pgsql-sql@postgresql.org Subject: Re: [HACKERS] How to modify type in table? In-reply-to: Message from "Jaruwan Laongmal" of Tue, 30 Jan 2001 10:22:23 +0700. <015601c08a6b$dd92e7e0$6d9a96cb@ntl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 30 Jan 2001 12:22:05 +0000 From: "Oliver Elphick" X-Archive-Number: 200101/453 X-Sequence-Number: 1129 "Jaruwan Laongmal" wrote: >Would you like to inform me how to modify type in table? >For example , I define type as varchar(14) , but I want to modify to varcha= >r(120). How to do this. There is no facility to do this directly. (Allowing columns to change their type would possibly involve rewriting the entire table.) You can use pg_dump to dump either a database or a particular table. Then you can edit the CREATE TABLE command in the dump output and then create a new database or table from the dump. If the table in question is not referenced by any other objects, dump it (pg_dump -t table database >dump); edit the dump; delete or rename the old table; and finally restore the dump (psql -d database