Re: Changing the size of a varchar field

From: Eric Ridge <ebr(at)tcdi(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: postgres-general(at)postgresql(dot)org
Subject: Re: Changing the size of a varchar field
Date: 2004-05-07 14:23:48
Message-ID: 281D17B0-A032-11D8-9FA4-000A95BB5944@tcdi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On May 6, 2004, at 12:40 PM, Tom Lane wrote:

> Eric Ridge <ebr(at)tcdi(dot)com> writes:
>> Using PG 7.3.x, how stupid is this:
>> UPDATE pg_attribute SET atttypmod=<new size + 4> WHERE ....;
>
> It'll work okay for a varchar column (not char) at least as far as the
> table itself is concerned. I think there are some issues for views
> referencing the column, possibly also indexes.

We haven't discovered any issues. We do in fact have views sitting
infront of the these tables (w/ a bunch of update/insert rules too!)
and indexes. All seems to be well.

Can you speculate on what the issue would be? Perceived data loss (ie,
values that exceed the original size are truncated)? Inability to
update? Index scans not returning rows? Or would it be some kind of
fail-fast ERROR:?

eric

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-05-07 15:09:36 Re: Interpreting vacuum verbosity
Previous Message Lonni Friedman 2004-05-07 13:14:22 Re: vacuumdb is failing with NUMBER OF INDEX TUPLES NOT THE SAME AS HEAP