Re: function in place of sub-select

From: "Mel Jamero" <mel(at)gmanmi(dot)tv>
To: "'Bhuvan A'" <bhuvansql(at)myrealbox(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: function in place of sub-select
Date: 2002-10-15 03:47:45
Message-ID: 001b01c273fd$a7749230$1b06a8c0@mel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Bhuvan!

One way might be to create a C (or C++) program that emulates your my_func
function.

We've tried doing this and did some benchmarks that show that the system
works quite faster when you take out the stored procedures/functions and
"translate" them into C programs.

Regards,

Mel Jamero

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org]On Behalf Of Bhuvan A
Sent: Saturday, October 12, 2002 7:52 PM
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] function in place of sub-select

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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Кузнецова Нина 2002-10-15 11:35:38 regression test failed
Previous Message Tom Lane 2002-10-14 20:56:46 Re: [GENERAL] Postgres-based system to run .org registry?