From: | Rob Sargent <robjsargent(at)gmail(dot)com> |
---|---|
To: | "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Odd sort behaviour |
Date: | 2009-09-01 21:01:56 |
Message-ID: | 4A9D8BC4.30906@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
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(at)hotmail(dot)com |
| adx008(at)show(dot)org(dot)tw |
| aecheniq(at)mac(dot)com |
| a(dot)ecke70(at)gmx(dot)de |
| aelefant(at)unina(dot)it |
| aeo_tw(at)hotmail(dot)com |
| a(dot)fischedick(at)t-online(dot)de |
| aflores3432(at)gmail(dot)com |
| afried(at)advancedneurosurgeons(dot)com |
| agave007(at)comcast(dot)net |
| agelsinger(at)amirsys(dot)com |
| agis1doc(at)yahoo(dot)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)
From | Date | Subject | |
---|---|---|---|
Next Message | Scott Marlowe | 2009-09-01 21:38:32 | Re: Odd sort behaviour |
Previous Message | Leif B. Kristensen | 2009-09-01 12:56:18 | Re: Plpgsql: Assign regular expression match to variable |