Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYLeH-0004gX-Er for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2019 02:27:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hYLeG-00065I-7j for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2019 02:27:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYLeF-000659-R6 for pgsql-general@lists.postgresql.org; Wed, 05 Jun 2019 02:27:31 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYLeC-0000Pm-V6 for pgsql-general@lists.postgresql.org; Wed, 05 Jun 2019 02:27:30 +0000 Received: by mail-oi1-x235.google.com with SMTP id w7so5770700oic.3 for ; Tue, 04 Jun 2019 19:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=f5cUViIEbKLvxopYp1m4PgrIe/q1nEkiZ718vse5EHw=; b=oWxRCfn2ABhZI331tCWdqaJhriJSFOld+gwQqO1GjQlaUk0C800ytoBfX6qJmjh/Y9 llQNlF33nkk4qe4HwBd282JU9+V+wY4Hb/vD8RtflACzLMSI7wJ7f8VPa6hUi4GQhlBR kNrtnaPoQeiQiSJQDpk+OkxbNN7LbafZGPLm5f7SEvx9+h7CPCU9xavJqptK8F+abNh1 rDJYEwM9qe6hcR8pcpvcPYbtzxITOEw+stiehu100GTdVE+2JaZEggqD0kaD6m6fv222 XFaZvKi+CSLk53FFRHWwidGJ7T/PyEOcKgRJbdM4t47FW343UL9nGv9MU7B6EKQqUUg7 zINg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=f5cUViIEbKLvxopYp1m4PgrIe/q1nEkiZ718vse5EHw=; b=Rmr63mEhk+YAoxypD87qU66RNYLOL/gpGUTP2WGdxvXzAnq8DjUf2nzFC7KmAjk+mE s7AX3OfhD/jB7W1wEZUc46afwK1IXcHQoMOU/QU3gi+nUriKj1A47HpPw1bBEhtRi+9O kMZWviBV502iF3rHOOlGM2GIaBxE5sEJJien3HwrfOMElfRN9GEodsl3mYmE04XjtNxu gSY0GWoQiC3UULiv+r4nVNCMiaICHco/iIzojwRPr+yDeHOPoycb6rQDVuMQLFPU8Bip oyEneSt0fuKnl6gG7j6fXrhimWrmRgOoMN8XCsashvvymUzCH4O8RMNmM/Ek95HsWs0n HyqQ== X-Gm-Message-State: APjAAAWWv1Qf4CoNZXQFrV4OYcoeO0xN46/SJVuVlPkUvUL7db0mV+sw /zvxESE7tBA5hp9LnyTaXoFDVo1eCtt7HA== X-Google-Smtp-Source: APXvYqyfrmZJT7GMjX6GV24NCRatwOt2K2bZQrj5vOILmeBEfErw/oXdppZePWBj86qd1BHWVwJ79A== X-Received: by 2002:aca:c690:: with SMTP id w138mr6238888oif.178.1559701647964; Tue, 04 Jun 2019 19:27:27 -0700 (PDT) Received: from [192.168.1.10] (ip70-171-116-89.no.no.cox.net. [70.171.116.89]) by smtp.googlemail.com with ESMTPSA id k83sm6991459oia.10.2019.06.04.19.27.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jun 2019 19:27:27 -0700 (PDT) Subject: Re: Converting yes or no to one letter strings. To: pgsql-general@lists.postgresql.org References: <555b017e-2449-43a4-19e6-4c19af6017e3@dayspringpublisher.com> From: Ron Message-ID: Date: Tue, 4 Jun 2019 21:27:26 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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.