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 1sP0dT-002RUN-CW for pgsql-general@arkaria.postgresql.org; Wed, 03 Jul 2024 14:07:03 +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 1sP0dR-009Qu7-9b for pgsql-general@arkaria.postgresql.org; Wed, 03 Jul 2024 14:07:01 +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 1sP0dQ-009Qty-VH for pgsql-general@lists.postgresql.org; Wed, 03 Jul 2024 14:07:01 +0000 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sP0dP-000D9x-5L for pgsql-general@postgresql.org; Wed, 03 Jul 2024 14:07:00 +0000 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-64b3655297aso49310497b3.1 for ; Wed, 03 Jul 2024 07:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720015618; x=1720620418; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=laBd2SlBXr5ED5cDX9JcZQd7f18/Z6tkA0fSarsfh0s=; b=GWWl37Zt77Ggig2lb/s0UhvB2/Dq9ITkhbM5IPkoPknOyY79VrRR91KXn+ez+dTNjv 1qJskfbFNUDjPK0bCAwMcmELC6DFNGq2qf9tm2+wXDPvr4268ZUSfxWhjl4l1TXCAjzu T8j9g2jJZXMEVn1SN0L0feQrIATSfZrpt1dvr4r6E0oi9UwfCCvckU6R6esmoBjE19If 9cL9mBKwh9GhC6tflKxiDAM3G59vMAc0yzkiNTSNdIOccMLle4UWLPmHL81m7Hr4B0ka r8zEU515X7HgyZm8ndzFQSzq0/RQyiPcyx63nZt7t25P3VWMAv67x4yMu+pk1v0yJG9Q fHPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720015618; x=1720620418; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=laBd2SlBXr5ED5cDX9JcZQd7f18/Z6tkA0fSarsfh0s=; b=W9/XF5kKcSXTr5pEpPRxy2faishJx/BMY/zQ2UvAlnRobXs3xjVHBKN3DQnko2Yk4P Dv+bxcZ+UCMZMRKehgTebsfcqegq72SnD23HHcIyf18OrtazoiHRR5+Sb9GhSDEVJ7w/ XskCwjkWhB0IW3WLisOJdPkDhD/AhKowclqkR+ffa6+TIN6qquTkHZzVau7FTTlRw6Qx d0S3aJ9MOAwKdAKw2vReQmpHxLOq3jiPYp4ABtHz8Zrec3yK+4y47hf/gay6QeeRrBz0 p4MaYxTexLE0ZcIdQmKS1T5lSRWN4f9TJSkDfdU13WSGeb+SuFA0gHTA2DnThK5Njc54 vuCA== X-Gm-Message-State: AOJu0YwdJHoN/CugnWTZLSdryqs3tTx/Y3QkS9OJQD6+I6T4odNM3c1y wW7oYAG8RDmlUnDqorTtpqpVK7dxn+P4OlHGszsiMZV7kD/ILyLImPrcTnQSEjoM1ZcVi0BGA9Z l67+NkCSfzo8eHkbuTAb+bJu+sXxlqYQ= X-Google-Smtp-Source: AGHT+IGMZEsRB4PalZxrvF1JvYNPaCNfGnlODriptxrFBXeNjCjW2ivquWE+GRQVdnJuakeC96RNotg/1ZRMVK5S3dg= X-Received: by 2002:a0d:e685:0:b0:640:bcdf:7d6a with SMTP id 00721157ae682-64c74594de2mr125215127b3.32.1720015618356; Wed, 03 Jul 2024 07:06:58 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <3eb9a2d3-28c-9066-d3b5-fd6cca32af9@appl-ecosys.com> From: =?UTF-8?Q?Torsten_F=C3=B6rtsch?= Date: Wed, 3 Jul 2024 16:06:45 +0200 Message-ID: Subject: Re: Accommodating alternative column values To: Rich Shepard Cc: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="000000000000f0c109061c5857e2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000f0c109061c5857e2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The USING phrase basically answers the question how do I convert an existing value of the old type to the new type. On Wed, Jul 3, 2024 at 4:03=E2=80=AFPM Rich Shepard wrote: > On Wed, 3 Jul 2024, Rich Shepard wrote: > > > What I've tried: > > bustrac=3D# alter table people alter column email set data type > varchar(64) []; > > ERROR: column "email" cannot be cast automatically to type character > > varying[] > > HINT: You might need to specify "USING email::character varying(64)[]"= . > > What I forgot to mention is that the current datatype is varchar(64) and = I > want to make it an array. > > Rich > > > --000000000000f0c109061c5857e2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The USING phrase basically answers the question how do I c= onvert an existing value of the old type to the new type.

On Wed, Jul 3, 202= 4 at 4:03=E2=80=AFPM Rich Shepard <rshepard@appl-ecosys.com> wrote:
On Wed, 3 Jul 2024, Rich Shepard wrote:
> What I've tried:
> bustrac=3D# alter table people alter column email set data type varcha= r(64) [];
> ERROR:=C2=A0 column "email" cannot be cast automatically to = type character
> varying[]
> HINT:=C2=A0 You might need to specify "USING email::character var= ying(64)[]".

What I forgot to mention is that the current datatype is varchar(64) and I<= br> want to make it an array.

Rich


--000000000000f0c109061c5857e2--