Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCRyI-0001d4-Bl for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2017 15:08:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eCRyH-0001Oi-QC for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Nov 2017 15:08:53 +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 1eCRyG-0001Nh-Or for pgsql-hackers@postgresql.org; Wed, 08 Nov 2017 15:08:52 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eCRy5-0002i5-Pi for pgsql-hackers@postgresql.org; Wed, 08 Nov 2017 15:08:52 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id DEF6920DEB; Wed, 8 Nov 2017 10:08:39 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Wed, 08 Nov 2017 10:08:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=d3JBH0 avXfy2AKN4fTaRKVu1J3zXRoDiUMYLJgXZafI=; b=YujgtvmgGVnqnQMaX1CBr6 kJm+4d1pdn23YhlEi8tZYMbjpNZzutFIimN1cuf5h5JHjvts+RK9OEwmKDX44MRQ MKzFMN6QshbAsIZNhQyMIRMrRLNZL1QqVk/jKyDNbHLjdGzjrTVGVCbx7k8K4aEx IXcHhEKE3mldufksUaY8VabszFEEGoCtYDrBUNiqhaYKkl/qCth7AgCjQybm4VTa 4XGW4oIl/jTgD72W5DkZbvONKruyP3AcGe1QrgTgiRQlA4w05X98mGe1UwVuudhw Jq76JHp4HRTMW38SIbMIqjZMZKmW0tJjkIdIlRWHWOhWIujiwKI39WClh0LWiqoA == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 972FA24740; Wed, 8 Nov 2017 10:08:39 -0500 (EST) Subject: Re: SQL procedures To: Pavel Stehule References: <336f6926-8990-ff2d-4167-276ce417fc32@2ndquadrant.com> <30d523bb-19d6-35f0-970c-b2bc5ff27b18@2ndquadrant.com> Cc: pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Wed, 8 Nov 2017 10:08:39 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 11/8/17 09:33, Pavel Stehule wrote: > We can create auto session variable STATUS. This variable can be 0 > if procedure was returned without explicit RETURN value. Or it can > hold different value specified by RETURN expr. > > This value can be read by GET DIAGNOSTICS xxx = STATUS > > or some similar. > > The motivation is allow some mechanism cheaper than our exceptions. I suppose this could be a separately discussed feature. We'd also want to consider various things that PL/pgSQL pretends to be compatible with. One of the main motivations for procedures is to do more complex and expensive things including transaction control. So saving exception overhead is not really on the priority list there. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers