Erik,
This isn't really a jdbc question, problably should be addressed on
pgsql-general, or pgsql-sql, however I will give it a try. On my system
I actually see the same results as Oracle and Sapdb and not the results
you are reporting for postgres. This would lead me to believe that the
behavior you are seeing is correct behavior but that you are running
postgres with a locale that is different than mine. Sort order is
determined by the locale that you are running under. My database is
installed with a C locale (i.e. binary sort order) as opposed to a
language/territory specific locale that would produce a different ordering.
thanks,
--Barry
Erik Behrends wrote:
> Hello to everybody,
>
> I have a little problem concerning the "ORDER BY" clause.
> Consider a table "test" having one text field "val" with the following
> entries:
>
> tralala
> Tralala
> tralal
>
> Now, I want to execute the following query via JDBC:
> SELECT * FROM test ORDER BY val DESC;
> When using JDBC with Oracle or Sapdb I get the following result:
>
> tralala
> tralal
> Tralala
>
> (correct lexicographic order as expected by Java)
>
> Now, using PostgreSQL (7.1.3 with JDBC driver 7.2) the result is:
>
> Tralala
> tralala
> tralal
>
> (lexicographic order as implemented in PostgreSQL)
>
> Any ideas what's going on there?
> Thanks in advance,
>
> -- Erik Behrends
> ----------------------------------------------
> Inxnet GmbH
> intelligent software solutions
> tel. 0761 / 296 979-0
> http://www.inxnet.de
> ----------------------------------------------
> P.S.: Versenden personalisierter E-Mails - mit
> inxmail ein Kinderspiel! http://www.inxmail.de
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>