Re: Null vs. Empty String in Postgres 8.3.8

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Null vs. Empty String in Postgres 8.3.8
Date: 2010-04-05 15:22:40
Message-ID: m3sk79yldr.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Peter Hunsberger <peter(dot)hunsberger(at)gmail(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?)

Setting it to NULL does not set it to the default value. You
have to use the keyword DEFAULT for that.

Tim

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gerhard Heift 2010-04-05 16:28:18 Temporal data storage
Previous Message Andrus 2010-04-05 15:19:20 Re: How to fix set-valued function called in context that cannot accept a set in earlier versions