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 1hYWm6-0005BE-94 for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2019 14:20:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hYWm4-0007O6-Vr for pgsql-general@arkaria.postgresql.org; Wed, 05 Jun 2019 14:20:20 +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 1hYWm4-0007KN-Ia for pgsql-general@lists.postgresql.org; Wed, 05 Jun 2019 14:20:20 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hYWm2-0007RY-4K for pgsql-general@lists.postgresql.org; Wed, 05 Jun 2019 14:20:19 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 7247A224DB; Wed, 5 Jun 2019 10:20:17 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 05 Jun 2019 10:20:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm3; bh=c EOVYvs845jr9Qd3PY2tNzvibb2tAOyPC6cVheiDatY=; b=sy4sTn55fFf5cAMAn PK5jemAFmplhvC07wBpUQJ7qawfJ8foiCH+tHdgQu4URPBBiOl5yYRE0SANH8zfY zMTlzzXpr7qazoGeF/9bzuCDWxjWl91meZny5l0tBa6mNtLzSXVIyWzNMvzCx2EK dR0eG4HZGZulwMvmh09GgbH3JUbQSwwsc6Phwk09eSE0w9bN//D/V1r/aAPEBW4X WlSQ5s0nAGgYYq5WUlHafDxb97085c6+alrGR/CNgCII3ipuOPaE+E8m3dO46ruH 87Gw1IQcNtVcUG3bZqVa3Y45ok0jO6UcTFI1Pg///K3MzLlCL8fXh6cQYkEYEsdV c1Llw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=cEOVYvs845jr9Qd3PY2tNzvibb2tAOyPC6cVheiDa tY=; b=IHvUWjT9j5/Qt2XwnsI/jImzyfuuhGSRtcpIqOkSndJ/rDCT+yWSCZVvc xnG7f5+OxhomXETIAXd4jd/cCp2MS9xzKSIJTnzOTcvnAtWEi+T/EnkY2sRKqtVr 3Qxj8VOshtvSlh1ukLVKi1A/OYTenWaEyQnIg8gMn2wETHoZqaM1TfSyPFdY0yCC WxKid50bf0KTRlcdxbVLuxwVgrBYgfGmP1vzrA9ti/WmWf1ciLDklmngAV4+ZIvd NGhIb55DAWsQ5SHcVtTHn97cQk6YQxOLBy49GXIvnBsn7omeJZ7U8E/oWGngUdL4 A74ilystCVcrAGyOirM9+hj+ydl7g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrudegvddgjeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhk lhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehpohhsthhgrhgvsh hqlhdrohhrghenucfkphepjedurddvuddvrdduhedtrddvtddvnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuve hluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.4] (unknown [71.212.150.202]) by mail.messagingengine.com (Postfix) with ESMTPA id 19B38380083; Wed, 5 Jun 2019 10:20:16 -0400 (EDT) Subject: Re: Converting yes or no to one letter strings. To: Ron , pgsql-general@lists.postgresql.org References: <555b017e-2449-43a4-19e6-4c19af6017e3@dayspringpublisher.com> From: Adrian Klaver Message-ID: <1ccaf983-78ab-28d9-23e3-a7bbd4e53344@aklaver.com> Date: Wed, 5 Jun 2019 07:20:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 6/4/19 7:27 PM, Ron wrote: > > > 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? > The difficulty is removing a value: https://www.postgresql.org/docs/11/sql-altertype.html Otherwise I see equal difficulty in pretending that s, f, p and e are a boolean choice. -- Adrian Klaver adrian.klaver@aklaver.com