How to cast a char[] to varchar?

From: Jon Lapham <lapham(at)extracta(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: How to cast a char[] to varchar?
Date: 2002-01-07 14:30:20
Message-ID: 3C39B0FC.8060709@extracta.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

--

-**-*-*---*-*---*-*---*-----*-*-----*---*-*---*-----*-----*-*-----*---
Jon Lapham
Extracta Moléculas Naturais, Rio de Janeiro, Brasil
email: lapham(at)extracta(dot)com(dot)br web: http://www.extracta.com.br/
***-*--*----*-------*------------*--------------------*---------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Loren Cahlander 2002-01-07 17:37:12 JDBC types for getting a ResultSet from a CallableStatement
Previous Message Jules Alberts 2002-01-07 11:15:47 Re: three tier woes (audit policies ???)