Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aV1JC-0004GL-BX for pgsql-sql@arkaria.postgresql.org; Sun, 14 Feb 2016 18:22:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aV1JB-0004aS-ME for pgsql-sql@arkaria.postgresql.org; Sun, 14 Feb 2016 18:22:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aV1J8-0004YL-9s for pgsql-sql@postgresql.org; Sun, 14 Feb 2016 18:22:06 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aV1J1-0004U8-2U for pgsql-sql@postgresql.org; Sun, 14 Feb 2016 18:22:05 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aV1Ix-0005Ux-Lj for pgsql-sql@postgresql.org; Sun, 14 Feb 2016 19:21:55 +0100 Received: from ppp-46-244-220-204.dynamic.mnet-online.de ([46.244.220.204]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 14 Feb 2016 19:21:55 +0100 Received: from spam_eater by ppp-46-244-220-204.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 14 Feb 2016 19:21:55 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: Thomas Kellerer Subject: Re: PostgreSQL: Inserting NULL values adds empty string. Date: Sun, 14 Feb 2016 19:21:43 +0100 Lines: 22 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-46-244-220-204.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: Cc: pgsql-odbc@postgresql.org X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Venkatesan, Sekhar schrieb am 14.02.2016 um 14:13: > > I am using PostgreSQL 9.4 odbc driver to talk to 9.4 postgreSQL server. > I see that when inserting NULL values into DB is adding empty string in the database only in windows. > The same insert is adding NULL values into database when linux odbc driver is used to connect to linux database. > Is there any configuration in odbc driver end or in server to retain the null values or is it a bug? > If it is not and is an expected behavior, how to fix it in the application? > > Thanks, > Sekhar The server most definitely will not convert a NULL value into an empty string out of the blue. So it's either the ODBC driver (which I highly doubt) or your application. Another possible reason is a trigger that converts nulls to empty strings. Can you show us the insert that is used to store the NULL values? Are you explicitely listing that column and providing a NULL value? Or are you maybe not passing a value for that column at all? In that case the column might be defined as DEFAULT '' -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql