pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Hartwig <daveh@insightdist.com>
To: Chris Osborn <fozztexx@talia.hq.vxn.com>
To: pgsql-hackers <pgsql-hackers@postgreSQL.org>
To: pgsql-interfaces <pgsql-interfaces@postgreSQL.org>
Subject: Group/Order by not in target - Was [NEW ODBC DRIVER]
Date: Mon, 11 May 1998 15:20:58 -0400
Message-ID: <35574F9A.5EA56629@insightdist.com> (raw)
References: <3554F0E4.AB657CA1@insightdist.com>
	<Mynah_0.8cl_i386.35573925_00002b92@talia.hq.vxn.com>

I suspect that it is only going to be the MS Access 97 users that are
going to suffer from this weakness in the backend.  I believe Access is
trying to optimize somehow by breaking a single multi-join statement into
multiple statements.   To do this Access must be joining on the client
side based on a relative row position rather than the specified join
columns.

Until the problem is resolved in the backend, the workaround is to
explicitly include the missing attributes in the query.   In my
experience, the missing attributes are usually from one or more sides of
any join clauses.  But, because Access is not showing the actual
statements it is sending to the backend, you will have to guess the
attributes until the query succeeds.   (You could also look at the log
file)

It is not very difficult to produce this problem in MS Access 97;  I
expect my users to beat me up pretty good on this issue.  Thus, I plan to
look into making the fix in the backend myself.  Conceptually it does not
seem too difficult.

1. Add a hidden attribute to the target node structure.

2. Modify the parser/analyzer to add any attributes in the GROUP/ORDER BY
clause that are missing from the target list, to the target list with the
hidden attribute set.

3. Strip the hidden nodes from the target list projection of the query.

4. Add the feature to HAVING clause?

Any, hints, comments, or objections?

Chris Osborn wrote:

> So what can I do to sort in Access '97? I doubt the backend will
> be getting changed anytime soon.
>
> On May. 09 98, 17:12 PDT, "Byron Nikolaidis" <byronn@insightdist.com>
> wrote:
>
> > Access insists on using order by clauses like that, even though
> > the driver returns information saying it can't support it!
>
> > Postgres simply can't handle order by clauses without the fields
> > also being in the target.
>
> > The error you see is a legitimate error coming from the backend.
>
> > When the backend can handle those kinds of order by clauses, the
> > error will stop happening.

Attachments:

vcard.vcf (text/x-vcard, 201B) download begin: vcard fn: David Hartwig n: Hartwig;David email;internet: daveh@insightdist.com x-mozilla-cpt: ;2 x-mozilla-html: TRUE version: 2.1 end: vcard

view thread (4+ messages)  latest in thread

Message-ID: <35574F9A.5EA56629@insightdist.com>
Permalink:  ../35574F9A.5EA56629@insightdist.com/
Also on:    postgresql.org/message-id/35574F9A.5EA56629@insightdist.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: daveh@insightdist.com, fozztexx@talia.hq.vxn.com, pgsql-hackers@postgreSQL.org
  Subject: Re: Group/Order by not in target - Was [NEW ODBC DRIVER]
  In-Reply-To: <35574F9A.5EA56629@insightdist.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox