pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Converting yes or no to one letter strings.
Date: Tue, 4 Jun 2019 21:27:26 -0500
Message-ID: <b2a5e8b9-902e-bb0c-4b53-5e6ae2db464e@gmail.com> (raw)
In-Reply-To: <bf35f900-6500-dfc7-b93d-f264767bdb38@aklaver.com>
References: <555b017e-2449-43a4-19e6-4c19af6017e3@dayspringpublisher.com>
	<bf35f900-6500-dfc7-b93d-f264767bdb38@aklaver.com>



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.





view thread (10+ messages)  latest in thread

Message-ID: <b2a5e8b9-902e-bb0c-4b53-5e6ae2db464e@gmail.com>
Permalink:  ../b2a5e8b9-902e-bb0c-4b53-5e6ae2db464e@gmail.com/
Also on:    postgresql.org/message-id/b2a5e8b9-902e-bb0c-4b53-5e6ae2db464e@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Converting yes or no to one letter strings.
  In-Reply-To: <b2a5e8b9-902e-bb0c-4b53-5e6ae2db464e@gmail.com>
  References: <555b017e-2449-43a4-19e6-4c19af6017e3@dayspringpublisher.com> <bf35f900-6500-dfc7-b93d-f264767bdb38@aklaver.com> <b2a5e8b9-902e-bb0c-4b53-5e6ae2db464e@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox