Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4bdA-0005Ob-20 for pgsql-bugs@postgresql.org; Thu, 23 Aug 2012 17:55:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T4bd4-0000tq-GF for pgsql-bugs@postgresql.org; Thu, 23 Aug 2012 17:55:42 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q7NHtCZv001601; Thu, 23 Aug 2012 13:55:12 -0400 (EDT) From: Tom Lane To: Alvaro Herrera cc: "tigran.mkrtchyan" , Pg Bugs Subject: Re: BUG #7502: ALTER COLUMN TYPE processed even if column type matches In-reply-to: <1345736338-sup-99@alvh.no-ip.org> References: <1345736338-sup-99@alvh.no-ip.org> Comments: In-reply-to Alvaro Herrera message dated "Thu, 23 Aug 2012 11:43:51 -0400" Date: Thu, 23 Aug 2012 13:55:12 -0400 Message-ID: <1600.1345744512@sss.pgh.pa.us> X-Pg-Spam-Score: -2.1 (--) X-Archive-Number: 201208/179 X-Sequence-Number: 33903 Alvaro Herrera writes: > So the ALTER TABLE trick is not needed in 9.0, but is useful in previous > releases. There are optimizations to avoid the table rewrite in certain > cases in 9.2: > http://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.2#Reduce_ALTER_TABLE_rewrites > According to that page, though, a change of varchar(36) to varchar(36) > would still require a table rewrite, which doesn't make sense to me. Is > the wiki page inaccurate maybe? Yeah - you can easily convince yourself by timing it that no rewrite happens in 9.2. regards, tom lane