pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: bertolima@yahoo.it
To: pgsql-sql@postgresql.org
Subject: Re: Postgres 8 - problem: invalid input syntax for integer
Date: 24 Feb 2005 07:04:04 -0800
Message-ID: <d64dda1e.0502240704.11d165ca@posting.google.com> (raw)
References: <d64dda1e.0502230219.21e243b1@posting.google.com>
	<421D8CEF.7050900@archonet.com>

> 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



view thread (4+ messages)  latest in thread

Message-ID: <d64dda1e.0502240704.11d165ca@posting.google.com>
Permalink:  ../d64dda1e.0502240704.11d165ca@posting.google.com/
Also on:    postgresql.org/message-id/d64dda1e.0502240704.11d165ca@posting.google.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: bertolima@yahoo.it
  Subject: Re: Postgres 8 - problem: invalid input syntax for integer
  In-Reply-To: <d64dda1e.0502240704.11d165ca@posting.google.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox