Re: View of Union Multiple Tables - Only If table EXISTS

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Avi Weinberg <AviW(at)gilat(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: View of Union Multiple Tables - Only If table EXISTS
Date: 2021-07-25 14:06:27
Message-ID: CAKFQuwb4AbS7a8wXQY4u4kmbT5p5G5rozTWhydHNq2qjD5U+Rw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sunday, July 25, 2021, Avi Weinberg <AviW(at)gilat(dot)com> wrote:

>
> Is it possible to write the view syntax once and it will do some type of
> SELECT IF EXISTS.
>
>
>

Not with a virew. Dynamic SQL in a function can be used to build a query
at runtime that includes only tables that exist.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vijaykumar Jain 2021-07-25 15:47:25 Re: regarding sql password auth
Previous Message Avi Weinberg 2021-07-25 14:01:38 View of Union Multiple Tables - Only If table EXISTS