function in place of sub-select - Mailing list pgsql-admin

From Bhuvan A
Subject function in place of sub-select
Date
Msg-id Pine.LNX.4.44.0210121644310.3869-100000@Bhuvan.bksys.co.in
Whole thread Raw
Responses Re: function in place of sub-select
List pgsql-admin
Hi,

I am using postgresql 7.2 on RHL7.3.

I know that we cannot return a record or multiple values from a plpgsql
procedure unless otherwise it is a triggered procedure. But i have a need
to use a function in place of sub-select, something like

select * from my_table where field1 in (select my_func());

my_func() returns a value of type text. I am literally parsing the values
in my_func() to return the value, in the format acceptable by IN operator.
Something like, "'value1', 'value2'". But it has been interpreted as it is
instead of 'value1' and 'value2' seperately and resulting in 0 record.
Again, a view instead of function in a sub-select donot help in my case,
since i have lot of processing involved in the function.

How do i accompanise it in function? Or whats the other way?

TIA.

regards,
bhuvaneswaran



pgsql-admin by date:

Previous
From: "Josh Goldberg"
Date:
Subject: Re: Multiple backends on a single physical database
Next
From: Chris Miles
Date:
Subject: Re: Multiple backends on a single physical database