pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
force view column varchar(32) to varchar(128)
3+ messages / 3 participants
[nested] [flat]

* force view column varchar(32) to varchar(128)
@ 2010-11-19 15:02 Emi Lu <emilu@encs.concordia.ca>
  2010-11-19 16:54 ` Re: force view column varchar(32) to varchar(128) Andreas Kretschmer <akretschmer@spamfence.net>
  2010-11-19 17:34 ` Re: force view column varchar(32) to varchar(128) Richard Broersma <richard.broersma@gmail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Emi Lu @ 2010-11-19 15:02 UTC (permalink / raw)
  To: pgsql-sql

Hello,

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

Example:
===================
v1 (id varchar(32) ... )

There are more than 1000 other views depend on v1.

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

create or replace v1 AS

select id::varchar(128), ......

Thanks a lot!
--
Lu Ying




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: force view column varchar(32) to varchar(128)
  2010-11-19 15:02 force view column varchar(32) to varchar(128) Emi Lu <emilu@encs.concordia.ca>
@ 2010-11-19 16:54 ` Andreas Kretschmer <akretschmer@spamfence.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Andreas Kretschmer @ 2010-11-19 16:54 UTC (permalink / raw)
  To: pgsql-sql

Emi Lu <emilu@encs.concordia.ca> wrote:

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

No, you have to recreate the view ...


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: force view column varchar(32) to varchar(128)
  2010-11-19 15:02 force view column varchar(32) to varchar(128) Emi Lu <emilu@encs.concordia.ca>
@ 2010-11-19 17:34 ` Richard Broersma <richard.broersma@gmail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Richard Broersma @ 2010-11-19 17:34 UTC (permalink / raw)
  To: emilu@encs.concordia.ca; +Cc: pgsql-sql

On Fri, Nov 19, 2010 at 7:02 AM, Emi Lu <emilu@encs.concordia.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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2010-11-19 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-19 15:02 force view column varchar(32) to varchar(128) Emi Lu <emilu@encs.concordia.ca>
2010-11-19 16:54 ` Andreas Kretschmer <akretschmer@spamfence.net>
2010-11-19 17:34 ` Richard Broersma <richard.broersma@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox