Re: Converting yes or no to one letter strings.

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Lou <lou(at)dayspringpublisher(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Converting yes or no to one letter strings.
Date: 2019-06-05 00:19:33
Message-ID: bf35f900-6500-dfc7-b93d-f264767bdb38@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Rowley 2019-06-05 00:47:59 Re: Query very different speeds on seemingly similar data
Previous Message Rich Shepard 2019-06-04 23:44:43 Re: Converting yes or no to one letter strings.