Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHDXI-0001OR-Bj for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Nov 2017 18:44:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eHDXH-0006tN-LL for pgsql-hackers@arkaria.postgresql.org; Tue, 21 Nov 2017 18:44:43 +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 1eHDXH-0006tC-8D for pgsql-hackers@lists.postgresql.org; Tue, 21 Nov 2017 18:44:43 +0000 Received: from mail-yw0-x232.google.com ([2607:f8b0:4002:c05::232]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eHDXD-000881-H5 for pgsql-hackers@postgresql.org; Tue, 21 Nov 2017 18:44:41 +0000 Received: by mail-yw0-x232.google.com with SMTP id d2so6125486ywb.11 for ; Tue, 21 Nov 2017 10:44:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Dy+K7fQoBWo1MGMM17UWA4XzTRiUwL5fsB6fkt2qVtg=; b=KWJGtAeQjpZ2UjsR4zXmDw/pvcG8srsOxR6bd6jGMSVH7bOnpWax+vZSLOZd3jcril oDScBxXvLeAtV5RTlVt05o6QBb4XbIraTfYWL23HXskh2R89B1PhO4qdC+Yup7Szr2Cc WlM1Tmn1qq0YDPKX9gf+Rz+hpTZ4VpuW7W6A9dVJHrNOK14tF+w7ybxoKqXMlZJ9405N PMl8EsI+/cydb3vcsnQgVv4CY5/Xmg1YxyFfjXf0Yg2cUIEd2HvbMW5P5xq6ftmcNTDT 6/ZIJj4ptGDO1R826Z67cn0Uo1Z7+mV5+/Z7LfMozXj2T/3lSRzr1WMqzXzFisAxTimp 1GYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Dy+K7fQoBWo1MGMM17UWA4XzTRiUwL5fsB6fkt2qVtg=; b=A2vSBJ3NETvoSDz6DwudcVXx63qWi1MRgOmfddV8/zVAwZl/j4lb9npanFDt/DRliJ JWdAMAlLht0blle5COG+i5O4QVIk7qvB0kaVahQYilB+li+mjVVNz2zgl1x1mfN2gkc8 aPhQgUZTvRyHlGzOwgpwaPUnrz+cGMWKOOBKuMnzWKfKuZK60C3obgp9NZlcybesZa2K 1rBvfVNK0d1nZdW9vtCGK/TWwpfwPD//iUmviOBBiAbG+Lp8WarxUYfTn/yLOu2Icjzg O7qIBUxwldpR7gxqlK1tUfQcEexzUEdLOQotUu0IQLkra8z/zC+SHBNGhoY1mea9RNjh Fwzw== X-Gm-Message-State: AJaThX4UXEiNW5WdQgiKkgblKKoejbHSkmtNH4LBJALdGp93bL/7DCTp jy16ud/BWaYoMn35lpwee3hUDXNN+g== X-Google-Smtp-Source: AGs4zMZUJeJvHBJzNNmFA7IB+9gv6ExdIG7+zqHocbx4IJ2cpvbrwSg4gjLkcD6hUwVPxdRkyOrJRg== X-Received: by 10.129.84.10 with SMTP id i10mr11934647ywb.97.1511289878018; Tue, 21 Nov 2017 10:44:38 -0800 (PST) Received: from [192.168.10.146] ([98.122.175.38]) by smtp.gmail.com with ESMTPSA id x66sm6020900ywb.0.2017.11.21.10.44.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Nov 2017 10:44:37 -0800 (PST) From: Andrew Dunstan X-Google-Original-From: Andrew Dunstan Subject: Re: [HACKERS] SQL procedures To: Peter Eisentraut , pgsql-hackers Cc: Simon Riggs References: <336f6926-8990-ff2d-4167-276ce417fc32@2ndquadrant.com> <492a8be0-ff55-3858-7dc1-62fa07d444c2@2ndquadrant.com> <6fbe425b-0b9b-0b3f-c5bb-5a5111514867@2ndquadrant.com> Message-ID: Date: Tue, 21 Nov 2017 13:44:36 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-MW List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11/20/2017 04:25 PM, I wrote: > I've been through this fairly closely, and I think it's pretty much > committable. The only big item that stands out for me is the issue of > OUT parameters. > > While returning multiple result sets will be a useful feature, it's also > very common in my experience for stored procedures to have scalar out > params as well. I'm not sure how we should go about providing for it, > but I think we need to be sure we're not closing any doors. > > Here, for example, is how the MySQL stored procedure feature works with > JDBC: > > I think it will be OK if we use cursors to return multiple result sets, > along the lines of Peter's next patch, but we shouldn't regard that as > the end of the story. Even if we don't provide for it in this go round > we should aim at eventually providing for stored procedure OUT params. > > > Of course it's true that we could replace a scalar OUT parameter with a one row resultset if we have return of multiple resultsets from SPs. But it's different from the common use pattern and a darn sight more cumbersome to use. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services