SQL question - Mailing list pgsql-general

From hamann.w@t-online.de
Subject SQL question
Date
Msg-id wolfgang-1230114173256.A0116016@linux-tuxedo
Whole thread Raw
List pgsql-general
Hi,

I have atable with a "name" column, and I order it usually
order by regexp_match(name, 'regex1'), regexp_match(name, 'regex2')
orthe equivalent
order by (regexp_match(name, 'regex1'))[1], (regexp_match(name, 'regex2'))[2]

Is there a wayto create a function so the statement could read
select ... order by myfunc(name)

Best regards
Wolfgang






pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: row estimate for partial index
Next
From: HECTOR INGERTO
Date:
Subject: Are ZFS snapshots unsafe when PGSQL is spreading through multiple zpools?