Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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.


pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group