Re: char column with a single space as the default not working

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: char column with a single space as the default not working
Дата
Msg-id 34a83d6f68c2d513a88acb40cdc581c43586a746.camel@cybertec.at
обсуждение исходный текст
Ответ на Re: char column with a single space as the default not working  (Ron Johnson <ronljohnsonjr@gmail.com>)
Список pgsql-admin
On Thu, 2023-11-30 at 17:00 -0500, Ron Johnson wrote:
> > As David said, you're best off not using the char type.
> > The semantics around trailing spaces are too squishy for
> > my taste, and there's no real advantage compared to varchar
> > or text.
>
> How do you get a trailing space when trailing spaces are significant?

You would add a check constraint to verify it is there, and
if you want to automatically create training spaces, use a
BEFORE trigger.

Yours,
Laurenz Albe



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

Предыдущее
От: M Sarwar
Дата:
Сообщение: Re: char column with a single space as the default not working
Следующее
От: Srinivasarao Oguri
Дата:
Сообщение: Logical replication failed