Re: Modify Column
От | joe@jwebmedia.com |
---|---|
Тема | Re: Modify Column |
Дата | |
Msg-id | 3A27D7CE.FB3FA830@jwebmedia.com обсуждение исходный текст |
Ответ на | Modify Column (joe@jwebmedia.com) |
Список | 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 по дате отправления: