Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sP0k6-002RrF-5n for pgsql-general@arkaria.postgresql.org; Wed, 03 Jul 2024 14:13:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sP0k3-009Wum-Fu for pgsql-general@arkaria.postgresql.org; Wed, 03 Jul 2024 14:13:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sP0k3-009Wue-4N for pgsql-general@lists.postgresql.org; Wed, 03 Jul 2024 14:13:51 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sP0k1-000DD0-8H for pgsql-general@postgresql.org; Wed, 03 Jul 2024 14:13:50 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 603332A2B7C for ; Wed, 3 Jul 2024 07:13:47 -0700 (PDT) Date: Wed, 3 Jul 2024 07:13:47 -0700 (PDT) From: Rich Shepard To: "pgsql-general@postgresql.org" Subject: Re: Accommodating alternative column values In-Reply-To: Message-ID: <286181eb-9fdd-6680-de4-edcdc82d42a9@appl-ecosys.com> References: <449bdf5-31d-9189-34d-5ce4188fe2@appl-ecosys.com> <74f52ac6-61cb-f995-34e5-16271b5c6832@appl-ecosys.com> <3eb9a2d3-28c-9066-d3b5-fd6cca32af9@appl-ecosys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 3 Jul 2024, David G. Johnston wrote: > Yeah, the simply cast suggested will not work. You’d have to apply an > expression that turns the current contents into an array. The current > contents are not likely to be an array literal. David, No, it's not now an array. I thought that this expression would work, but it doesn't: bustrac=# alter table people alter column email set data type varchar(64)[] using email::varchar(64)[]; RROR: malformed array literal: "frank@dmipx.com" DETAIL: Array value must start with "{" or dimension information. If I correctly understand the error detail I'd need to change the contents of that column for all 1280 rows to enclose the contents in curly braces before I can convert the datatype to an array. Is that correct? Rich