RE: SQL statement PREPARE does not work in ECPG

Поиск
Список
Период
Сортировка
От Matsumura, Ryo
Тема RE: SQL statement PREPARE does not work in ECPG
Дата
Msg-id 03040DFF97E6E54E88D3BFEE5F5480F737AC011D@G01JPEXMBYT04
обсуждение исходный текст
Ответ на Re: SQL statement PREPARE does not work in ECPG  (Michael Meskes <meskes@postgresql.org>)
Ответы Re: SQL statement PREPARE does not work in ECPG
Список pgsql-hackers
Hi  Meskes-san, Takahashi-san

> If the standard allows it, we want to be able to process it.

I will try to implement it with the Idea-2 that doesn't use PQprepare() and
Takahasi-san's following idea.

> For example, 
> - ECPG convert ":ID" to "$1" and "$1" in the original statement to "$$1"
> - next_insert() do not check "$$1"
> - ECPGdo() reconvert "$$1" to "$1"

But I will probably be late because I don't understand parse.pl very well.
I think that the following rule is made by parse.pl.

     PreparableStmt:
     SelectStmt
     {
     is_in_preparable_stmt = true;  <--- I want to add it.
     $$ = $1;
    }
    |  InsertStmt
    .....

The above variable is used in ecpg.trailer.

    ecpg_param: PARAM       {
        if(is_in_preparable_stmt)
            $$ = mm_strdup(replace_dollar_to_something());
        else
             $$ = make_name();
     } ;


I will use @1 instend of $$1 because the replacing is almost same as the existing replacing function in ecpglib.
Is it good?


Regards
Ryo Matsumura

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Protect syscache from bloating with negative cache entries
Следующее
От: David Steele
Дата:
Сообщение: Re: Add exclusive backup deprecation notes to documentation