agora inbox for pgsql-sql@postgresql.org  
help / color / mirror / Atom feed
From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-sql@postgresql.org
Cc: pgsql-odbc@postgresql.org
Subject: Re: PostgreSQL: Inserting NULL values adds empty string.
Date: Sun, 14 Feb 2016 19:21:43 +0100
Message-ID: <n9qgjm$6dm$1@ger.gmane.org> (raw)
In-Reply-To: <F84DE43FDACD4C45AA84E2DA016FAE2F1C66716D@MX105CL01.corp.emc.com>
References: <F84DE43FDACD4C45AA84E2DA016FAE2F1C66716D@MX105CL01.corp.emc.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-sql>

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



view thread (6+ messages)  latest in thread

Message-ID: <n9qgjm$6dm$1@ger.gmane.org>
Permalink:  ../n9qgjm$6dm$1@ger.gmane.org/
Also on:    postgresql.org/message-id/n9qgjm$6dm$1@ger.gmane.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: spam_eater@gmx.net, pgsql-odbc@postgresql.org
  Subject: Re: PostgreSQL: Inserting NULL values adds empty string.
  In-Reply-To: <n9qgjm$6dm$1@ger.gmane.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox