Re: Converting yes or no to one letter strings.

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Converting yes or no to one letter strings.
Дата
Msg-id bf35f900-6500-dfc7-b93d-f264767bdb38@aklaver.com
обсуждение исходный текст
Ответ на Converting yes or no to one letter strings.  (Lou <lou@dayspringpublisher.com>)
Ответы Re: Converting yes or no to one letter strings.  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-general
On 6/4/19 3:29 PM, Lou wrote:
> Hi everyone,
> 
> Is it possible to convert a boolean yes or no field to hold a one letter 
> string? For example, the strings: 's' 'f' 'p' 'e'
> 
> To start off, I just need to convert true to 's'. false will have to be 
> manually changed to 'f' or 'p' or 'e' as appropriate.

Why not an enum field?:

https://www.postgresql.org/docs/11/datatype-enum.html



> 
> Lou
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Rich Shepard
Дата:
Сообщение: Re: Converting yes or no to one letter strings.
Следующее
От: David Rowley
Дата:
Сообщение: Re: Query very different speeds on seemingly similar data