Increase column width only if it is different

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Increase column width only if it is different
Date: 2008-11-27 17:44:05
Message-ID: ggmmb4$25bg$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have statements in db upgrade script like

ALTER TABLE mytbl ALTER mycol TYPE CHAR(240)

This takes 80 seconds if table contains 9000 rows even if mycol type is
already 240 characters.

How to check in sql or in pgsql and run this statement only of mycol width
is not 240 characters ?

Andrus.

Browse pgsql-general by date

  From Date Subject
Next Message Ioana Danes 2008-11-27 18:33:13 Re: Using postgres.log file for replication
Previous Message Scott Marlowe 2008-11-27 17:34:06 Re: Using postgres.log file for replication