Reject SQL functions containing utility statements
authorTomas Vondra <[email protected]>
Sun, 30 Jul 2017 16:17:27 +0000 (18:17 +0200)
committerTomas Vondra <[email protected]>
Mon, 31 Jul 2017 01:21:29 +0000 (03:21 +0200)
commitb0ef8d636450ec47a8a546126e6602e03c9bae3f
treeb7f7aead7955e5bb006944f5f936dc64fe11793d
parenta60df4b535c3f2be055ea44a627ac86ead57ef04
Reject SQL functions containing utility statements

The check was not effective for the same reason as 5a54abb7acd, that is
not accounting for XL wrapping the original command into RawStmt. Fix
that by checking parsetree->stmt, and also add an assert checking we
actually got a RawStmt in the first place.
src/backend/catalog/pg_proc.c