Re: [GENERAL] Weird behaviour on a join with multiple keys

2007-03-09 Thread Tom Lane
Charlie Clark <[EMAIL PROTECTED]> writes: > Am 09.03.2007 um 16:15 schrieb Tom Lane: >> There's your problem right there. The string comparison routines are >> built on strcoll(), which is going to expect UTF8-encoded data because >> of the LC_COLLATE setting. If there are any high-bit-set LATIN1

Re: [GENERAL] Weird behaviour on a join with multiple keys

2007-03-09 Thread Charlie Clark
Am 09.03.2007 um 16:15 schrieb Tom Lane: psytec=# show lc_collate; lc_collate - de_DE.UTF-8 (1 row) psytec=# show server_encoding; server_encoding - LATIN1 (1 row) There's your problem right there. The string comparison routines are built on strcoll(), which is

Re: [GENERAL] Weird behaviour on a join with multiple keys

2007-03-09 Thread Tom Lane
Charlie Clark <[EMAIL PROTECTED]> writes: > psytec=# show lc_collate; > lc_collate > - > de_DE.UTF-8 > (1 row) > psytec=# show server_encoding; > server_encoding > - > LATIN1 > (1 row) There's your problem right there. The string comparison routines are built on strco

Re: [GENERAL] Weird behaviour on a join with multiple keys

2007-03-09 Thread Charlie Clark
Am 09.03.2007 um 05:30 schrieb Tom Lane: Charlie Clark <[EMAIL PROTECTED]> writes: I'm getting unexpected results on a query which involves joining two tables on two common variables (firstname and lastname). That looks like it should work. Given that you describe the columns as "names"

Re: [GENERAL] Weird behaviour on a join with multiple keys

2007-03-08 Thread Tom Lane
Charlie Clark <[EMAIL PROTECTED]> writes: > I'm getting unexpected results on a query which involves joining two > tables on two common variables (firstname and lastname). That looks like it should work. Given that you describe the columns as "names" I'm supposing they are of textual datatypes.

Re: [GENERAL] Weird behaviour on a join with multiple keys

2007-03-08 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 03/08/07 16:09, Charlie Clark wrote: > Hi, > > I'm getting unexpected results on a query which involves joining two > tables on two common variables (firstname and lastname). > > This is the basic query: > > SELECT table1.lastname, table1.firstna

Re: [GENERAL] Weird behaviour on a join with multiple keys

2007-03-08 Thread Omar Eljumaily
What happens if you do an outer join instead of an inner join? Charlie Clark wrote: Hi, I'm getting unexpected results on a query which involves joining two tables on two common variables (firstname and lastname). This is the basic query: SELECT table1.lastname, table1.firstname FROM table

[GENERAL] Weird behaviour on a join with multiple keys

2007-03-08 Thread Charlie Clark
Hi, I'm getting unexpected results on a query which involves joining two tables on two common variables (firstname and lastname). This is the basic query: SELECT table1.lastname, table1.firstname FROM table1 INNER JOIN table2 ON (table2.name = table1.name AND table2.vorname = table1.vorname