Re: Quick way to alter a column type?

Поиск
Список
Период
Сортировка
От Ow Mun Heng
Тема Re: Quick way to alter a column type?
Дата
Msg-id 1215572989.22595.1.camel@neuromancer.home.net
обсуждение исходный текст
Ответ на Re: Quick way to alter a column type?  (Lew <conrad@lwsc.ehost-services.com>)
Ответы Re: Quick way to alter a column type?  ("Richard Broersma" <richard.broersma@gmail.com>)
Список pgsql-general
On Mon, 2008-07-07 at 02:10 -0400, Lew wrote:
> Ow Mun Heng wrote:
> >> I want to change a column type from varchar(4) to varchar(5) or should I
> >> just use text instead.

> The choice of TEXT for the column would seem to be supported in the PG manual,
> which stresses that TEXT and VARCHAR are quite close in performance, if not
> identical.  I recommend to constrain the length if it's proper for the data
> domain.  That is, if you are 100% absolutely certifiably certain that the
> length will never change again once you set it to 5, that is, if the data
> domain is a set of values that must be no more than 5 characters long, then
> VARCHAR(5) is a good choice.  It accurately represents the data.

It was varchar(4) for a _long_ time until there came a need recently to
move it to a 5 characters.
Hence the issue, I've already changed it to varchar() instead to make it
more open (and less problematic in the future)



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

Предыдущее
От: "MadHatter"
Дата:
Сообщение: plpgsql - or operator?
Следующее
От: Artacus
Дата:
Сообщение: Re: array sort for varchar arrays?