Peter Breton <pbreton(at)MIT(dot)EDU> writes:
> Is there something that I'm not understanding here, or is this a bug?
What locale are you using? Non-C locales have sorting rules more
complex than you seem to be expecting.
$ cat data
e
,
ke
k,
ken
k,
kens
k, P
ens
, P
$ LANG=C sort data
,
, P
e
ens
k,
k,
k, P
ke
ken
kens
$ LANG=en_US.iso88591 sort data
e
ens
ke
ken
kens
k,
k,
k, P
,
, P
$
regards, tom lane