pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliveiros C, <oliveiros.cristina@marktest.pt>
To: Adrian Klaver <aklaver@comcast.net>
To: pgsql-sql@postgresql.org
Subject: Re: How to order varchar data by word
Date: Mon, 19 Oct 2009 18:07:57 +0100
Message-ID: <EDA0AFB36F144EE38143CCE0734312E0@marktestcr.marktest.pt> (raw)
References: <6caee9520910140240u13daba93ua20637642727776e@mail.gmail.com>
	<b4399d110910140243q408a3e50y46dd7da936bdfe57@mail.gmail.com>
	<99F66F53142145DE8127EAF7423AF726@marktestcr.marktest.pt>
	<200910141354.17785.aklaver@comcast.net>

Hello, Adrian.

Thank you for your email.

I am not using any SQL at this time, but I 'd like to understand
what is exactly the criterion that the ORDER BY uses to order text.

Giving you some background  :

I need to make an efficient join between data generated by my program
and data output by postgres and of course, it is mandatory that both lists 
of records
be ordered using the same criterion.
I need to figure out what is exactly the criterion used by postgres so I can 
mimic it on my
program. I thought it was ordinal, but it seems it isnt, as the @ symbol 
comes before the 0 (zero).
According to ASCII numeric codes, it shouldn't


If any one can explain me exactly how the order by clause works on varchars, 
I 'd really appreciate it.

I've already examined documentation carefully, but couldn't find it. Maybe I 
looked on the wrong place...


Best,
Oliveiros

----- Original Message ----- 
From: "Adrian Klaver" <aklaver@comcast.net>
To: <pgsql-sql@postgresql.org>
Cc: "Oliveiros C," <oliveiros.cristina@marktest.pt>
Sent: Wednesday, October 14, 2009 9:54 PM
Subject: Re: [SQL] How to order varchar data by word


> On Wednesday 14 October 2009 7:13:22 am Oliveiros C, wrote:
>>  Hello, list.
>>
>> I have a table with a varchar field that I would like to order by word, 
>> not
>> by ordinal, which seems to be the default on postgres.
>>
>> Does anyone have a clue on how this can be done?
>>
>> Many thanx in advance,
>>
>> Best,
>> Oliveiros
>
> Can you show the SQL you are using?
>
> -- 
> Adrian Klaver
> aklaver@comcast.net
>
> -- 
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql 




view thread (7+ messages)  latest in thread

Message-ID: <EDA0AFB36F144EE38143CCE0734312E0@marktestcr.marktest.pt>
Permalink:  ../EDA0AFB36F144EE38143CCE0734312E0@marktestcr.marktest.pt/
Also on:    postgresql.org/message-id/EDA0AFB36F144EE38143CCE0734312E0@marktestcr.marktest.pt

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: oliveiros.cristina@marktest.pt, aklaver@comcast.net
  Subject: Re: How to order varchar data by word
  In-Reply-To: <EDA0AFB36F144EE38143CCE0734312E0@marktestcr.marktest.pt>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox