Is STRING in any of Fielda, Fieldb, Fieldc ... ?

From: Alexi Margo <alexi(at)wwood(dot)co(dot)uk>
To: "'pgsql-general(at)PostgreSQL(dot)org'" <pgsql-general(at)PostgreSQL(dot)org>
Subject: Is STRING in any of Fielda, Fieldb, Fieldc ... ?
Date: 2000-09-27 15:44:27
Message-ID: C7114BC8AF49D31192B000A024E128D41071A1@proxy.mi-group.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

As mentioned before, I am migrating a MySQL application to PostgreSQL but I
have little experience with PG.

One function that I found extremely useful in MySQL was the FIELDS()
function. I don't think that there is a built-in function in PostgreSQL that
achieves the same effect, but basically the first argument was the string
you were searching for and the rest were strings to inspect. If the string
was not found, it returned zero - otherwise it returned the zero-based index
of the argument which matched (if that makes sense). I then used the SIGN()
function to simply determine whether the string had been found or not - 1
indicated it had, 0 that it had not.

Has anyone written such a function, preferably one that goes a little
further than the MySQL one, allowing you to specify wildcards in the search
string? If so, I would be very interested in using it. Otherwise, pointers
towards a "beginners" reference for creating PostgreSQL functions would be
much appreciated..

Many thanks,

**********************************************************
Alexi Margo
Internet Systems Manager
Wildwood Technology Ltd
http://www.wwood.co.uk/
t +44-(0)20 8426 7777
f +44-(0)20 8426 5050
**********************************************************

This message is intended only for the use of the person(s) ("the Intended
Recipient") to whom it is addressed. It may contain information which is
privileged and confidential within the meaning of applicable law.
Accordingly any dissemination, distribution, copying or other use of this
message or any of its content by any person other than the Intended
Recipient may constitute a breach of civil or criminal law and is strictly
prohibited. If you are not the Intended Recipient please contact the sender
as soon as possible.

Browse pgsql-general by date

  From Date Subject
Next Message Wade D. Oberpriller 2000-09-27 15:51:27 Re: Increasing max size of tuples?
Previous Message ShaneMRyan 2000-09-27 15:25:05 Re: pg_hba.conf