[GENERAL] migrating from mysql: need to convert empty string to null

2008-06-18 Thread Dave Lee
Hi, We have an existing (PHP) code base that is being converted to use PostgreSQL from MySQL. In most places, our insert and update statements are formed using single quoted values, and when there is no value, the empty string is being passed in. PostgreSQL objects to empty strings for certain col

Re: [GENERAL] migrating from mysql: need to convert empty string to null

2008-06-18 Thread Dave Lee
On Wed, Jun 18, 2008 at 12:39 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > None. There is no type coercion there --- what that is really > specifying is invocation of the int data type's input function > on the given string. I thought that something like this may be this was the case. > I don't thi

Re: [GENERAL] migrating from mysql: need to convert empty string to null

2008-06-18 Thread Dave Lee
On Wed, Jun 18, 2008 at 3:25 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > There isn't any really nice way to do that :-(. You could put a wrapper > function around int4in but it would not help, because the internal API > for datatype input functions doesn't support having them return NULL > (see Inpu