X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DEF2E560C6 for ; Thu, 24 Feb 2005 15:04:01 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56674-02 for ; Thu, 24 Feb 2005 15:03:58 +0000 (GMT) Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.250.190.2]) by svr1.postgresql.org (Postfix) with ESMTP id F040E55A6E for ; Thu, 24 Feb 2005 15:03:55 +0000 (GMT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 4458E31E27; Thu, 24 Feb 2005 16:04:05 +0100 (MET) From: bertolima@yahoo.it (mauro) X-Newsgroups: pgsql.sql Subject: Re: Postgres 8 - problem: invalid input syntax for integer Date: 24 Feb 2005 07:04:04 -0800 Organization: http://groups.google.com Lines: 20 Message-ID: References: <421D8CEF.7050900@archonet.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/347 X-Sequence-Number: 20457 > What number does '' represent? 'No response' value... > Does that mean a string of '/2' should equal your number divided by two? right, but it is never required. > If not, why not? because I use it to GROUP BY values. > Who is providing an empty string where you've asked for a number, and > why not trap this error (or store a NULL)? You are certainly right. My problem concerns the compatibility of code among postgres 8 and 7.2 that I wanted to maintain. The existing code (data analysis) exploits the particularity that the null ('') becomes 0 (ok, no comment :) ) logically wrong but practically perfect! [...CAST CODE...] Thank you for the explicit-cast code, but I want reproduce it in 'database level' so I don't use explicit cast but IMPLICIT; everytime updating integer fields with '' values it cast to (0 or NULL). Best regards, Mauro