Re: Attaching database

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Igor Korot <ikorot01(at)gmail(dot)com>
Cc: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Attaching database
Date: 2022-10-15 04:39:09
Message-ID: CAKFQuwZwLYD1LmBjNUXDDHMyb_4YD+sqQpBzfUu=gsVoqrrPcA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 14, 2022 at 9:17 PM Igor Korot <ikorot01(at)gmail(dot)com> wrote:

> Hi, guys,
>
> On Sun, Oct 25, 2020 at 1:27 PM Peter J. Holzer <hjp-pgsql(at)hjp(dot)at> wrote:
> >
> > On 2020-10-19 20:21:05 +0200, Pavel Stehule wrote:
>
> > In case this isn't clear:
> >
> > It is the server (or more specifically, the foreign data wrapper) which
> > opens that connection. To the client it looks like it's just accessing a
> > normal table within the same database.
>
> Sorry for resurrecting this old thread...
>

Then why did you do it? You couldn't send a new email without copying
possibly no longer interested people and with better thought out
self-contained content that simply notes you are somehow using an FDW.

> If an attaching the DB creates new connection which will be cmpletely
> independent - how the INFORMATION_SCHEMA(dot)table(at)table_catalog
> field is handled.
>
> Lets say I open connection to the DB (finance) and then attached another DB
> (finance_2021).
>
> So, when I call SELECT table_schema, table_name FROM
> INFORMATION_SCHEMA.table
>

Call this how exactly? There are three information_schema instances that
you can be talking about, though only the one in the local database is
going to be called that. If you are dealing with FDWs you would have to
have different names involved.

> I will get all tables from (finance) DB only.
> And to get all tables from (finance_2021) I need to make this catalog
> current
> and reissue the query.
>
> Am I right?
>

Do it and find out? Then if still confused, show what you attempted. But
I don't know what this concept of "make the catalog current" you speak of
comes from. That isn't a thing that I am aware of. Where do you see this
documented?

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2022-10-15 04:46:48 Re: Attaching database
Previous Message Igor Korot 2022-10-15 04:16:44 Re: Attaching database