Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cGumM-0006d3-Rf for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Dec 2016 21:38:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cGumL-0004vt-RD for pgsql-bugs@arkaria.postgresql.org; Tue, 13 Dec 2016 21:38:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cGumK-0004uw-Ke for pgsql-bugs@postgresql.org; Tue, 13 Dec 2016 21:38:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cGumH-0002Kf-DT for pgsql-bugs@postgresql.org; Tue, 13 Dec 2016 21:38:28 +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 uBDLbcPi000776; Tue, 13 Dec 2016 16:37:38 -0500 From: Tom Lane To: Pavel Stehule cc: =?UTF-8?B?5b635ZOl?= , "pgsql-bugs@postgresql.org" Subject: Re: BUG #14463: refcursor cann't used with array or variadic parameter? In-reply-to: <2858.1481647531@sss.pgh.pa.us> References: <20161213152548.14897.81245@wrigleys.postgresql.org> <2858.1481647531@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 13 Dec 2016 11:45:31 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <774.1481665058.1@sss.pgh.pa.us> Date: Tue, 13 Dec 2016 16:37:38 -0500 Message-ID: <775.1481665058@sss.pgh.pa.us> X-Pg-Spam-Score: -5.0 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org I wrote: > Pavel Stehule writes: >> It is not a bug - it is feature. PLpgSQL statements doesn't expect a >> expression on some places. > Well, it's not unreasonable to expect that a subscripted datum could > be used. It looks to me like this is a grammar omission and the > executor code would work fine. Well, not so much. I was thinking in terms of unifying both getdiag_target and cursor_variable with the assign_var production, but actually pl_exec.c is only on board with doing that for getdiag_target. However, we can get it to throw a more sensible error by seeing whether the next token is '['. I'm not that concerned about whether you can use an array element in OPEN, but the current error message certainly looks like a bug rather than an omitted feature. I've pushed a patch that fixes the error message and also allows the case for GET DIAGNOSTICS. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs