X-Original-To: pgsql-odbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 013C59FB3FD for ; Thu, 31 Aug 2006 17:10:58 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 78618-04-2 for ; Thu, 31 Aug 2006 17:10:49 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from andromeda1.neonex.com.br (dns3.neonex.com.br [201.28.22.10]) by postgresql.org (Postfix) with ESMTP id 8F0389FB417 for ; Thu, 31 Aug 2006 17:09:52 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=planit.com.br ident=mail) by andromeda1.neonex.com.br with esmtp (Exim 4.62) (envelope-from ) id 1GIsrM-0007d6-GG; Thu, 31 Aug 2006 17:09:57 -0300 From: "luiz" To: greg.campbell@us.michelin.com Cc: pgsql-odbc@postgresql.org Subject: Re: ODBC v08.02.0100 Date: Thu, 31 Aug 2006 18:09:56 -0200 Message-Id: <20060831200431.M35183@planit.com.br> In-Reply-To: References: <20060831174220.M69787@planit.com.br> X-Mailer: OpenWebMail 2.52 20060502 X-OriginatingIP: 200.168.31.181 (luiz) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=OPENWEBMAIL_ATT_0.129931560109497" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.248 tagged_above=0 required=5 tests=AWL, HTML_40_50, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200608/183 X-Sequence-Number: 8147 This is a multi-part message in MIME format. ------=OPENWEBMAIL_ATT_0.129931560109497 Content-Type: text/plain; charset=iso-8859-1 Hi Greg I'm sorry if I'm not can express clearly what I need to explain. My english is litle. In a left outer join like below, field4 may have null values when test.fk_test2 is null, now the result is a char(3) empty field, then I presume that this is a incorrect resultset On Thu, 31 Aug 2006 15:26:04 -0400, greg.campbell wrote > So your issue is that now the field types including NULL constraints match the underlying tables? > Is the change caused just from changing pgODBC driver versions, while the database version stayed the same.? > Isn't this the result we would expect if we were using psql at the command line? > I don't mean to be rude, but does your application expect a resultset where certain field never have a NULL value, but where the database design has the fields specified as nullable (no specification of NOT NULL)? For instance in your example fk_test2 is designed to allow NULL, but perhaps an application does not anticipate the possibility that NULL may be its value. > > Perhaps the old behavior was a bug. > > Greg Campbell ENG-ASE/Michelin US5 > Lexington, South Carolina > 803-951-5561, x75561 > Fax: 803-951-5531 > greg.campbell@us.michelin.com > > "luiz" > > "luiz" > Sent by: pgsql-odbc-owner@postgresql.org > 08/31/2006 14:14 > > To > pgsql-odbc@postgresql.org > > cc > > > Subject > [ODBC] ODBC v08.02.0100 > Hi all, > > I make some tests with this new version and i notice a diference in the > behaviour about the structures of tables returned by queries trough  this > version and older versions of odbc > > I'm using Visual FoxPro with postgres 8.1.4. > > In previous version all fields are marked to accept null values. > In this version (8.02.0100) some fields now don't accept null values, seemed > to me that now use the same definition of source table structure, like this: > > CREATE TABLE test ( >  id serial NOT NULL, >  fk_test2 int4, >  field1 char(3) NOT NULL, >  field2 varchar(10), >  field3 date ); > > CREATE TABLE test2 ( >  id serial NOT NULL, >  field4 char(3) NOT NULL, >  field5 char(3) ); > > SELECT test.* >     , test2.id as id2 >     , test2.field4 >     , test2.field5 >  from test LEFT OUTER JOIN test2 on test.fk_test2 = test2.id; > > The fields of resultset will be now this: > > id int4 NOT NULL > fk_test2 int4 > field1 char(3) NOT NULL > field2 varchar(10) > field3 date > id2 int4 NOT NULL > field4 char(3) NOT NULL > field5 char(3) > > with odbc version 8.01.0200 all fields accept null values. > > I'm not sure about what is the correct behaviour, but this can be considered > as a bug in the new version ? > > Thanks in Advance > > Luiz > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings > -- Plan IT Tecnologia Informatica Ltda. ------=OPENWEBMAIL_ATT_0.129931560109497 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi Greg

