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 1qLU8U-003Fs7-Nv for pgsql-sql@arkaria.postgresql.org; Mon, 17 Jul 2023 19:43:58 +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 1qLU8T-00EFWT-94 for pgsql-sql@arkaria.postgresql.org; Mon, 17 Jul 2023 19:43:57 +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 1qLU8T-00EFWL-0R for pgsql-sql@lists.postgresql.org; Mon, 17 Jul 2023 19:43:57 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qLU8P-000xXl-V5 for pgsql-sql@lists.postgresql.org; Mon, 17 Jul 2023 19:43:55 +0000 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-99313a34b2dso591943166b.1 for ; Mon, 17 Jul 2023 12:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689623032; x=1692215032; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ga5dBXbLBXuzzwnawcqExufBQfqN6j5S7lJ1n5QqnUA=; b=Lrav3QKdWw6uJ+P4r6+TrWDAWKtXx9yJJwxH/BEIWlYnKYtNpap4xdRh8of0cs7q7I Hn/QL8hSavMgeqXJmAc0WebIzvcL1LNu9w8cGRVjHIb0H7fubKFvJ+kt/NsOlLWKvoP2 JIAMLzGrJo8T5cGaepfsPB93iZlShntRsGgOvJAmMdx9xKFY6yBtn/FOnl8pGc5loYb4 BZ7hucsVsyhQEsb/R5FzXHNI5Y6JGMtzqFnc1KrZW2WeRqdcGC/1iKXIG35DrE3JEIgp 3z9oYVQqSxR29BQEYdDGSimQlnQ3Z4Xuh+kNr0OLPSUHL8LHsBQqYLiczYNicqEcKge4 tw1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689623032; x=1692215032; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ga5dBXbLBXuzzwnawcqExufBQfqN6j5S7lJ1n5QqnUA=; b=XSEBnbz6p9dWPP711Ilavl4fH33Sea7kqn51zTORXGIQ2Xsk7DvJwIsnmenz8aYBGJ 57p7MM1edoR9mgoSiddz6kkLFSK5AFT4PZIoj7wOJtxuwn1zCIS9WCJbZBSCdaF+zFjG ImbY5fdjgy3iCMN8V+oeISUdiB9hMWyHnJM9FucFzfbXAxyygbXFFJEmoZYOtaICkOJB /kCHmuQFXNRLCEnp5Y0XAhbxTaz4qvkb0feeoYQe5+VV5SAfIGWOt3JAsSdfP3cUchW+ 5+uigevgb+ICQpfMzslWXORDyalPZ78GZMNyMflT7HtglqD9/d+GSZ02hFLZfzUw1OmT dH9A== X-Gm-Message-State: ABy/qLYSRt9E/zfgH9yLIRtvj/P5qngD2CLtiSklihzAHhRdv8Sdwkem hBNa00ou7szgNJTW4+dfECSsp5TdazMpLfRJMHE= X-Google-Smtp-Source: APBJJlF8iax5VvXCsJ3LNbKmyqdVl7G61+i5SFRxPPAHPYH0NS/SMcQ1bLSo3HBwyRiph/RqyNhd7y0qkecbPiKCa5A= X-Received: by 2002:a17:907:7e95:b0:98e:18ea:442c with SMTP id qb21-20020a1709077e9500b0098e18ea442cmr15340639ejc.45.1689623032051; Mon, 17 Jul 2023 12:43:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a17:907:1c0f:b0:992:6de4:aed9 with HTTP; Mon, 17 Jul 2023 12:43:51 -0700 (PDT) In-Reply-To: References: From: Shaozhong SHI Date: Mon, 17 Jul 2023 20:43:51 +0100 Message-ID: Subject: Re: Multiple sets of results from recursive query To: Erik Brandsberg Cc: Greg Sabino Mullane , pgsql-sql Content-Type: multipart/alternative; boundary="000000000000a159dc0600b4048f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000a159dc0600b4048f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Monday, 17 July 2023, Erik Brandsberg wrote: > A quick google provides content that may help: https://www.sisense. > com/blog/postgres-recursive-cte/ > > The issue is that you aren't asking a specific question with a well > defined answer. Provide examples of your data and what you are trying to > achieve for the best results in a forum like this. > > On Mon, Jul 17, 2023 at 3:22=E2=80=AFPM Shaozhong SHI > wrote: > >> >> >> On Monday, 17 July 2023, Greg Sabino Mullane wrote: >> >>> What exact problem are you trying to solve? Recursive CTEs return one >>> row per internal invocation, so they already return a "set" of results,= but >>> you could use arrays or json if you wanted to pack in extra information= per >>> returned row. >>> >>> On Sun, Jul 16, 2023 at 6:41=E2=80=AFAM Shaozhong SHI >>> wrote: >>> >>>> Has anyone come across multiple sets of results with recursive query? >>>> >>>> How to handle it=EF=BC=9F >>>> >>> >> Surely=EF=BC=8C there must be possible to find all route paths. >> >> Regards, David >> > This one falls short of explaining possible other routes in network. http://blog.cleverelephant.ca/2010/07/network-walking-in-postgis.html Regards, David --000000000000a159dc0600b4048f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Monday, 17 July 2023, Erik Brandsberg <erik@heimdalldata.com> wrote:
A quick google provides co= ntent that may help:=C2=A0=C2=A0https://www.sisense.com/blog/p= ostgres-recursive-cte/

The is= sue is that you aren't asking a specific question=C2=A0with a well defi= ned answer.=C2=A0 Provide examples of your data and what you are trying to = achieve for the best results in a forum like this.=C2=A0=C2=A0
<= br>
On Mon,= Jul 17, 2023 at 3:22=E2=80=AFPM Shaozhong SHI <shishaozhong@gmail.com> wrote:


On Monday= , 17 July 2023, Greg Sabino Mullane <htamfids@gmail.com> wrote:
What exact problem are yo= u trying to solve? Recursive CTEs return one row=C2=A0per internal invocati= on, so they already return a "set" of results, but you could use = arrays or json if you wanted to pack in extra information per returned row.=

= On Sun, Jul 16, 2023 at 6:41=E2=80=AFAM Shaozhong SHI <shishaozhong@gmail.com> w= rote:
Has anyone come across multiple sets of results with recursive que= ry?

How to handle it=EF=BC=9F

Surely=EF=BC=8C there must be possible= to find all route paths.

Regards, David=C2=A0

This one falls short = of explaining possible other routes in network.
=

Regards, David
--000000000000a159dc0600b4048f--