From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | expression evaluation with expected datatypes |
Date: | 2012-07-08 07:13:09 |
Message-ID: | CAFj8pRB9Nh3RpW-zoq3Z7gj5txrFmhJj68a3H5KhQ6Y9T=YkFQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello
When I worked on parametrised DO statement, I had to solve following issue:
Syntax is:
DO (param list) $$ ... $$ LANGUAGE ... USING expr_list
What is correct way for evaluation of expr_list with specified target types?
I used two techniques:
1) evaluation expressions -
http://archives.postgresql.org/pgsql-hackers/2012-07/msg00340.php
this code is elegant and works well - with one significant issue -
doesn't support subqueries
2) SPI with parse_tree execution - SPI expect so SQL will be entered
in plain text form. But sometimes we have as input parsed tree - as
result of some parser. We can serialize tree to string, but then we
get different queryString and we will have problem with possible error
identification in queryString, I patched SPI and append a two
functions for evaluation parsed tree. Probably it should be better
done without SPI, but I missing some like DestSPI for general usage.
http://archives.postgresql.org/pgsql-hackers/2012-07/msg00361.php
What is correct way for solution of this task? I am thinking so there
some interface is missing
Regards
Pavel
From | Date | Subject | |
---|---|---|---|
Next Message | Joel Jacobson | 2012-07-08 12:45:48 | Re: Schema version management |
Previous Message | Amit kapila | 2012-07-08 05:32:25 | Re: pg_prewarm(some more observations in patch) |