I'm sorry if I'm not can express clearly what I need to explain.=20
My english is litle.

In a left outer join like below, field4 may have null values when tes= t.fk_test2 is null,=20
now the result is a char(3) empty field, then I presume that this is = a incorrect resultset


On Thu, 31 Aug 2006 15:26:04 -0400, greg.campbell= wrote
> So your=20 issue is that now the field types including NULL constraints match the=20 underlying tables?=20
>=20 Is the change caused just from changing pgODBC driver versions, while the= =20 database version stayed the same.?
>=20 Isn't this the result we would expect if we were using psql at the command = line?=20
>=20 I don't mean to be rude, but does your application expect a resultset where= =20 certain field never have a NULL value, but where the database design has t= he=20 fields specified as nullable (no specification of NOT NULL)? For instance i= n=20 your example fk_test2 is designed to allow NULL, but perhaps an application= does=20 not anticipate the possibility that NULL may be its value.
>=20
>=20 Perhaps the old behavior was a bug.
>=20
>=20 Greg Campbell ENG-ASE/Michelin US5
>=20 Lexington, South Carolina
>=20 803-951-5561, x75561
>=20 Fax: 803-951-5531
>=20 greg.campbell@us.michelin.com
>=20
>=20 "luiz" <luiz@planit.com.br>
>=20
>=20
          "luiz"=20 <luiz@planit.com.br>=20
          >=20 Sent by:=20 pgsql-odbc-owner@postgresql.org
          > 08/31/2006=20 14:14

>=20
> To

>=20 pgsql-odbc@postgresql.org

>=20
> cc

>=20

>=20
> Subject

>=20 [ODBC] ODBC=20 v08.02.0100

>=20 Hi all,
>=20
>=20 I make some tests with this new version and i notice a diference in the
>=20 behaviour about the structures of tables returned by queries trough =A0 this
>=20 version and older versions of odbc
>=20
>=20 I'm using Visual FoxPro with postgres 8.1.4.
>=20
>=20 In previous version all fields are marked to accept null values.
>=20 In this version (8.02.0100) some fields now don't accept null values,=20 seemed
>=20 to me that now use the same definition of source table structure, like=20 this:
>=20
>=20 CREATE TABLE test (
>=20 =A0id serial NOT NULL,
>=20 =A0fk_test2 int4,
>=20 =A0field1 char(3) NOT NULL,
>=20 =A0field2 varchar(10),
>=20 =A0field3 date );
>=20
>=20 CREATE TABLE test2 (
>=20 =A0id serial NOT NULL,
>=20 =A0field4 char(3) NOT NULL,
>=20 =A0field5 char(3) );
>=20
>=20 SELECT test.*=20
>=20 =A0 =A0 , test2.id as id2=20
>=20 =A0 =A0 , test2.field4=20
>=20 =A0 =A0 , test2.field5
>=20 =A0from test LEFT OUTER JOIN test2 on test.fk_test2 =3D test2.id;
>=20
>=20 The fields of resultset will be now this:
>=20
>=20 id int4 NOT NULL
>=20 fk_test2 int4=20
>=20 field1 char(3) NOT NULL
>=20 field2 varchar(10)
>=20 field3 date
>=20 id2 int4 NOT NULL
>=20 field4 char(3) NOT NULL
>=20 field5 char(3)
>=20
>=20 with odbc version 8.01.0200 all fields accept null values.
>=20
>=20 I'm not sure about what is the correct behaviour, but this can be=20 considered
>=20 as a bug in the new version ?
>=20
>=20 Thanks in Advance
>=20
>=20 Luiz
>=20
>=20 ---------------------------(end of broadcast)---------------------------
>=20 TIP 5: don't forget to increase your free space map settings
>=20



--=20
Plan IT Tecnologia Informatica Ltda.=20

------=OPENWEBMAIL_ATT_0.129931560109497--