Search Postgresql Archives

Re: Accommodating alternative column values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wednesday, July 3, 2024, Rich Shepard <rshepard@xxxxxxxxxxxxxxx> 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.


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 J.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux