Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1Ozb-000119-MR for pgsql-sql@arkaria.postgresql.org; Tue, 01 Nov 2016 02:40:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c1Oza-0000f5-Eu for pgsql-sql@arkaria.postgresql.org; Tue, 01 Nov 2016 02:40:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c1Oyc-000801-D6 for pgsql-sql@postgresql.org; Tue, 01 Nov 2016 02:39:02 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c1OyV-0007jE-6d for pgsql-sql@postgresql.org; Tue, 01 Nov 2016 02:39:00 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id uA12cr0v020521; Mon, 31 Oct 2016 22:38:53 -0400 From: Tom Lane To: Michael Moore cc: "David G. Johnston" , postgres list Subject: Re: Why does the PL/pgSQL compiler do this? In-reply-to: References: Comments: In-reply-to Michael Moore message dated "Mon, 31 Oct 2016 16:32:38 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20519.1477967933.1@sss.pgh.pa.us> Date: Mon, 31 Oct 2016 22:38:53 -0400 Message-ID: <20520.1477967933@sss.pgh.pa.us> X-Pg-Spam-Score: -4.6 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Michael Moore writes: > I'm still a bit confused. If I replace the ROLLBACK; command with ELEPHANT; > the result is a syntax error. Why doesn't ROLLBACK; produce the same error > since it is not valid in the LANGUAGE plpgsql. That's a runtime error so far as plpgsql is concerned, because it relies on the SPI layer to throw the error. It might be practical to complain about it at compile time, but it would be some extra code that nobody's written. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql