Converting char to varchar automatically - Mailing list pgsql-general

From Andrus
Subject Converting char to varchar automatically
Date
Msg-id CA29994F346F4824AF54485A8059B187@dell2
Whole thread Raw
Responses Re: Converting char to varchar automatically
Re: Converting char to varchar automatically
List pgsql-general
Database contains about 300 tables.
Most of them contain columns of char(n) type.
 
How to convert all those columns to varchar automatically ?
 
Is it possible to run some update commands in system tables for this ?
Or is it possible to create pgsql script which creates dynamically alter table alter column commands and PERFORMs them ?
 
Any tables have primary keys with char(n) columns and foreign keys on them. Foreign keys are deferrable and initially  immediate.
Will foreign keys allow to perform such alter table alter column commands ?
Or is there better way.
 
Andrus.

pgsql-general by date:

Previous
From: Shingo horiuchi
Date:
Subject: How does PostgerSQL planner decide driving table
Next
From: Andy Colson
Date:
Subject: Re: Converting char to varchar automatically