Re: [BUGS] plpgsql - wrong using of PERFORM statement doesn't raise a error

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: [BUGS] plpgsql - wrong using of PERFORM statement doesn't raise a error
Дата
Msg-id CAFj8pRAzYYB3z8AVCXrRBxTPsF9=CXUxdEkP=fzo3eBhHDrZUw@mail.gmail.com
обсуждение исходный текст
Ответ на [BUGS] plpgsql - wrong using of PERFORM statement doesn't raise a error  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-bugs


2016-12-23 10:14 GMT+01:00 Pavel Stehule <pavel.stehule@gmail.com>:
Hi

Following command finishing without any error, but (as expected) do nothing

postgres=# create table foo(a int);
CREATE TABLE
Time: 51,363 ms
postgres=# DO $$
postgres$# DECLARE t text;
postgres$# BEGIN
postgres$#   t := 'INSERT INTO foo VALUES(10)';
postgres$#   PERFORM t;
postgres$# END;
postgres$# $$;
DO
Time: 4,375 ms
postgres=# select * from foo;
┌───┐
│ a │
╞═══╡
└───┘
(0 rows)

Time: 1,367 ms


Regards

It generate valid command

SELECT t --> SELECT 'INSERT ...';

Hard to detect this issue.

Pavel
 

Pavel Stehule

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: [BUGS] plpgsql - wrong using of PERFORM statement doesn't raise a error
Следующее
От: Steven Winfield
Дата:
Сообщение: Re: [BUGS] BUG #14473: Parallel query aborts with too manyconnections