Unix Technical Forum

more information for SRF function

This is a discussion on more information for SRF function within the Pgsql General forums, part of the PostgreSQL category; --> Hello, this is questions for hackers. Is possible put SRF functions more informations about context of calling SRF function? ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 08:11 PM
Pavel Stehule
 
Posts: n/a
Default more information for SRF function

Hello,

this is questions for hackers. Is possible put SRF functions more
informations about context of calling SRF function? Not now. I know, but
in future. For example: I have heavy SRF function which returns more
thausand records, but returned set is filtered WHERE and limit clause. If
I have informations about context, I can use this filters inside
functions. Example dbilink, or other links based on perl DBI and SRF. If
I construct persistent links, I haven't easy posibility check some limits
for query and I have to return all result. Do You think about it? Or its
Posible. Without its isn't posible create efective solution for creating
persistent link to other databases, or other external sources. SRF don't
need knows complet parsed SQL, but only filters related to SRF function. I
can use params for SRF function, but its not too much usefull.

sample: srf returns email messages saved in some central archive.
create view mailitems as select * from srf_readmails();

std. using:
select * from mailitems where to like '%.test.cz';

I think this "implicit" parameters can be carry to function on demand
(similar triggers).

CREATE OR REPLACE FUNCTION srf_readmails() RETURNS SETOF RECORD AS $$
$filters = $_TD->{filters}
$$ LANGUAGE plperl WITH CONTEXT;

Regards
Pavel Stehule


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:08 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com