Problems with char array set to NULL

From: jlapham(at)gandalf(dot)bioqmed(dot)ufrj(dot)br
To: pgsql-hackers(at)postgresql(dot)org
Subject: Problems with char array set to NULL
Date: 2000-06-05 14:25:55
Message-ID: 200006051425.LAA30854@gandalf.bioqmed.ufrj.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello-

I've noticed a difference in the behavior between how v6.5.3 and v7.0.0
handle NULL assignments for char arrays (see below for the simple
example). Maybe I should be using '{}' to nullify a char array instead of
NULL? Either way, it would seem to me that the behavior with v7.0.0
should be the same as v6.5.3. And, as you can see below, the response
from v7.0.0 is to terminate the connection to the db backend... which
seems severe.

I am running a variety of i686 linux systems (RedHat 6.2 with home rolled
v2.2.15 kernels), using src compiled Pg. I have been able to duplicate
this behavior on a number of machines.

-Jon

PS: This is a re-send of a message I posted 5 days ago (~1 June) which
appears to not have made it to the list, probably due to something I
did. If you received this message before, my apologies.

------------------------
v6.5.3:
template1=> create table a (id char[2]);
CREATE
template1=> insert into a (id) values (NULL);
INSERT 112733 1

------------------------
v7.0.0:
template1=# create table a (id char[2]);
CREATE
template1=# insert into a (id) values (NULL);
pqReadData() -- backend closed the channel unexpectedly.
This probably means the backend terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.

-**-*-*---*-*---*-*---*-----*-*-----*---*-*---*-----*-----*-*-----*---
Jon Lapham, PhD
Centro Nacional de Ressonancia Magnetica Nuclear de Macromoleculas
Universidade Federal do Rio de Janeiro (UFRJ) - Brasil
email: jlapham(at)gandalf(dot)bioqmed(dot)ufrj(dot)br
***-*--*----*-------*------------*--------------------*---------------

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Lo 2000-06-05 15:12:58 Re: [HACKERS] pg on NT
Previous Message The Hermit Hacker 2000-06-05 14:12:07 Re: Commit messages list