Skip site navigation (1) Skip section navigation (2)

pgsql.tcl: Bug concerning joins

From: Sebastian Meyer <meyer(at)mevis(dot)de>
To: pgsql-interfaces(at)postgreSQL(dot)org
Cc: Sascha Bohnenkamp <bonito(at)mevis(dot)de>, Olaf Klinghamme <olafk(at)mevis(dot)de>
Subject: pgsql.tcl: Bug concerning joins
Date: 1998-09-01 16:39:04
Message-ID: Pine.SGI.4.02.9809011815240.3577-100000@forte (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
I'm writing an application using PostgreSQL-6.3.2, Tcl/Tk 8.0 using 
pgsql.tcl as an interface. This approach allows to run code completely
unmodified on Unix, Windows and the Mac.

I found a bug processing a simple join like
   SELECT s1.b,s2.b FROM pgsqlbug1 s1, pgsqlbug2 s2 WHERE s1.a = s2.c;
This bug only occurs whern using pgsql.tcl. 

Here is the full story:

====== create script ============
-- Trigger a bug in the pgsql Tcl interface
CREATE TABLE pgsqlbug1 (
	a int2,
	b char(12), 
	primary key(a)
CREATE TABLE pgsqlbug2 (
       a int2,
       b char(12),
       c int2,
       primary key(a)

INSERT INTO pgsqlbug1 (a,b) VALUES (0,'from table 1');
INSERT INTO pgsqlbug2 (a,b,c) VALUES (0,'from table 2',0);
====== end of create script ============

Using psql I get the following (correct) output:

====== psql session ==========
meyer=> select * from pgsqlbug1;
0|from table 1
(1 row)

meyer=> select * from pgsqlbug2;
a|b           |c
0|from table 2|0
(1 row)

meyer=> SELECT s1.b,s2.b FROM pgsqlbug1 s1, pgsqlbug2 s2 WHERE s1.a = s2.c;
b           |b           
from table 1|from table 2
(1 row)

====== pend of sql session ==========

Using pgsql.tcl from Tcl however I get:

meyer> SELECT s1.b,s2.b FROM pgsqlbug1 s1, pgsqlbug2 s2 WHERE s1.a = s2.c;

attributes: b b
lAttributes: {b 1042 -1} {b 1042 -1}
Tuple 0: {from table 2} {from table 2}

... what is wrong, obviously.

(Version info: timestamp of pgsql.tcl is "May 21 15:25" on 

BTW: What's the address of the developer of pgsql.tcl. I couldn't find
    it in the code....

    __o     Sebastian Meyer  Tel: (0421)218-7702 | "A weird imagination
  _ \<,_    meyer(at)mevis(dot)de | is most useful to gain 
 (_)/ (_)   MeVis an der Universit├Ąt Bremen      | full advantage of all the 
~~~~~~~~~~~ Universit├Ątsallee 29, D-28359 Bremen | features." (amd(8))


pgsql-interfaces by date

Next:From: Peter T MountDate: 1998-09-01 17:07:39
Subject: Re: [INTERFACES] JDBC ResultSet Serializable ???
Previous:From: Thomas G. LockhartDate: 1998-09-01 16:23:31
Subject: Re: [INTERFACES] ODBC interface

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group