Surfacing qualifiers - Mailing list pgsql-hackers

From David Fetter
Subject Surfacing qualifiers
Date
Msg-id 20080326070157.GA30828@fetter.org
Whole thread Raw
Responses Re: Surfacing qualifiers
List 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@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

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

Attachment

pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: Script binaries renaming
Next
From: Dimitri Fontaine
Date:
Subject: Re: advancing snapshot's xmin