Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1bIL-0006iM-Gi for pgsql-general@arkaria.postgresql.org; Wed, 06 Mar 2019 18:29:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1bIK-0006vd-7R for pgsql-general@arkaria.postgresql.org; Wed, 06 Mar 2019 18:29:32 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1bIJ-0006s8-36 for pgsql-general@lists.postgresql.org; Wed, 06 Mar 2019 18:29:31 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1bIA-0000uh-NG for pgsql-general@lists.postgresql.org; Wed, 06 Mar 2019 18:29:30 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3F3182594C; Wed, 6 Mar 2019 13:29:21 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 06 Mar 2019 13:29:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=y jyjO53CmIDchgG8x/YeV6s66lxXu2681VkiyER6e9Q=; b=Od3Fo5Aig0zxot6qp xIpICPOvkNWIbTzjGVHTIqowxB2BvAaVLNBQTY11sCo2EWKyAGV9m8R/aeOd0i8V ovkS3JlwWqFziaBYRM3cAYQ6Z+NZN3+9VaVLPJ9XoV6z2+bHukyHgyxt3DHTJ30s N6lY8EYD1gHQKiMZrmX5EGT55tv4BKd/mXA7myWC0B/5axx8OOltWG6yRgXZh1fK X2MX3yaOIVVnvA9Gtv8QBPlCVHMFfgNmzdS9SMZbQLOT3tU+0ZGAEV/xLX6/iKEU YSj1olzSe/vIuwCQd6jiZjWaaDGZoykGCLMqpbqMoeM399uhLFPfWtMihZOspJY1 LW9UQ== 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=yjyjO53CmIDchgG8x/YeV6s66lxXu2681VkiyER6e 9Q=; b=Mi25XSkbK4ui4e0FSnPa046ZL1UDeUldqqfGrIg11Dk5b8GyfsBulUXYG VfBo2UL8mNQrGtifAcRUZ7aevrKaH3xpXG/CfbVGD893tKfiYs8p03RBz7htI3DK 6lOu3SibNEt5zkCl8WhzD8pJPv5tZVCM+Mz7yBPrrI0sr0ChnT6ud4Aol0Zk8jLy dumV2KHNlVFUk/HOFvmR84yp/atj9LgCPDtwYNmibWX7yg/bXQiDhWFxNkEWAJ5p j18XUjpTb/Q8/8cq2bNCzLsDKigQ3wTfpPrdCwBsZm7rB528GpVkY+vnEnW1Vwff Ax028cjxndYb3Gwz5J+tH9O34z5zA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrfeeigdehfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenog fuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefuvfhfhffkffgfgggjtgfg sehtkeertddtfeejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirg hnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehsrdhiugdp phdrihgupdhpohhsthhgrhgvshhqlhdrohhrghdpshgvghhprdhiugenucfkphephedtrd duleejrdektddrvdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgr vhgvrhesrghklhgrvhgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from ranger.suse (50-197-80-2-static.hfc.comcastbusiness.net [50.197.80.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 4DB9EE44A5; Wed, 6 Mar 2019 13:29:20 -0500 (EST) Subject: Re: query has no destination for result data To: Rob Sargent Cc: pgsql-general References: <56fdbfbb-c0ed-3aa0-3815-eef3545e5419@gmail.com> <14E03299-EEAD-45F0-A2B6-BF12F7218962@gmail.com> From: Adrian Klaver Message-ID: <2c864cf1-97d6-e3ec-4928-24958da27e94@aklaver.com> Date: Wed, 6 Mar 2019 10:29:18 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <14E03299-EEAD-45F0-A2B6-BF12F7218962@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 3/6/19 8:19 AM, Rob Sargent wrote: > > >> On Mar 6, 2019, at 7:41 AM, Adrian Klaver > > wrote: >> >> On 3/6/19 7:37 AM, Pavel Stehule wrote: >> >>> or >>> \sf+ functioname >> >> Cool, I learned something new. >> >>> Regards >>> Pavel >> >> > > using \ef function 65 puts the cursor on the first line of the loop. So > a debugging statement got in the way!  I don’t need the variables set > other than to keep track of what’s going on in the loop. They’re gone > now and so it the problem (and hopefully I’ll correct my ways). Where you maybe needing SELECT INTO?: https://www.postgresql.org/docs/10/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW So something like(not tested): select min(ordinal), max(ordinal) into imkr, jmkr from mrkidx where ordinal between segp.firstmarker and segp.lastmarker; > Thank you all. > >   raise notice '%: added % segments to imputed_pvalue_t', > clock_timestamp(), rcount; > -- >   for segp in >     select s.id , s.firstmarker, s.lastmarker, >            v.ipv, >            array_length(p.probands,1) as pbs, >            s.lastmarker - s.firstmarker as mks >     from segment s >          join imputed_pvalue_t v on s.id = v.segment_id >          join probandset p on s.probandset_id = p.id >          join probandset_group_member m on p.id = > m.member_id >     where s.markerset_id = mkset >           and m.group_id = pbsgid >     order by ipv, pbs, mks >   LOOP > _select imkr=min(ordinal), jmkr=max(ordinal) from mrkidx where > ordinal between segp.firstmarker and segp.lastmarker;_ >     raise notice 'seg % start=% i=% end=% j=%', segp.id > , segp.firstmarker, imkr, segp.lastmarker, jmkr; >     delete from mrkidx where ordinal between segp.firstmarker and > segp.lastmarker; >     get diagnostics rcount = ROW_COUNT; >     segsdone = segsdone + 1; >     if rcount > 0 then >        insert into collected values(segp.id , > segp.ipv); >        totalinserts = totalinserts + rcount; >        if totalinserts = mkrcnt then  -- really totalDELETES >           raise notice '%: no markers left on %th segment %', > clock_timestamp(), segsdone, segp.id ; >           exit; >        end if; >     end if; >   end loop; > >> -- >> Adrian Klaver >> adrian.klaver@aklaver.com > -- Adrian Klaver adrian.klaver@aklaver.com