Re: Converting yes or no to one letter strings.

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Converting yes or no to one letter strings.
Date: 2019-06-05 02:27:26
Message-ID: b2a5e8b9-902e-bb0c-4b53-5e6ae2db464e@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 6/4/19 7:19 PM, Adrian Klaver wrote:
> 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

I thought enum was Considered Harmful because of the difficulty in altering
the enums?

--
Angular momentum makes the world go 'round.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Withers 2019-06-05 06:11:23 granting right to create and delete just one database
Previous Message David Rowley 2019-06-05 00:47:59 Re: Query very different speeds on seemingly similar data