Re: Alter definition of a column

Поиск
Список
Период
Сортировка
От Josh Williams
Тема Re: Alter definition of a column
Дата
Msg-id E1H8NVx-0004Wh-Nj@garm.runbox.com
обсуждение исходный текст
Ответ на Re: Alter definition of a column  ("Kelly Burkhart" <kelly.burkhart@gmail.com>)
Список pgsql-general
From: "Kelly Burkhart" <kelly.burkhart@gmail.com>
> On 1/20/07, Shoaib Mir <shoaibmir@gmail.com> wrote:
> > Should help --> ALTER TABLE tablename ALTER columname TYPE text;
>
> I was looking for a way to alter a column from varchar(n) to text
> without using the alter command and consequently touching every single
> row.  Below is sql which seems to work, but is it advisable to do such
> shenanigans?  (are varchar and text the same thing)?

Always have been under the impression myself that text and varchar (and character varying for that matter) were all
aliasesfor the exact same thing in the back end.  Just the latter allows for that limit (n) to be specified if your
specsrequire.  Leaving that off saves a few validation cycles, but at the possible expense of schema and data
incompatabilitywith other systems should that ever matter. 

So yeah, I don't see any reason it shouldn't work just fine.

 - Josh Williams

В списке pgsql-general по дате отправления:

Предыдущее
От: "Shoaib Mir"
Дата:
Сообщение: Re: Alter definition of a column
Следующее
От: "Michael Nolan"
Дата:
Сообщение: More grist for the PostgreSQL vs MySQL mill