Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sn0cG-000MUF-Bs for pgsql-docs@arkaria.postgresql.org; Sat, 07 Sep 2024 18:57:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sn0cF-002o0Y-Ul for pgsql-docs@arkaria.postgresql.org; Sat, 07 Sep 2024 18:56:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sn0cF-002o0J-LN for pgsql-docs@lists.postgresql.org; Sat, 07 Sep 2024 18:56:59 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sn0cC-0001sS-A1 for pgsql-docs@lists.postgresql.org; Sat, 07 Sep 2024 18:56:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=online.de; s=s42582890; t=1725735413; x=1726340213; i=ch.l.ngre@online.de; bh=IoGKzBPbhMA+q9P/mJdVZxVegNOC12N/Qy9ebVUXwe4=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=Lmq4XETCxxmYY00InSd9am5QMmjxCXhN1RHzEkrkdz2YDk5pTZpknQoyhP3K1SQg +TsgahdaQsy0bKNNxqn+6HuynjV4Sdl0OqbVXUw9nHymr1HiWkrXt8jus7ezoZPQL B+qlV7OLmbb2TFNVpd+reSMtsfNL++ntnnnpZfYcUqFSSke1vBk4HSBZA1bd72iVE A0wE9aMtaAlCAPIoam4WegqcDjFb2T4RqTKmoWW9qq9b12XHYrLsV0PCc0KiC++Tg 305/HWqZ0+pyZzzeHOYP0OB1SNqlFqqfgusVeNzObQJeScjzb5OE/iAmephM9IUNm V0xLA5+wHAPUthSHVw== X-UI-Sender-Class: 6003b46c-3fee-4677-9b8b-2b628d989298 Received: from [192.168.178.33] ([89.245.229.106]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MzTCy-1rrlBt2TUe-00yUMU; Sat, 07 Sep 2024 20:56:53 +0200 Message-ID: <9823c60f-a482-4751-a94f-e14c29fe49d0@online.de> Date: Sat, 7 Sep 2024 20:57:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: retrieving results of procedures with OUT params To: "David G. Johnston" , "pgsql-docs@lists.postgresql.org" References: <172527216699.692.9900337638245208778@wrigleys.postgresql.org> From: "ch.l.ngre" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:e5VAiJOfHO4ig0pidehxsObPRPrudRsoTbfiWHmLj81VhCTTzbZ mNj6Y9Np7TkNTd3cdK39iRIIlDsXSyc8lOrmt8AVl+zS2kLC+/BqmOe3mLZTkmejiE5gtAj nAYO8ia8Al2EDsY2bVUEPXarsbteuVF5Le9faLHG5rBUOIiNfltT1uwMOmP6anFcPR3q1jy Ige6nWUZ7rUhhMg711WhA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:mI/Td4aOsbw=;uRLfZiP1Du9E6HB33lJcN1lg93u 13xG85xoY19JvIlfz9MkCPehNblOA0ZjsMDho9OujK3RCx1SPLLsk8HRl/GBwhiC1PQQBfZ5E CEBPDHE78xx0vQCPT73etAMj7Ght56wAmZuk0lA/hGSlCs67AnipnUJ1HT6rZPjqqbP1B9wD+ TlCjlw/PYNvtSRtF6FHxJcb8qqM+A3oPIIa9vgPKrH54mEYmAbF2mdPcQcMY0Zbw/GVePZP39 yVgRAUGaazeUVEyxJc6Hv8JB+SAXEtPcel26qmNDnMDYiZDEGSMzx9ly7NA/kMBHQiNcTnQhq DW1Uis5ItYrvSF4i+ZpzjOdyOsj3ySQO/HkQ4caGwulNajKRI1dt9fFxGw/Hq2wxI0C9Mcuyi UZXxnjzqMsSrpSJW9bnioybhefJ8Zuxo/AhNq+Nt68YzW20ex2fRwW5Qk7sd8HYk24+YXBBKk SH4Vu8NRnZpFXIlnOdx6tj67vrpgJnf5wvl+EHnSH+k530zMCxdT/UGPwJ6DOd3McDEk9E9BY BOaLNkYoAaCvCmTsNBG2fvPn4PxHgvS09Gmo7kf7QAD33C3beOi9KQpTflL/o7QBhhnDp1n5n /iyYCxtaWo+D+CttWTPgSXPdxUddbuPy2MZMDOm4zpzCg0BddSkruEV+Ylu9SRrsAnExpco/S ami9fIqVnaudZaHLukiE+J34kkG/7mhM4l3Z+/h6/bCpII4uXhGgCGE1IQwONp/pA7nNaOIZh lDLwHOhB0U8JiqHlVRihLIY9uZOxDd+Vw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Am 07.09.2024 um 18:35 schrieb David G. Johnston: > On Monday, September 2, 2024, PG Doc comments form > > wrote: > > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/16/libpq-exec.html > > Description: > > https://www.postgresql.org/docs/16/libpq-exec.html#LIBPQ-PQRESULTSTA= TUS > Existing text: > If the result status is PGRES_TUPLES_OK, PGRES_SINGLE_TUPLE, or > PGRES_TUPLES_CHUNK, then the functions described below can be used t= o > retrieve the rows returned by the query. Note that a SELECT command = that > happens to retrieve zero rows still shows PGRES_TUPLES_OK. > PGRES_COMMAND_OK > is for commands that can never return rows (INSERT or UPDATE without= a > RETURNING clause, etc.). A response of PGRES_EMPTY_QUERY might > indicate a > bug in the client software. > Add: > A successful call to a procedure with OUT parameters will set > PGRES_TUPLES_OK and return one row with the functions described belo= w. > > > Defining whether a given SQL query is or is not going to return tuples > is not the responsibility of this paragraph.=C2=A0 The documentation for= CALL > is where this knowledge is imparted.=C2=A0 I=E2=80=99m not hard set agai= nst adding > something here but it also doesn=E2=80=99t really seem like a need. > > If I were to do something I=E2=80=99d probably add =E2=80=9Cor a CALL of= a procedure > lacking OUT parameters, etc=E2=80=9D as another example in the parenthet= ical > talking about an omitted returning clause. > > David J. > You are right, the documentation for CALL states that a row is being returned. However if you read https://www.postgresql.org/docs/current/xproc.html#XPROC 'Procedures do not return a function value; hence CREATE PROCEDURE lacks a RETURNS clause. However, procedures can instead return data to their callers via output parameters' this does not sound like a row being returned. Also plpgsql does not do it when you invoke CALL. The libpq documentation does not mention CALL of a stored procedure with out params at all. Maybe it should, - somewhere. Christoph