Possible to insert quoted null value into integer field? - Mailing list pgsql-general

From pablo_tweek@yahoo.com (Pablo S)
Subject Possible to insert quoted null value into integer field?
Date
Msg-id 76d9ca90.0408232013.3e300b84@posting.google.com
Whole thread Raw
List pgsql-general
Hi all, I have search high and low on this -

Take for instance the statement :

insert into foo (text1, text2, int1) values ('Foo', 'Bar', '');

On Pg 7.2.x, the db would happily insert the null val into the int
field.  HOWSOMEVER, 7.4.x will explode and error back with:

"DBD::Pg::st execute failed: ERROR: invalid input syntax for integer:
"" at /cgi-bin/foo line xxx"

I see what it is complaining about but I am wondering if there is any
way to roll back this feature, as I have this cheesy bit of perl that
dynamically builds the query and quotes everything and I don't want to
have to change all occurrences to insert the NULL or worse yet try to
differentiate between int/string.

Many thanks,

P

pgsql-general by date:

Previous
From: pablo_tweek@yahoo.com (Pablo S)
Date:
Subject: Re: Deadlocks -- what can I do about them?
Next
From: nicholas.wakefield@gmail.com (Nick)
Date:
Subject: Substring RegExp Extract path