Re: Quick way to alter a column type?

Поиск
Список
Период
Сортировка
От Richard Broersma
Тема Re: Quick way to alter a column type?
Дата
Msg-id 396486430807082142o3e3e6a59n47d5f60950a8017f@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Quick way to alter a column type?  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
Список pgsql-general
On Tue, Jul 8, 2008 at 8:09 PM, Ow Mun Heng <Ow.Mun.Heng@wdc.com> wrote:
> 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)


To prevent this issue from re-occuring  in the future, you could use
text and then add a check( length( col ) <= 5 ).

--
Regards,
Richard Broersma Jr.

Visit the Los Angles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

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

Предыдущее
От: "Jonathan Bond-Caron"
Дата:
Сообщение: Feature: FOR UPDATE SKIP LOCKED
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Feature: FOR UPDATE SKIP LOCKED