pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Lou <lou@dayspringpublisher.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Converting yes or no to one letter strings.
Date: Tue, 4 Jun 2019 17:19:33 -0700
Message-ID: <bf35f900-6500-dfc7-b93d-f264767bdb38@aklaver.com> (raw)
In-Reply-To: <555b017e-2449-43a4-19e6-4c19af6017e3@dayspringpublisher.com>
References: <555b017e-2449-43a4-19e6-4c19af6017e3@dayspringpublisher.com>

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





view thread (10+ messages)  latest in thread

Message-ID: <bf35f900-6500-dfc7-b93d-f264767bdb38@aklaver.com>
Permalink:  ../bf35f900-6500-dfc7-b93d-f264767bdb38@aklaver.com/
Also on:    postgresql.org/message-id/bf35f900-6500-dfc7-b93d-f264767bdb38@aklaver.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: adrian.klaver@aklaver.com, lou@dayspringpublisher.com
  Subject: Re: Converting yes or no to one letter strings.
  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>

* 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