Re: Accommodating alternative column values - Mailing list pgsql-general

From Rich Shepard
Subject Re: Accommodating alternative column values
Date
Msg-id 286181eb-9fdd-6680-de4-edcdc82d42a9@appl-ecosys.com
Whole thread Raw
In response to Re: Accommodating alternative column values  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Accommodating alternative column values
Re: Accommodating alternative column values
Re: Accommodating alternative column values
Re: Accommodating alternative column values
List pgsql-general
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



pgsql-general by date:

Previous
From: Torsten Förtsch
Date:
Subject: Re: Accommodating alternative column values
Next
From: Torsten Förtsch
Date:
Subject: Re: Accommodating alternative column values