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 1h1ZH8-0003bg-12 for pgsql-general@arkaria.postgresql.org; Wed, 06 Mar 2019 16:20:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h1ZH6-0004Y4-Nc for pgsql-general@arkaria.postgresql.org; Wed, 06 Mar 2019 16:20:08 +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 1h1ZH6-0004Xx-Dd for pgsql-general@lists.postgresql.org; Wed, 06 Mar 2019 16:20:08 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1ZH2-00042Y-23 for pgsql-general@lists.postgresql.org; Wed, 06 Mar 2019 16:20:08 +0000 Received: by mail-pf1-x443.google.com with SMTP id q17so8986882pfh.10 for ; Wed, 06 Mar 2019 08:20:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=W3pmYeS8W8qRr7XOE2uJAOwXoVzM5/Cj0hFvPmNC9yo=; b=U3scQ4oNnEdyE5IIie8gbHPxaLHl1YsDExLAQPxLcuf05kxLYmr1MC2wvhNa4dGm+q M9dI6+S9RIb1NFq+2b8efPdKwVt9WMj68cHjHZ6EMSXqNMUKUwTrxwyLnlGZzmo6PYng aPBfb8h8e74KNg+82W1QbWv5MsyjHas7s9LqBKGy+hMFfHovftzCXUXwo5hXQFtPl0oZ j2E2v4QEAFqhJZS1/Sx81US6rfxx/gQyEF6FUmn9SlVaCRCsZlNPW7YArCfqkjkwjXTU eZzmTqBhEUETyRme/b9WgoQ6F6jO+xB/4TQBb5/uOQu2OHx88c8XpXHL6IIAqIloL75w 34mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=W3pmYeS8W8qRr7XOE2uJAOwXoVzM5/Cj0hFvPmNC9yo=; b=CTOsl8fXU2foX77WJegpzC/lVNPd1MzE/gITa6fQe4DT9tLlMC9HJbDDLLvl6Nr1/O ehAtfgmbvp+4QH9OHhflPbsBfNMGaRcNa2YOrKrC8IpEI7zD8Gj2y5OxZHH6AsLh32UG urglVBLdZEjHLhCqSrDOIN9msneuK/ifZMvReNsFjN6QDyFNQdl7+v6/99+UpIuzMf9Y QdJKoghro+keEsQsVLHQouRBNA5zz6KcBJ9pRUB1BHRuW+q8oLXyKTLKgJk7K2EoLdac ip52UsfBZ6oHy+DtvasqUog0gFqLNYvbab2+2sFttHTAdQRWrN6IhXzZgTTj/wgwJICS 84RQ== X-Gm-Message-State: APjAAAWqeNPfnFFeDrazVmB1OHmtNcgWJQnSuXf/+/RgfRwJCPgWOuIr waADN4fx0aIdJ9Eb2yVaVV0lqz5b9uE= X-Google-Smtp-Source: APXvYqxWVbrVk6qvNof2vtOPbjV/uVI9yQ9Ycx6hlJ5zMaMJYIc9bAEdYdTNLRcUsDNv4fmOBhGORw== X-Received: by 2002:a17:902:834b:: with SMTP id z11mr7827892pln.257.1551889201482; Wed, 06 Mar 2019 08:20:01 -0800 (PST) Received: from [192.168.1.71] (d207-6-152-227.bchsia.telus.net. [207.6.152.227]) by smtp.gmail.com with ESMTPSA id a1sm4000224pfn.26.2019.03.06.08.20.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 08:20:00 -0800 (PST) From: Rob Sargent Message-Id: <14E03299-EEAD-45F0-A2B6-BF12F7218962@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_B3EA8565-0571-4BB0-86B9-DB20BDBA3A7A" Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: query has no destination for result data Date: Wed, 6 Mar 2019 08:19:59 -0800 In-Reply-To: Cc: pgsql-general To: Adrian Klaver References: <56fdbfbb-c0ed-3aa0-3815-eef3545e5419@gmail.com> X-Mailer: Apple Mail (2.3445.102.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_B3EA8565-0571-4BB0-86B9-DB20BDBA3A7A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 6, 2019, at 7:41 AM, Adrian Klaver = wrote: >=20 > On 3/6/19 7:37 AM, Pavel Stehule wrote: >=20 >> or >> \sf+ functioname >=20 > Cool, I learned something new. >=20 >> Regards >> Pavel >=20 >=20 using \ef function 65 puts the cursor on the first line of the loop. So = a debugging statement got in the way! I don=E2=80=99t need the = variables set other than to keep track of what=E2=80=99s going on in the = loop. They=E2=80=99re gone now and so it the problem (and hopefully = I=E2=80=99ll correct my ways). Thank you all. raise notice '%: added % segments to imputed_pvalue_t', = clock_timestamp(), rcount; -- for segp in select s.id, s.firstmarker, s.lastmarker,=20 v.ipv, array_length(p.probands,1) as pbs, s.lastmarker - s.firstmarker as mks from segment s=20 join imputed_pvalue_t v on s.id =3D v.segment_id join probandset p on s.probandset_id =3D p.id join probandset_group_member m on p.id =3D m.member_id where s.markerset_id =3D mkset and m.group_id =3D pbsgid order by ipv, pbs, mks LOOP select imkr=3Dmin(ordinal), jmkr=3Dmax(ordinal) from mrkidx where = ordinal between segp.firstmarker and segp.lastmarker; raise notice 'seg % start=3D% i=3D% end=3D% j=3D%', segp.id, = segp.firstmarker, imkr, segp.lastmarker, jmkr; delete from mrkidx where ordinal between segp.firstmarker and = segp.lastmarker; get diagnostics rcount =3D ROW_COUNT; segsdone =3D segsdone + 1; if rcount > 0 then insert into collected values(segp.id, segp.ipv); totalinserts =3D totalinserts + rcount; if totalinserts =3D mkrcnt then -- really totalDELETES raise notice '%: no markers left on %th segment %', = clock_timestamp(), segsdone, segp.id; exit; end if; end if; end loop; > --=20 > Adrian Klaver > adrian.klaver@aklaver.com --Apple-Mail=_B3EA8565-0571-4BB0-86B9-DB20BDBA3A7A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Mar 6, 2019, at 7:41 AM, Adrian Klaver <adrian.klaver@aklaver.com> 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=E2=80=99t need the = variables set other than to keep track of what=E2=80=99s going on in the = loop. They=E2=80=99re gone now and so it the problem (and hopefully = I=E2=80=99ll correct my ways).
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 =3D v.segment_id
      =    join probandset p on s.probandset_id =3D p.id
      =    join probandset_group_member m on p.id =3D m.member_id
    where = s.markerset_id =3D mkset
          = and m.group_id =3D pbsgid
    order by ipv, pbs, = mks
  LOOP
    select = imkr=3Dmin(ordinal), jmkr=3Dmax(ordinal) from mrkidx where ordinal = between segp.firstmarker and segp.lastmarker;
  =   raise notice 'seg % start=3D% i=3D% end=3D% j=3D%', segp.id, segp.firstmarker, imkr, = segp.lastmarker, jmkr;
    delete from mrkidx where = ordinal between segp.firstmarker and segp.lastmarker;
  =   get diagnostics rcount =3D ROW_COUNT;
    = segsdone =3D segsdone + 1;
    if rcount > 0 = then
       insert into collected = values(segp.id, = segp.ipv);
       totalinserts =3D = totalinserts + rcount;
       if = totalinserts =3D mkrcnt then  -- really = totalDELETES
          raise notice = '%: no markers left on %th segment %', clock_timestamp(), segsdone, segp.id;
    =       exit;
       end = if;
    end if;
  end loop;


= --Apple-Mail=_B3EA8565-0571-4BB0-86B9-DB20BDBA3A7A--