Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 6FD0B2E4054 for ; Tue, 5 Feb 2008 14:22:45 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 25381-01-2 for ; Tue, 5 Feb 2008 14:22:36 -0400 (AST) Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.176]) by postgresql.org (Postfix) with ESMTP id 1C7F42E3F10 for ; Tue, 5 Feb 2008 14:22:24 -0400 (AST) Received: by el-out-1112.google.com with SMTP id r27so938426ele.5 for ; Tue, 05 Feb 2008 10:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; bh=IODJeMT1jKSCxJ6Ayk5JSKqKBNACzJFU8ikDLdAEXA8=; b=B1CFfbNVpDlhg811Gr9Vu8jyiW3QO8oCzO5k0qOAKyxUAR3bHX82Z1JjemeJn1URB2+CXQDgbHSzw+H37OcGny3tl+P16sHVGadyNPWmjIiu5z0J8mVMSko94zft2frs97e3niIzL9m63vNLm9koIRgV7qChW7Xo/sg6BwpQVT0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:content-type:content-transfer-encoding; b=fOtiW7Sld48g0z/Vqm9Zw8AWsUo/jWOPXZHlsaXkhHqDByOV49FjYiVVXa/HG6WJPA9ZPSZkqiMCw9/l+q1t0PCS58F2Ju5AkJL2NgesCV7W38hYLOIIDHQWhAXPZQwqa/RWbWsDZYkICDwwzvaA9ZX2Mm49yv2HVEFW24HyK/Y= Received: by 10.143.36.15 with SMTP id o15mr4536172wfj.182.1202235742980; Tue, 05 Feb 2008 10:22:22 -0800 (PST) Received: from ?192.168.0.2? ( [201.41.250.155]) by mx.google.com with ESMTPS id s38sm18509614rnb.13.2008.02.05.10.22.17 (version=SSLv3 cipher=RC4-MD5); Tue, 05 Feb 2008 10:22:21 -0800 (PST) Message-ID: <47A8B788.6010304@gmail.com> Date: Tue, 05 Feb 2008 16:22:48 -0300 From: Franklin Haut User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Cast in PG 8.3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.348 tagged_above=0 required=5 tests=BAYES_05=-1.11, HTML_MESSAGE=0.001, MIME_HTML_ONLY=1.457 X-Spam-Level: X-Archive-Number: 200802/17 X-Sequence-Number: 30108

Hi all,

I´m testing the new version of PostgreSQL in windows plataform but i have a problem.


In PG 8.2

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)



In PG 8.3

Create Table temp (id integer);
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%');

Error:
operator does not exist: integer ~~* unknown at character 31
HINT:  No operator matches the given name and argument type(s).
You might need to add explicit type casts.


I Know that changing the SQL command to :
SELECT * FROM TEMP WHERE CAST(id AS TEXT) ilike ('%122%');
work´s but for now isn't possible... :(


I Tries  create a cast but the function text doesn't exist more in PG 8.3

CREATE CAST (int AS text) WITH FUNCTION text(int);

can everyone help me to create a cast ou other solution ?

Thank´s


Franklin