Re: Postgres 8 - problem: invalid input syntax for integer - Mailing list pgsql-sql

From bertolima@yahoo.it (mauro)
Subject Re: Postgres 8 - problem: invalid input syntax for integer
Date
Msg-id d64dda1e.0502240704.11d165ca@posting.google.com
Whole thread Raw
In response to Postgres 8 - problem: invalid input syntax for integer  (bertolima@yahoo.it (mauro))
Responses Re: Postgres 8 - problem: invalid input syntax for integer  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
> 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


pgsql-sql by date:

Previous
From: TJ O'Donnell
Date:
Subject: SQL error: function round(double precision, integer) does not exist
Next
From: "Przemyslaw Slupkowski"
Date:
Subject: Re: Software for database-visualisation