reverse sorting - Mailing list pgsql-general

From Marc Tardif
Subject reverse sorting
Date
Msg-id Pine.BSF.4.10.10001261854580.47076-100000@server.b0x.com
Whole thread Raw
Responses Re: [GENERAL] reverse sorting  (Mark Jewiss <mark@knowledge.com>)
List pgsql-general
I need to sort the domains of email addresses from right to left, so that
all similar domains are grouped together. For instance, all .ca's will be
in the same batch.

I think I should be writing a trigger for this, using a secondary table
for the reverse domain name, then using a query like:
select email from table1, table2 where table1.oid=table2.id order by
table2.reverse_domain;

I'm not sure if keeping a secondary table is worthwhile, I will only be
executing this query about 50 times per day.

Let me know if there's a better way,
Marc Tardif


pgsql-general by date:

Previous
From: "Graeme Merrall"
Date:
Subject: RE: [GENERAL] too many open files by postgresql backends
Next
From: Ed Loehr
Date:
Subject: Re: [GENERAL] scaling