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

RE: [GENERAL] ODBC Driver

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: M(dot)Boekhold(at)et(dot)tudelft(dot)nl, Bruce Tong <zztong(at)laxmi(dot)ev(dot)net>
Cc: PostgreSQL General <pgsql-general(at)postgreSQL(dot)org>, pgsql-interfaces(at)postgreSQL(dot)org
Subject: RE: [GENERAL] ODBC Driver
Date: 1998-07-23 16:17:16
Message-ID: F10BB1FAF801D111829B0060971D839F34E76E@cpsmail (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-interfaces
> > SELECT contact.contact_lname, contact.contact_fname,
> school.school_name
> > FROM contact INNER JOIN school ON contact.contact_school =
> > school.school_id;
> > 
> > If I remember correctly, INNER JOIN is not yet supported in
> PostgreSQL,
> > which would explain the failure. Sorry to have accused the failure
> on the
> 
> Aren't INNER JOIN's not exactly the same as what we call a 'normal'
> join?
> ie. isn't it an idea to add the syntax of an INNER JOIN to the parser
> and 
> just kinda ignore it? You could have the scanner return just a ","
> (comma)
> for the INNER_JOIN token....
> 
> Maarten
> 
If it were only that easy it would have been implemented long ago.  
The 'join clause' syntax takes the form of
	tuple_struct(1) [AS alias(1)] <JOIN_TYPE> tuple_struct(1) [AS
alias(2)] ON column_contraints
Where:
	tuple_struct  = a table name, or the result of a 'join clause'
	JOIN_TYPE = 
		INNER JOIN |  -- Normal join
		LEFT [OUTER] JOIN |  -- Includes all rows from
tuple_struct(1) even if they do not satisfy the column_contraints (NULL
padded)
		RIGHT [OUTER] JOIN | -- Includes all rows from
tuple_struct(2) even if they do not satisfy the column_contraints (NULL
padded)
		FULL OUTER JOIN -- Includes all rows from tuple_struct(1
& 2) even if they do not satisfy the column_contraints (NULL padded)
	constraint_type = Same form as a WHERE clause
Which means you could easily have:
  SELECT * 
    FROM ((t1 INNER JOIN t2 
			ON (t1.col1 = t2.col1 AND t1.name = t2.type)) AS
j1 
		INNER JOIN (t3 INNER JOIN t4 
			ON (t3.col1 = t4.col1 AND t3.name = t4.type)) AS
j2 
				ON j1.col1 = j2.col1) AS r1
   WHERE r1.stuff = 17 AND
         r1.kind = 'those'
   ORDER BY r1.sortCol
Which would have to be rewritten as:
  SELECT * 
    FROM t1, t2, t3, t4
   WHERE t1.col1 = t2.col1 AND 
		t1.name = t2.type AND
		t3.col1 = t4.col1 AND 
		t3.name = t4.type AND
		t1.col1 = t3.col1 AND
	   t1.stuff = 17 AND
         t3.kind = 'those'
   ORDER BY t4.sortCol

I say all this without a standard sitting in front of me and with no
formal training so I want balk at correction if I missed a point or am
misinformed, but this is what experience has told me.  (Haven't ever
actually tried that AS part of it though.)
		-DEJ




pgsql-interfaces by date

Next:From: Bruce TongDate: 1998-07-23 17:11:57
Subject: Re: [INTERFACES] ODBC Driver
Previous:From: Byron NikolaidisDate: 1998-07-23 15:57:16
Subject: Re: [INTERFACES] ODBC Driver

pgsql-general by date

Next:From: The Hermit HackerDate: 1998-07-23 16:18:54
Subject: RE: [ANNOUNCE] Revamp'd Web Site...
Previous:From: Byron NikolaidisDate: 1998-07-23 15:57:16
Subject: Re: [INTERFACES] ODBC Driver

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