X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 22865D1C50B for ; Tue, 13 Apr 2004 06:50:34 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 24708-02 for ; Tue, 13 Apr 2004 06:50:33 -0300 (ADT) Received: from bitoek.uni-bayreuth.de (bti0x1.bitoek.uni-bayreuth.de [132.180.112.2]) by svr1.postgresql.org (Postfix) with ESMTP id 740B8D1B515 for ; Tue, 13 Apr 2004 06:50:29 -0300 (ADT) Received: from bitoek.uni-bayreuth.de (bti0x027.bitoek.uni-bayreuth.de [132.180.112.27]) by bitoek.uni-bayreuth.de (8.12.7/8.12.7) with ESMTP id i3D9oNgX015241 for ; Tue, 13 Apr 2004 11:50:23 +0200 Message-ID: <407BB7BA.9070103@bitoek.uni-bayreuth.de> Date: Tue, 13 Apr 2004 11:49:46 +0200 From: Stefan Holzheu User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.6) Gecko/20040113 X-Accept-Language: de-at, de, en-us, en MIME-Version: 1.0 To: ADMIN Subject: varchar to text Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS - amavis-milter (http://www.amavis.org/) X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200404/195 X-Sequence-Number: 13168 I'd like to alter all columns from type varchar to text. Could I do this by: UPDATE pg_attribute SET atttypid = 25, atttypmod=-1 where attrelid =(select oid from pg_class where relname='table_name') and atttypid=1043; I just tried on a test database. It worked fine with one exception: Views depending on an altered column did not work anymore. After recreating the views it was ok. I know the procedure of "rename column - add column - delete column" but it's laborious for a large number of columns. There was also a discussion on the list maybe one year ago. Unfortunately I couldn't find the thread in the archive. We are running postgres 7.4.1 Regards Stefan -- ----------------------------- Dr. Stefan Holzheu Tel.: 0921/55-5720 Fax.: 0921/55-5799 BITOeK Wiss. Sekretariat Universitaet Bayreuth D-95440 Bayreuth -----------------------------