Surfacing qualifiers

From: David Fetter <david(at)fetter(dot)org>
To: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Surfacing qualifiers
Date: 2008-03-26 07:01:57
Message-ID: 20080326070157.GA30828@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Folks,

Neil Conway sent me a patch that sketched out a plan to make quals
visible to functions, and Korry Douglas filled in much of the rest of
what you see attached here. Mistakes are all mine. :)

Random observations:

* It appears I've botched the call to deparse_context_for_plan in
src/backend/executor/execQual.c and/or made some more fundamental
error because when testing with PL/Perl, I only see quals inside the
function when there is just one. Where are the APIs for things like
deparse_context_for_plan() documented?

* This stuff should be available to all the PLs. How might it work in
PL/PgSQL, etc.?

* The patch just appends a WHERE clause on when it finds quals in
contrib/dblink/dblink.c. While this is probably a good place to
start, it might be good to explore some kind of approach that allows
more subtlety.

* In PL/Perl, $_TD->{_quals} gets the qualifiers, but they really
should go in their own variable. I'm thinking that one should be
called $_QUAL.

* More generally, it would be nice to have the quals in some kind of
data structure so the calling code could do smarter things with them
than the current string-mashing the example code does.

Help, comments, brickbats, etc. appreciated :)

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-3.patch text/plain 6.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-03-26 07:55:44 Re: PostgreSQL Replication with read-only access to standby DB
Previous Message Greg Smith 2008-03-26 05:03:34 Re: PostgreSQL Replication with read-only access to standby DB