How to find the position of a characted in a string - Mailing list pgsql-admin

From ss_postgres
Subject How to find the position of a characted in a string
Date
Msg-id 6c1264780812072230v6d89cbf4hf618c035d98319b4@mail.gmail.com
Whole thread Raw
Responses Re: How to find the position of a characted in a string  ("Pawel Socha" <pawel.socha@gmail.com>)
List pgsql-admin
Hi,

I am trying to find the position of a character in a string which appears multiple times.

The POSITION function returns the position of the character when it first occurs.

For eg:

select position ( ' ' in 'Hi How are you');

This returns the result as "3".


But i need to result to be

3
7
11


Can anyone please let me know what would be the best way to do this.
 
Thanks
 

pgsql-admin by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: upgrade via rpm
Next
From: "Pawel Socha"
Date:
Subject: Re: How to find the position of a characted in a string