Re: enhance SPI to support EXECUTE commands
От | Ahsan Hadi |
---|---|
Тема | Re: enhance SPI to support EXECUTE commands |
Дата | |
Msg-id | CA+9bhCKc4dd=VEpEPCMJfwB2Ho0W5zPzQj+AVdxE8FNxawxPEQ@mail.gmail.com обсуждение исходный текст |
Ответ на | enhance SPI to support EXECUTE commands (Quan Zongliang <zongliang.quan@postgresdata.com>) |
Ответы |
Re: enhance SPI to support EXECUTE commands
|
Список | pgsql-hackers |
I don't see much use for this because the documentation says that "server's execute command cannot be used directly within pl/pgsql function (and it is not needed). Within pl/pgsql you can execute update/delete commands using pl/pgsql EXECUTE command and get results like row_count using "get diagnostic".
Why would somebody do what you have shown in your example in pl/pgsql? Or do you have a more general use-case for this enhancement?
On Thu, Sep 5, 2019 at 11:39 AM Quan Zongliang <zongliang.quan@postgresdata.com> wrote:
Dear hackers,
I found that such a statement would get 0 in PL/pgSQL.
PREPARE smt_del(int) AS DELETE FROM t1;
EXECUTE 'EXECUTE smt_del(100)';
GET DIAGNOSTICS j = ROW_COUNT;
In fact, this is a problem with SPI, it does not support getting result
of the EXECUTE command. I made a little enhancement. Support for the
number of rows processed when executing INSERT/UPDATE/DELETE statements
dynamically.
Regards,
Quan Zongliang
Highgo Software (Canada/China/Pakistan)
URL : http://www.highgo.ca
ADDR: 10318 WHALLEY BLVD, Surrey, BC
EMAIL: mailto: ahsan.hadi@highgo.ca
URL : http://www.highgo.ca
ADDR: 10318 WHALLEY BLVD, Surrey, BC
EMAIL: mailto: ahsan.hadi@highgo.ca
В списке pgsql-hackers по дате отправления: