Re: Smartest way to resize a column?

From: Phoenix Kiula <phoenix(dot)kiula(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Adrian Klaver <aklaver(at)comcast(dot)net>, Ian Barwick <barwick(at)gmail(dot)com>, PG-General Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Smartest way to resize a column?
Date: 2009-02-03 04:21:06
Message-ID: e373d31e0902022021l3a4b62f9x95b3da5a761b07d2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jan 12, 2009 at 1:02 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

.....<snip>....

> regression=# update pg_attribute set atttypmod = 35+4 where attrelid = 't1'::regclass and attname = 'f1';
> UPDATE 1
> regression=# \d t1
> Table "public.t1"
> Column | Type | Modifiers
> --------+-----------------------+-----------
> f1 | character varying(35) |
>
> (Why the +4 you ask? It's historical :-()
>

Tom, this has worked, and a "\d TABLENAME" shows that the column is
varchar(35).

But I still have messages in my log saying:

---
ERROR: value too long for type character varying(20)
---

Why is this? There are no other varchar(20) columns in my DB at all,
no other table. Only this column used to be 20 characters and using
your command I changed it to 35. It looks alright, the column also
accepts the value, but the error is logged.

I'm confused. How to stop the error?

Thanks

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2009-02-03 05:23:29 Re: display array field as row
Previous Message hendra kusuma 2009-02-03 04:12:18 display array field as row