Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3CCE2634972 for ; Tue, 1 Sep 2009 18:02:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 10430-04 for ; Tue, 1 Sep 2009 21:02:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by mail.postgresql.org (Postfix) with ESMTP id CEA3563349D for ; Tue, 1 Sep 2009 18:02:06 -0300 (ADT) Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtp (Exim 4.62) (envelope-from ) id 1MiaUO-00059M-Hj; Tue, 01 Sep 2009 15:02:04 -0600 Received: from [208.187.158.94] (helo=[172.16.1.225]) by in01.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MiaUO-0000EU-Dl; Tue, 01 Sep 2009 15:02:04 -0600 Message-ID: <4A9D8BC4.30906@gmail.com> Date: Tue, 01 Sep 2009 15:01:56 -0600 From: Rob Sargent User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" Subject: Odd sort behaviour Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-XM-SPF: eid=; ; ; mid=; ; ; hst=in01.mta.xmission.com; ; ; ip=208.187.158.94; ; ; frm=robjsargent@gmail.com; ; ; spf=neutral X-SA-Exim-Connect-IP: 208.187.158.94 X-SA-Exim-Rcpt-To: pgsql-sql@postgresql.org, robjsargent@gmail.com X-SA-Exim-Mail-From: robjsargent@gmail.com X-SA-Exim-Scanned: No (on in01.mta.xmission.com); Exit with error (see exim mainlog) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 200909/5 X-Sequence-Number: 33070 Since when does "." sort as "nothing at all" This select select distinct u.user_name from subscriber_user u, subscription s, subscription_template t where u.id = s.subscriber_entity_id and s.template_id = t.id and t.application_id = (select id from application where short_name ='books') order by u.user_name \p\g over this table def.(for user_name) \d subscriber_user Table "public.subscriber_user" +-----------------------+---------+---------------+ | Column | Type | Modifiers | +-----------------------+---------+---------------+ | id | bigint | not null | | last_name | text | | | first_name | text | | | user_name | text | | | email_address | text | | | force_password_change | boolean | default false | | title | text | | +-----------------------+---------+---------------+ Indexes: "subscriber_user_pkey" PRIMARY KEY, btree (id) "idx__subscriber_users__lower_email_address" UNIQUE, btree (lower(email_address)) "idx__subscriber_users__lower_user_name" UNIQUE, btree (lower(user_name)) Foreign-key constraints: "subscriber_user_id_fkey" FOREIGN KEY (id) REFERENCES subscriber(id) is producing this sorted??? output | adrianohazim@hotmail.com | | adx008@show.org.tw | | aecheniq@mac.com | | a.ecke70@gmx.de | | aelefant@unina.it | | aeo_tw@hotmail.com | | a.fischedick@t-online.de | | aflores3432@gmail.com | | afried@advancedneurosurgeons.com | | agave007@comcast.net | | agelsinger@amirsys.com | | agis1doc@yahoo.gr | using this client Welcome to psql 8.3.7, the PostgreSQL interactive terminal. and this server show server_version; +----------------+ | server_version | +----------------+ | 8.3.7 | +----------------+ (1 row) nsm=# show server_encoding +-----------------+ | server_encoding | +-----------------+ | UTF8 | +-----------------+ (1 row)