Exposing quals

From: David Fetter <david(at)fetter(dot)org>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Exposing quals
Date: 2008-05-05 19:01:18
Message-ID: 20080505190118.GI5791@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Folks,

I'd like to make it possible to see qualifiers from inside functions
in PostgreSQL. For my particular case, and for dblink, it would
allow user-space code to some remove bottlenecks which make currently
make inter-DBMS communication extremely inefficient.

The current code returns one (potentially) big string with the quals
ANDed together. I'm thinking that the new code would:

1. Return just a pointer.

2. Add some functions like rsinfo_get_node_tree_str() which can turn
same into (in this case, a string, but others might get tree
structures) on demand from client code.

3. Add wrapper functions in each untrusted PL (trusted PLs shouldn't
be doing anything that needs this).

4. Document the above.

Please find attached the patch, and thanks to Neil Conway and Korry
Douglas for the code, and to Jan Wieck for helping me hammer out the
scheme above. Mistakes are all mine ;)

Comments? Questions?

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

Attachment Content-Type Size
db_link_qual_pushdown-6.patch text/plain 6.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-05-05 19:47:44 Re: pgstat SRF?
Previous Message Andrew Dunstan 2008-05-05 18:00:30 Re: Protection from SQL injection