plpgsql - wrong using of PERFORM statement doesn't raise a error

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: plpgsql - wrong using of PERFORM statement doesn't raise a error
Date: 2016-12-23 09:14:57
Message-ID: CAFj8pRDtmPEekCWNpKQjcJ5=o5YPBR6SrNTZWGS+j-mx3c9UhQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Related to
http://stackoverflow.com/questions/41294888/plpgsql-error-query-has-no-destination-for-result-data-on-a-parameter-declarati

Regards

Pavel Stehule

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pavel Stehule 2016-12-23 09:24:54 Re: plpgsql - wrong using of PERFORM statement doesn't raise a error
Previous Message Josef Machytka 2016-12-23 09:08:42 Re: BUG #14471: PostgreSQL 9.6 "NOT IN" in select causes crash with "ERROR: unknown error"