pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mel Jamero <mel@gmanmi.tv>
To: 'Bhuvan A' <bhuvansql@myrealbox.com>
To: pgsql-admin@postgresql.org
Subject: Re: function in place of sub-select
Date: Tue, 15 Oct 2002 11:47:45 +0800
Message-ID: <001b01c273fd$a7749230$1b06a8c0@mel> (raw)
In-Reply-To: <Pine.LNX.4.44.0210121644310.3869-100000@Bhuvan.bksys.co.in>

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@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Bhuvan A
Sent: Saturday, October 12, 2002 7:52 PM
To: pgsql-admin@postgresql.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




view thread (3+ messages)  latest in thread

Message-ID: <001b01c273fd$a7749230$1b06a8c0@mel>
Permalink:  ../001b01c273fd$a7749230$1b06a8c0@mel/
Also on:    postgresql.org/message-id/001b01c273fd$a7749230$1b06a8c0@mel

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: mel@gmanmi.tv, bhuvansql@myrealbox.com
  Subject: Re: function in place of sub-select
  In-Reply-To: <001b01c273fd$a7749230$1b06a8c0@mel>
  References: <Pine.LNX.4.44.0210121644310.3869-100000@Bhuvan.bksys.co.in> <001b01c273fd$a7749230$1b06a8c0@mel>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox