Re: invalid input syntax for integer: "NULL" - Mailing list pgsql-novice

From Stephan Szabo
Subject Re: invalid input syntax for integer: "NULL"
Date
Msg-id 20041015145918.B90697@megazone.bigpanda.com
Whole thread Raw
In response to invalid input syntax for integer: "NULL"  (Kumar S <ps_postgres@yahoo.com>)
List pgsql-novice
On Fri, 15 Oct 2004, Kumar S wrote:

> In my table definition I defined INTEGER. When I
> uploaded my data it did not take empty SPACE as
> character type. Following a friends suggestion
> (experienced in ORACLE) I made those empty spaces as
> NULL and then I tried to input my insert statement.
>
> I get ERROR:
> ERROR:  invalid input syntax for integer: "NULL"
>
> I might want to perform calculations on this column
> and if null is not accepted for INTEGER data type,
> then the only way for me is to make it varchar. BUT I
> CANNOT perform caclulations on this column. It is sad.
>
>
> Is there a way to get going.  Please help me.
>
> Below is my table definition and INSERT STATEMENT.
> Many columns has empty spaces. I cannot put Zero's or
> any other negative values because these are
> statistical data columns and zero and any other number
> mean something and might lead to erratic conclusions.
> SORRY these sql statements and table definitions are
> big.

...
> VALUES ( '9215','18491','IMAGE:267638','FLJ22004','hypothetical protein
> FLJ22004','Hs.108812','N25427','NULL','115416','224','NULL','NULL',
...

You probably want NULL rather than 'NULL'.  The former means a null value,
the latter means the word NULL.

pgsql-novice by date:

Previous
From: Kumar S
Date:
Subject: invalid input syntax for integer: "NULL"
Next
From: Mitch Pirtle
Date:
Subject: Re: possible to access a Linux box db from a Windows box via a GUI?