Skip site navigation (1) Skip section navigation (2)

Re: Null values detected as 0 value

From: Vaduvoiu Tiberiu <vaduvoiutibi(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Null values detected as 0 value
Date: 2010-11-23 12:42:20
Message-ID: 304740.50217.qm@web51303.mail.re2.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-novice
"Well, you've omitted all the useful details, but this stuff is not
magic.  Either that ON INSERT rule is changing null to zero, or you
have a trigger on the table that is doing it, or there's something
wrong with the initial query (are you sure you put the null in the
column you thought you did?)

It would be too much code to insert here, no triggers exist on either the view or the table, the only problem I think can be cause by the default value.
Is there a problem when setting the default values as null for a field that is a foreign key to it's own table?

I've tried adding the default value as:
ALTER TABLE network ALTER COLUMN parent_network SET DEFAULT NULL::integer; ( and also without ::integer or with ::bigint) but even though the query runs succesfully, when viewing the table with pgAdmin III, the default value does not appear as null, as on other fields. So my concern is that the default value might not work correctly and 0 is still retrieved as the default value.





      

In response to

pgsql-novice by date

Next:From: Leon StarrDate: 2010-11-23 19:23:25
Subject: Why won't nested select-into expression work?
Previous:From: Matthew WaldenDate: 2010-11-23 09:54:35
Subject: Re: Postgresql on windows / solid state

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group