Re: Alter column from text[] to uuid[]

From: Keith Rarick <kr(at)xph(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Alter column from text[] to uuid[]
Date: 2015-06-11 21:52:19
Message-ID: CAD25zGA+hxKEn8DA37PZ-2trbyr6oQ44Eb1swpekm5RufyW81A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 11, 2015 at 12:57 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> alter table t alter u type uuid[] using u::uuid[];
>
> The original command worked without a USING because anything-to-text is
> considered an allowable assignment coercion; but the other way around
> requires an explicit cast.

Got it. Thanks!

I feel silly not to have tried that. Somehow I interpreted
"cannot be cast automatically to type uuid[]" as meaning
that it cannot be cast at all (and would therefore need a
more involved expression to specify how to convert it),
rather than that the cast merely needed to be explicit.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message James Cloos 2015-06-11 22:39:26 localtime ?
Previous Message Asif Naeem 2015-06-11 20:18:09 Re: GCC error and libmpfr.so.4 not found