Search Postgresql Archives

Re: Resize numeric column without changing data?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 9, 2012 at 3:06 PM, Lukas Eklund <lukas@xxxxxxxxx> wrote:
> On Mon, Apr 9, 2012 at 2:51 PM, Merlin Moncure <mmoncure@xxxxxxxxx> wrote:
>> On Mon, Apr 9, 2012 at 9:57 AM, Lukas Eklund <lukas@xxxxxxxxx> wrote:
>>> Is it safe to resize a numeric column using in pg_attribute without
>>> altering the table?
>>>
>>
>> One thing that's pretty weird is that dependent view columns keep the
>> old typmod.  That might cause some issues with things that depend on
>> that value, for example client side tools.  But you can always change
>> those as well.
>>
>> I think this might work because the numeric storage doesn't change for
>> this case.  But it's still quite dangerous and avoiding view
>> re-recreation is a pretty weak justification to go be updating system
>> catalogs.  You'd be better off spending some time developing a script
>> to recreate views. The only reason why I would personally be
>> considering this would be to avoid issues stemming from having to take
>> out a lock on the table and I would be testing very, very carefully if
>> I did so.
>>
>> merlin
>
> Ah. I must have not noticed that the typmod for views is not inherited
> automatically. I'm okay with developing a script to recreate the 15 or
> so views the depend on that table. What I'm trying to avoid is locking
> that table for a substantial amount of time. Thanks for the advice!

np -- note 9.2 will be much smarter about this:

http://archives.postgresql.org/message-id/20120101003619.GA4395@xxxxxxxxxxxxxxxxxxxx

merlin

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux