expression evaluation with expected datatypes - Mailing list pgsql-hackers

From Pavel Stehule
Subject expression evaluation with expected datatypes
Date
Msg-id CAFj8pRB9Nh3RpW-zoq3Z7gj5txrFmhJj68a3H5KhQ6Y9T=YkFQ@mail.gmail.com
Whole thread Raw
Responses Re: expression evaluation with expected datatypes  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: expression evaluation with expected datatypes  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List 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


pgsql-hackers by date:

Previous
From: Amit kapila
Date:
Subject: Re: pg_prewarm(some more observations in patch)
Next
From: Joel Jacobson
Date:
Subject: Re: Schema version management