Re: PostgreSQL: Inserting NULL values adds empty string.

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: PostgreSQL: Inserting NULL values adds empty string.
Дата
Msg-id n9qgjm$6dm$1@ger.gmane.org
обсуждение исходный текст
Ответ на PostgreSQL: Inserting NULL values adds empty string.  ("Venkatesan, Sekhar" <sekhar.venkatesan@emc.com>)
Список pgsql-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 ''





В списке pgsql-sql по дате отправления:

Предыдущее
От: "Venkatesan, Sekhar"
Дата:
Сообщение: Re: [ODBC] PostgreSQL: Inserting NULL values adds empty string.
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: [ODBC] PostgreSQL: Inserting NULL values adds empty string.