FIND_IN_SET - Mailing list pgsql-sql

From Michael Eshom
Subject FIND_IN_SET
Date
Msg-id 4B21E50A.7090404@oldiesmann.us
Whole thread Raw
Responses Re: FIND_IN_SET  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-sql
<font size="-1"><font face="Arial">I am on the marketing team for a popular forum system, and am also the primary
PostgreSQLtester/bugfixer. Currently our forum system treats MySQL's FIND_IN_SET() as a boolean (eg whether or not the
specifiedvalue was found in the given set), which is fine since MySQL will treat any integer greater than 0 as boolean
trueand 0 as boolean false. I have already managed to write a FIND_IN_SET() function for Postgres that behaves as
boolean.However, we would like to be able to use the true functionality of this function (so it will return an integer
insteadof boolean).<br /><br /> This is where I've run into a problem. The mysqlcompat package has a FIND_IN_SET() in
it,but it requires plpgsql, and I'd rather not require something that a regular user can't install themselves,
regardlessof how simple it is for the host to add it.<br /><br /> I did find another version of FIND_IN_SET() on a blog
withseveral other MySQL-compatible functions, and while it uses regular SQL, it requires the generate_subscripts()
functionwhich isn't available in Postgres 8.1 - the latest version officially supported by CentOS.<br /><br /> Is there
away to do this without requiring plpgsql or generate_subscripts?<br /></font></font><div class="moz-signature">-- <br
/><fontface="Comic Sans MS" style="color: blue; size: 12px;">Michael "Oldiesmann" Eshom<br /> Christian Oldies Fan<br
/>Cincinnati, Ohio</font></div> 

pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Window function trouble
Next
From: Jasen Betts
Date:
Subject: Re: constants in 2-column foreign keys or how to design a storage for text-groups ?