Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Ken Tanzer
On Thu, Sep 10, 2015 at 3:03 PM, Andrew Sullivan wrote: > On Thu, Sep 10, 2015 at 02:54:31PM -0700, Ken Tanzer wrote: > > Thanks, but I guess I should have been clearer. Thanks to y'all > wonderful > > mailing list folks, I get it now as to why the two sorts are not the > same. > > I'm hoping fo

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Joe Conway
On 09/10/2015 03:03 PM, Andrew Sullivan wrote: > On Thu, Sep 10, 2015 at 02:54:31PM -0700, Ken Tanzer wrote: >> Thanks, but I guess I should have been clearer. Thanks to y'all wonderful >> mailing list folks, I get it now as to why the two sorts are not the same. >> I'm hoping for practical sugges

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Andrew Sullivan
On Thu, Sep 10, 2015 at 02:54:31PM -0700, Ken Tanzer wrote: > Thanks, but I guess I should have been clearer. Thanks to y'all wonderful > mailing list folks, I get it now as to why the two sorts are not the same. > I'm hoping for practical suggestions or advice about how to get C locale > sorting

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Ken Tanzer
On Thu, Sep 10, 2015 at 2:02 PM, Alvaro Herrera wrote: > Ken Tanzer wrote: > > > Are there any other potential solutions, pitfalls or considerations that > > come to mind? Any thoughts welcome. And as I said, if there's not a > good > > way to do this I'll probably leave it alone. > > In part,

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Alvaro Herrera
Ken Tanzer wrote: > Are there any other potential solutions, pitfalls or considerations that > come to mind? Any thoughts welcome. And as I said, if there's not a good > way to do this I'll probably leave it alone. In part, it boils down to what you use the in ORDER BY clause. If you concatena

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Ken Tanzer
On Thu, Sep 10, 2015 at 12:56 PM, Peter Geoghegan < peter.geoghega...@gmail.com> wrote: > On Thu, Sep 10, 2015 at 12:51 PM, Ken Tanzer wrote: > > OK, can one of you help me out in understanding this? I would have > thought that given "CLARK," and "CLARKE" that the comma would get compared > agai

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Ken Tanzer
On Thu, Sep 10, 2015 at 12:47 PM, Tom Lane wrote: > Peter Geoghegan writes: > > On Thu, Sep 10, 2015 at 12:35 PM, Ken Tanzer > wrote: > >> Any thoughts about what's going on, what to do about it, or what > obvious point I missing? Thanks in advance! > > > This is the expected behavior. > > If

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Peter Geoghegan
On Thu, Sep 10, 2015 at 12:51 PM, Ken Tanzer wrote: > OK, can one of you help me out in understanding this? I would have thought > that given "CLARK," and "CLARKE" that the comma would get compared against > the E and come first. End of story, before we even get to anything farther > in the s

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Ken Tanzer
Alright never mind, I guess I see what's going on. Thanks! Ken On Thu, Sep 10, 2015 at 12:51 PM, Ken Tanzer wrote: > > > On Thu, Sep 10, 2015 at 12:47 PM, Tom Lane wrote: > >> Peter Geoghegan writes: >> > On Thu, Sep 10, 2015 at 12:35 PM, Ken Tanzer >> wrote: >> >> Any thoughts about what's

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Tom Lane
Peter Geoghegan writes: > On Thu, Sep 10, 2015 at 12:35 PM, Ken Tanzer wrote: >> Any thoughts about what's going on, what to do about it, or what obvious >> point I missing? Thanks in advance! > This is the expected behavior. If you don't like it, sort in C locale ...

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Steve Crawford
Any null values in first name?? -Steve On Thu, Sep 10, 2015 at 12:35 PM, Ken Tanzer wrote: > Hi. In a table that includes these columns: > > my_db=> \d tbl_client > ... > name_last | character varying(40) | not null > name_first | character varying

Re: [GENERAL] Very puzzling sort behavior

2015-09-10 Thread Peter Geoghegan
On Thu, Sep 10, 2015 at 12:35 PM, Ken Tanzer wrote: > Any thoughts about what's going on, what to do about it, or what obvious > point I missing? Thanks in advance! This is the expected behavior. Locale rules will weigh the punctuation character and space you added after primary alphabetical or

[GENERAL] Very puzzling sort behavior

2015-09-10 Thread Ken Tanzer
Hi. In a table that includes these columns: my_db=> \d tbl_client ... name_last | character varying(40) | not null name_first | character varying(30) | not null ... I am extremely puzzled by the sorting of the "CLARKE"s in this list: my_db=