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 1rzAej-002G4i-6v for pgsql-general@arkaria.postgresql.org; Tue, 23 Apr 2024 07:33:33 +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 1rzAef-0071b6-Q6 for pgsql-general@arkaria.postgresql.org; Tue, 23 Apr 2024 07:33:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rzAef-0071ax-DO for pgsql-general@lists.postgresql.org; Tue, 23 Apr 2024 07:33:29 +0000 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rzAeY-002TyN-Sy for pgsql-general@lists.postgresql.org; Tue, 23 Apr 2024 07:33:28 +0000 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-23333dddd8aso2922575fac.1 for ; Tue, 23 Apr 2024 00:33:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713857600; x=1714462400; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZzbO11yjg6mhCdBxXlVw0Fh6VtbeMQMjNNeHOg8gpKM=; b=dXN679duwAXxaNFhi9gIijjQ3T94SjZjRgJN8J7FZgouDYFG3oQh3mAuP6Be3icj+L imgssMUAtOnywATHWYhx3NDYnCXYPN8q6PT+KXjec6ccQtq5RHwRYQPRi0ylGm3FU0iN xd6DxJfyHUviiAmuoHADJHCEfpYjCqWPLQfljX6+cFRTojGo8PXkbxEwfqad6gfSSuY7 7FnRYJXXXhSmrIRuYbIpB4eVNUQtlVt9OZZnjNNtrVqkcbBNvYqAbzYYeGxQ5S1wlZrO Omqu8KLgIsyDK1UP3MVnddOis2dvRfy7uwBjC/p7p5WnaUxX+KX3E+ckSP3gGzLR6JCU SomA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713857600; x=1714462400; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZzbO11yjg6mhCdBxXlVw0Fh6VtbeMQMjNNeHOg8gpKM=; b=wuyI6WN3eA1UIf6qSoEU2U8SZss1OUXT2Lp4mJkPN1DhiemyVb9pjCLg0SCR5jCAFl a/9aq1G2If9mlE7jVIN5Y6+UrQYayEPELlklf+mGcszYsEmEeWO9tUEUi5eNFO81TDzq BgFRx6Wm+YFAbY7gZb3SYQa/ybSheapGr4NJVxgiCYEZqBKrxK/485zE2yGWnWZ4zjsx 0LnbggGLk/RQC6pW5xZIkpckIMNYF6CVlsXf1qsx8WLSZBZXt6VOUnLLPuwvV+T9GgsX l1dzUd1MzNxpr78kOVR3TVAeHr2gMOa1W4B9BKspKclpNJOmSZwPOYDSGyLfvw23qzbz C1Ew== X-Forwarded-Encrypted: i=1; AJvYcCWWD0pYLsG5rYewn/zaaFuw7A47pZi3yl+43KKmV6sqLfhi9MJ7+pxQ/5T0sH2BXeLYr65TwpDEuXihnGCJPCOgj/XEbmsZvoRkdJML+sgvAUzr X-Gm-Message-State: AOJu0YxsjsZ2d5W7kFRXTzQSYHpGjZWWDphPrEqY46CGsuWamLTjb27i CLTcSe4mX+b3288YUv0C8mi+5QtKNIWqeSjlK/xwjhAyrQjuT2nBz1VYiJxDG/WfDu5emlNo72U aHDAHMJYTwDqR3TsYFLw/pvg6zCE= X-Google-Smtp-Source: AGHT+IH1RGWlES5z1k11Lk940Y1iSVP+5GKGADYP0dy087LT67tIcNwuGW84toZqfRn8oOzS8NQo7b1aCigzxG4YpQA= X-Received: by 2002:a05:6870:164c:b0:239:52c9:b915 with SMTP id c12-20020a056870164c00b0023952c9b915mr12626906oae.18.1713857600327; Tue, 23 Apr 2024 00:33:20 -0700 (PDT) MIME-Version: 1.0 References: <30b10437-647c-48c9-8bd8-0f45b4af2d7b@erinors.com> <2857958.1713733916@sss.pgh.pa.us> In-Reply-To: <2857958.1713733916@sss.pgh.pa.us> From: Dominique Devienne Date: Tue, 23 Apr 2024 09:33:09 +0200 Message-ID: Subject: Re: query multiple schemas To: Tom Lane Cc: Steve Baldwin , =?UTF-8?Q?Norbert_S=C3=A1ndor?= , pgsql-general@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000769bd60616be914f" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000769bd60616be914f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Apr 21, 2024 at 11:12=E2=80=AFPM Tom Lane wrote= : > Steve Baldwin writes: > > If the number of tenant schemas is reasonably static, you could write a > > plpgsql function to create a set of UNION ALL views > > Another idea is to build a partitioned table > Hi Norbert. I asked a [similar question][1] a while back, and unfortunately didn't get any actionable input, perhaps because I already mentioned in my message the options proposed here so far. Seems like people like us, using a dynamic number of schemas, are outliers in database-land. In my case, the revision/version of the schema could be different as well, which would complicate the partitioning idea. In any case, I'm interested in what works well for you. And if/when I get back to this issue myself, I'll do the same. Thanks, --DD [1]: https://postgrespro.com/list/thread-id/2673517 --000000000000769bd60616be914f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Apr 21, 2024 at 11:12=E2=80=AFPM = Tom Lane <tgl@sss.pgh.pa.us>= wrote:
Steve Baldwin <steve.baldwin@gmail.com> writes:
> If the number of tenant schemas is reasonably static, you could write = a
> plpgsql function to create a set of UNION ALL views

Another idea is to build a partitioned table

Hi Norbert. I asked a [similar question][1] a while back,
a= nd unfortunately didn't get any actionable input, perhaps
bec= ause I already mentioned in my message the options
proposed here = so far. Seems like people like us, using a
dynamic number of sche= mas, are outliers in database-land.

In my case, th= e revision/version of the schema could be
different as well, whic= h would complicate the partitioning idea.

In any c= ase, I'm interested in what works well for you.
And if/when I= get back to this issue myself, I'll do the same.

<= div>Thanks, --DD

--000000000000769bd60616be914f--