Re: Char to Int - Mailing list pgsql-general

From Ron Johnson
Subject Re: Char to Int
Date
Msg-id 1066168436.12390.60.camel@haggis
Whole thread Raw
In response to Re: Char to Int  ("Rick Seeger" <rick@nettheory.com>)
List pgsql-general
On Tue, 2003-10-14 at 16:11, Rick Seeger wrote:
> -----Original Message-----
>
> Oops, there was a typo in my second example. Still have the problem
> tho...
>
> > rs=#
> > rs=# insert into table2
> > rs=# select CAST(my_Id as integer)
> >             ^^^^
> > rs=# from table1;
> > ERROR:  Cannot cast type character to integer

Interesting, though, that it works for string constants:

  test1=# select cast('15' as integer);
   int4
  ------
     15
  (1 row)

  test1=# select '15'::integer;
   int4
  ------
     15
  (1 row)


--
-----------------------------------------------------------------
Ron Johnson, Jr. ron.l.johnson@cox.net
Jefferson, LA USA

When Swedes start committing terrorism, I'll become suspicious of
Scandanavians.


pgsql-general by date:

Previous
From: "scott.marlowe"
Date:
Subject: Re: How to list which tables are available?
Next
From: Peter Eisentraut
Date:
Subject: Re: Char to Int