Re: [SQL] Typecasting within sql statement.

From: lynch(at)lscorp(dot)com (Richard Lynch)
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Typecasting within sql statement.
Date: 1998-07-03 19:11:05
Message-ID: v02140b1ab1c292ce630d@[207.152.64.133]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Try something like this:

update myTable set field = 42::text::varchar;

I think the int4 --> text converter is written, and text --> varchar is
written, but int4 --> varchar is not.

Basically, anytime you need to go from one type to another that doesn't
seem to have a converter, look for a more general intermediate type.

At least, that's my understanding after one fight with this. :-)

--
--
-- "TANSTAAFL" Rich lynch(at)lscorp(dot)com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Colin Dick 1998-07-03 19:25:35 Re: [SQL] Typecasting within sql statement.
Previous Message Colin Dick 1998-07-03 18:14:04 Typecasting within sql statement.