Re: How to cast a char[] to varchar?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jon Lapham <lapham(at)extracta(dot)com(dot)br>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to cast a char[] to varchar?
Date: 2002-01-07 17:51:57
Message-ID: 20020107095122.H51680-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Mon, 7 Jan 2002, Jon Lapham wrote:

> I have a column defined as "char(3)[]" which I would like to copy into a
> different column defined as "varchar(255)".
>
> I've tried to cast the char(3)[] field using "CAST( ... as varchar)" but
> I get an error message, "Cannot cast type '_bpchar' to 'varchar'".
>
> Any suggestions?

What are you trying to get out? You've got a char(3) array, what do you
want the varchar to have in the end?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-01-07 17:55:01 Re: Turning off transactions completely.
Previous Message Loren Cahlander 2002-01-07 17:37:12 JDBC types for getting a ResultSet from a CallableStatement