Re: Lookup Primary Key of Foreign Server's Table - Mailing list pgsql-general

From David G. Johnston
Subject Re: Lookup Primary Key of Foreign Server's Table
Date
Msg-id CAKFQuwZOwKGWFM9ockGEfvVcNAfMpHhnLV9EpZ2he1m+otG=Ew@mail.gmail.com
Whole thread Raw
In response to Lookup Primary Key of Foreign Server's Table  (Chris Morris <chris@mysteryscience.com>)
Responses Re: Lookup Primary Key of Foreign Server's Table
List pgsql-general
On Tue, Oct 22, 2019 at 9:16 AM Chris Morris <chris@mysteryscience.com> wrote:
I'm looking for a system query that will lookup the primary key column on a fdw table. It's possible we need to declare that part of the foreign table's schema in the local (is that the right term?) database?

Here's the foreign table - I don't see anything showing a primary key, so my hunch is we need to declare it in the local schema?

=> \d sidecar_link.actions

I'm not seeing anything in the local FDW table definition that deals with PK/FK constraints so I'm led to believe that what you are asking is not possible.  Consider detailing what your goal is and not just your technical need.

Not really related question, but a curiosity: why does this table not show in the list of foreign tables?

I suspect for the same reason you added the schema prefix "sidecar_link" to the table name when you issued \d above.

=> \det
 List of foreign tables
 Schema | Table | Server
--------+-------+--------
(0 rows)


David J.

pgsql-general by date:

Previous
From: Chris Morris
Date:
Subject: Lookup Primary Key of Foreign Server's Table
Next
From: stan
Date:
Subject: An issue installing an extension