Re: more information for SRF function

From: David Fetter <david(at)fetter(dot)org>
To: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
Cc: pgsql-generals(at)postgresql(dot)org
Subject: Re: more information for SRF function
Date: 2005-01-26 23:40:59
Message-ID: 20050126234059.GD6002@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jan 26, 2005 at 10:42:07PM +0100, Pavel Stehule wrote:
> 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.

Are you using DBI-Link? If so, how? Have you found bugs or features
(apart from the ones you bring up here) that you would like to have?

> 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;

This would be really great. As I understand it, in the current
implementation, by the time a RULE kicks in, the WHERE clause is
unavailable.

Could it be made available?

Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PFC 2005-01-26 23:57:25 Re: Extended unit
Previous Message PFC 2005-01-26 23:35:31 Re: on update / on delete performance of foreign keys