Re: Altering column type from text to bytea

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Alexander Reichstadt <lxr(at)mac(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Altering column type from text to bytea
Date: 2012-03-21 22:42:27
Message-ID: CAHyXU0xxCe8QUB3xNTS5aFKHLtigZCXQVu1KoXcm9_z86jp6qA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Mar 21, 2012 at 2:56 PM, Alexander Reichstadt <lxr(at)mac(dot)com> wrote:

> Hi,
>
> when trying to change a text column to bytea I am getting the following
> error:
>
> *SQL error:*
>
> ERROR: column "comment" cannot be cast to type bytea
>
>
> *In statement:*
> ALTER TABLE "public"."persons" ALTER COLUMN "comment" TYPE bytea
>

TRY ALTER TYPE ...USING using either direct cast or encode() function.

Please don't post emails in HTML format, thanks!

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rory Campbell-Lange 2012-03-21 22:47:33 Server choice for small workload : raptors or SSD?
Previous Message Martijn van Oosterhout 2012-03-21 22:20:50 Re: Large Databases redux