Re: Accommodating alternative column values

From: Torsten Förtsch <tfoertsch123(at)gmail(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Accommodating alternative column values
Date: 2024-07-03 14:06:45
Message-ID: CAKkG4_nEYBZriL9n1GiyEnutTAbLBuFg=sKzCENw40LXR-NgSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 PM Rich Shepard <rshepard(at)appl-ecosys(dot)com>
wrote:

> On Wed, 3 Jul 2024, Rich Shepard wrote:
>
> > What I've tried:
> > bustrac=# 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
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2024-07-03 14:13:47 Re: Accommodating alternative column values
Previous Message David G. Johnston 2024-07-03 14:05:36 Re: Accommodating alternative column values