Re: Modify Column - Mailing list pgsql-general

From joe@jwebmedia.com
Subject Re: Modify Column
Date
Msg-id 3A27D7CE.FB3FA830@jwebmedia.com
Whole thread Raw
In response to Modify Column  (joe@jwebmedia.com)
List pgsql-general
Thanks - It's a fairly small table so I decided to create a new field and
update the table. My syntax was
UPDATE tablename SET new_column = old_column WHERE uid = uid;
However it says: Relation 'tablename' does not have attribute 'new_column'

If i do \d tablename, it shows the new column. Did I miss a step? Thanks,

Joe

Len Morgan wrote:

> >I have a column in my table that was, once upon a time, large enough, but
> >now, I need to increase the site of the column. How can I do that?
>
> Basically, you can't.  What you need to do is dump the table, then edit the
> dumped table definition to increase the size, drop the table and then source
> back in the dumped version with the larger field definition.
>
> Although it would waste a lot of space, you could also create a new field
> that IS large enough, update that field with the contents from the old
> field, then rename the two fields so that the new one has the name of the
> old one.
>
> Sounds hokey but it works.
>
> len morgan


pgsql-general by date:

Previous
From: martin.chantler@convergys.com
Date:
Subject: Re: Modify Column
Next
From: "Valter Mazzola"
Date:
Subject: Re: Database cluster?