pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ashish Jain <ashjain2@gmail.com>
To: Richard Broersma <richard.broersma@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
Date: Thu, 18 Jun 2009 00:40:11 +0530
Message-ID: <14af40510906171210x3452fdbay4f77345b41751e20@mail.gmail.com> (raw)
In-Reply-To: <396486430906170756n3c8698fbm3951c0029dc673f1@mail.gmail.com>
References: <14af40510906170635w7c793ef0p3f36b13fc9958cdb@mail.gmail.com>
	<396486430906170756n3c8698fbm3951c0029dc673f1@mail.gmail.com>

Hi Richard,

I have created a function and a cast in the following way. It helps me to
subside the error but I still do not get the desired result. So I am not
sure if this only helps to subside the error message.

create function integer2character(in integer) returns character as 'select

$1::character' language sql immutable returns null on null input;





create cast (integer AS character) with function integer2character (in
integer) AS

implicit;


Thanks
Ashish


On Wed, Jun 17, 2009 at 8:26 PM, Richard Broersma <
richard.broersma@gmail.com> wrote:

> On Wed, Jun 17, 2009 at 6:35 AM, Ashish Jain<ashjain2@gmail.com> wrote:
>
> > Can any one help me to write a cast statement which automatically cast
> > integer to character??
>
> The SQL standard way would be:  CAST( your_int_column AS TEXT )
> or the Postgresql way:  your_int_column::TEXT
>
>
> --
> Regards,
> Richard Broersma Jr.
>
> Visit the Los Angeles PostgreSQL Users Group (LAPUG)
> http://pugs.postgresql.org/lapug
>

view thread (26+ messages)  latest in thread

Message-ID: <14af40510906171210x3452fdbay4f77345b41751e20@mail.gmail.com>
Permalink:  ../14af40510906171210x3452fdbay4f77345b41751e20@mail.gmail.com/
Also on:    postgresql.org/message-id/14af40510906171210x3452fdbay4f77345b41751e20@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-jdbc@postgresql.org
  Cc: ashjain2@gmail.com, richard.broersma@gmail.com
  Subject: Re: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
  In-Reply-To: <14af40510906171210x3452fdbay4f77345b41751e20@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox