Re: force view column varchar(32) to varchar(128)

From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
To: emilu(at)encs(dot)concordia(dot)ca
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: force view column varchar(32) to varchar(128)
Date: 2010-11-19 17:34:11
Message-ID: AANLkTikk-LpNNyvMPsuKzhvgk9DJf-cU+XnZqsSWv+Jz@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Nov 19, 2010 at 7:02 AM, Emi Lu <emilu(at)encs(dot)concordia(dot)ca> wrote:

> Is there a way to force the view column change from varhcar(32) to
> varchar(128)?

> Instead of recreating all other 1000 views, is there a way postgresql 8.3
> can do/accept:

Ouch! That stinks. I feel your pain (well my pain came from just
changing about 15-20 views. changing 1000 views would make me
cringe). Its too bad you haven't or can't use a dimensionless varchar
for your id column (I assume this is your primary key). This would
eliminate the need to re-dimension your varchar columns.

As I see it, you don't have an option. PgAdmin can be a great help
here. Open the create script and make the changes and save both.

The only other Option that I can see would be to dump the table and
view defintions. Modify these definitions with sed. Apply the new
schema, and lastly, use an ETL software to push your data to the new
schema.

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitriy Igrishin 2010-11-21 11:50:15 Re: PostgreSQL array, recursion and more
Previous Message Andreas Kretschmer 2010-11-19 16:54:56 Re: force view column varchar(32) to varchar(128)