MySQL insert() and instr() equiv

From: Mark Constable <markc(at)renta(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: MySQL insert() and instr() equiv
Date: 2006-06-17 16:06:28
Message-ID: 200606180206.28483.markc@renta.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

When using MySQL I have one select that uses MySQL functions so I am
wondering about the best way to go to end up with the same result in
PostgreSQL.

uid is an email address stored in the passwd table as user(at)domain(dot)com
and this construct allows an incoming username such as "user.domain.com"
to be compared to the stored "user(at)domain(dot)com".

SELECT wpath FROM passwd WHERE uid="\L" OR insert(uid,instr(uid,'@'),1,'.')="\L"

--markc

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-06-17 16:33:37 Re: MySQL insert() and instr() equiv
Previous Message Robert Treat 2006-06-17 15:10:26 Re: phppgadmin 4.0.1