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

From Chris Morris
Subject Lookup Primary Key of Foreign Server's Table
Date
Msg-id CALrUc2Whpei56aLFj2T=d9Y6+jgZwPF0j8C5BDFx7TV61pzBcg@mail.gmail.com
Whole thread Raw
Responses Re: Lookup Primary Key of Foreign Server's Table
List pgsql-general
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
                                                 Foreign table "sidecar_link.actions"
     Column      |            Type             | Collation | Nullable |                     Default                      | FDW options
-----------------+-----------------------------+-----------+----------+--------------------------------------------------+-------------
 id              | bigint                      |           | not null | nextval('sidecar_link.actions_id_seq'::regclass) |
 user_session_id | bigint                      |           | not null |                                                  |
 user_id         | bigint                      |           | not null |                                                  |
 created_at      | timestamp without time zone |           | not null | now()                                            |
 occurred_at     | timestamp without time zone |           | not null | now()                                            |
 thing_id        | integer                     |           |          |                                                  |
 parent_thing_id | integer                     |           |          |                                                  |
 viewing_id      | integer                     |           |          |                                                  |
 origin          | origin                      |           |          | 'mysteryscience'::origin                         |
 scope           | text                        |           | not null |                                                  |
 name            | text                        |           | not null |                                                  |
 details         | text                        |           |          |                                                  |
 request_path    | text                        |           |          |                                                  |
Server: pg_mysterysci_sidecar
FDW options: (schema_name 'public', table_name 'actions')

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

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

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: existing dblinks
Next
From: "David G. Johnston"
Date:
Subject: Re: Lookup Primary Key of Foreign Server's Table