Re: Null vs. Empty String in Postgres 8.3.8

From: Peter Hunsberger <peter(dot)hunsberger(at)gmail(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: "Wang, Mary Y" <mary(dot)y(dot)wang(at)boeing(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Null vs. Empty String in Postgres 8.3.8
Date: 2010-04-05 03:26:48
Message-ID: h2hcc159a4a1004042026z34568ff8l7e565457bc4caf18@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Apr 4, 2010 at 10:23 PM, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:
> On Sun, Apr 4, 2010 at 9:03 PM, Wang, Mary Y <mary(dot)y(dot)wang(at)boeing(dot)com> wrote:
>> I still don't get it.  I do want a zero for the subversion_flags to be stored in the table.  But it returned an error because it didn't like subversion_flags='' in the UPDATE SQL statement.
>>
>> subversion_flags | integer       | not null default 0
>
> Right. '' is not 0.  the old version of pgsql converted '' to 0 for
> you, incorrectly.  Now if you want 0 you need to say 0.
>

Or, since you have the default, set it to null.... (Which may be what
you thought you where doing?)

--
Peter Hunsberger

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message CaT 2010-04-05 03:28:06 Re: Null vs. Empty String in Postgres 8.3.8
Previous Message Scott Marlowe 2010-04-05 03:23:47 Re: Null vs. Empty String in Postgres 8.3.8