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

Re: update table data type

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Jonatan Reiners <jreiners(at)encc(dot)de>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: update table data type
Date: 2012-08-01 16:00:07
Message-ID: CAHyXU0xZq_vkatLMwjF96nt4E_4EwYYrnSEMH6eREuJ6o8QDww@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Wed, Aug 1, 2012 at 8:59 AM, Jonatan Reiners <jreiners(at)encc(dot)de> wrote:
> Hi support community,
> I have a tedious task with changing the data type of a single row from a
> postgresql 9.1.4 database.
> command:
> alter table bst alter summe set data type numeric(30,2) using
> summe::numeric;
>
> result:
>  rule _RETURN on view bills_short depends on column "summe"
>
> unfortunately more that 10 views depend on that table and i have 4 more
> tables to change.
> Is there a convenient way to handle an issue like that?
>
> Am I the only one with a problem like that? Its insane to recreate up to 40
> views in order to change 4 columns.

Unfortunately that is the case.  Typically it's a good idea if you use
a lot of views to organize the creation of them into scripts so you
can just re-apply them.

merlin

In response to

pgsql-novice by date

Next:From: Achim Jansen, Promax VPMDate: 2012-08-02 10:49:14
Subject: Slow W7 64 ODBC connection
Previous:From: Jonatan ReinersDate: 2012-08-01 13:59:56
Subject: update table data type

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