Re: [GENERAL] change the order of FROM selection to make query work

2006-09-27 Thread Tom Lane
Scott Marlowe <[EMAIL PROTECTED]> writes: > On Tue, 2006-09-26 at 09:19, Tom Lane wrote: >> I was aware that MySQL parses this sort of structure wrongly, but it's >> disappointing to hear that sqlite does too :-( > And I think MySQL fixed this abberant behaviour in the newest beta. Actually they

Re: [GENERAL] change the order of FROM selection to make query work

2006-09-27 Thread Scott Marlowe
On Tue, 2006-09-26 at 09:19, Tom Lane wrote: > "Thomas Peter" <[EMAIL PROTECTED]> writes: > > the full code that does produce the error (and this error can be resolved > > as in OP described) is: > > Never oversimplify a bug report. > > > FROM ticket as t, permission as perm, enum as p > > LEFT O

Re: [GENERAL] change the order of FROM selection to make query work

2006-09-27 Thread Thomas Peter
Am 26.9.2006 schrieb "Tom Lane" <[EMAIL PROTECTED]>: >Define "stopped working" ... what was wrong exactly? oh, sorry. i forgot the error message: Error: org.postgresql.util.PSQLException: ERROR: invalid reference to FROM-clause entry for table "t", SQL State: 42P01, Error Code: 0 (i use squirrel

Re: [GENERAL] change the order of FROM selection to make query work

2006-09-26 Thread Tom Lane
"Thomas Peter" <[EMAIL PROTECTED]> writes: > i support a trac [1] installation and migrated the backend from sqlite to > postgres 8.1.4, which worked fine, but: > the following sql stopped working with postgres, Define "stopped working" ... what was wrong exactly? Changing the FROM order should c

Re: [GENERAL] change the order of FROM selection to make query work

2006-09-26 Thread Thomas Peter
Am 26.9.2006 schrieb "Tom Lane" <[EMAIL PROTECTED]>: >> FROM ticket as t, permission as perm, enum as p >> LEFT OUTER JOIN ticket_custom c ON (t.id = c.ticket AND c.name = >> 'fachabteilung') > >The above is, plain and simple, wrong. According to the SQL spec, >JOIN binds more tightly than comma i

Re: [GENERAL] change the order of FROM selection to make query work

2006-09-26 Thread Tom Lane
"Thomas Peter" <[EMAIL PROTECTED]> writes: > the full code that does produce the error (and this error can be resolved > as in OP described) is: Never oversimplify a bug report. > FROM ticket as t, permission as perm, enum as p > LEFT OUTER JOIN ticket_custom c ON (t.id = c.ticket AND c.name = >

Re: [GENERAL] change the order of FROM selection to make query work

2006-09-26 Thread Brandon Aiken
I think you're doing different join types. SQLite is probably doing CROSS JOINs. PostgreSQL is probably doing at least one INNER JOIN. From http://www.sqlite.org/lang_select.html: "If multiple tables names are separated by commas, then the query is against the cross join of the various tables."