Re: Cast in PG 8.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Franklin Haut <franklin(dot)haut(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Cast in PG 8.3
Date: 2008-02-05 21:13:31
Message-ID: 27937.1202246011@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Franklin Haut <franklin(dot)haut(at)gmail(dot)com> writes:
> Create Table temp (id int4);
> insert into temp values (1215);
> insert into temp values (1216);
> insert into temp values (1217);
> insert into temp values (1218);
> insert into temp values (1219);
> insert into temp values (1220);
> insert into temp values (1221);
> insert into temp values (1222);
> SELECT * FROM TEMP WHERE id ilike ('%122%');
>
> return ok, 3 rows (1220, 1221 and 1222)

That usage is simply bizarre. Why don't you define the column as text,
instead, if that's the type of query you intend to perform on it?

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2008-02-05 21:23:25 Re: Negative numbers for PK/ID's?
Previous Message Markus Bertheau 2008-02-05 20:12:18 Re: Cast in PG 8.3