Обсуждение: [ADMIN] Postgresql FDW - some difference between remote and target table structure

Поиск
Список
Период
Сортировка

[ADMIN] Postgresql FDW - some difference between remote and target table structure

От
Günce Kaya
Дата:
Hi all,

We use FDW for some schemas and tables but I realised that a foreign table's columns in FDW server and same table's columns in target database(I said target db cause I'm not sure correct name for it) doesn't match. For instance; in FDW server, I select that table and I can see XXX column, however when I select same table and I can not see same column in target database. 

I check this table type in information_schema.tables and type of this table is foreign table in . 

Why there is some difference between FDW and target database? Is there anyone who can explain it?

Regards,
Gunce Kaya

Re: [ADMIN] Postgresql FDW - some difference between remote and target table structure

От
Tom Lane
Дата:
Günce Kaya <guncekaya14@gmail.com> writes:
> Why there is some difference between FDW and target database? Is there
> anyone who can explain it?

Either the foreign table was created without that column to begin with,
or the column was added to the remote table later and the foreign table
wasn't updated to match.  Foreign tables don't magically track what is
on the remote server; they just have the set of columns you told the
local server they should have.
        regards, tom lane


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Re: [ADMIN] Postgresql FDW - some difference between remote andtarget table structure

От
Günce Kaya
Дата:
Hello Tom,

I appreciate to your response. It’s clear now to me. 

Regards,
Gunce 


On 5 Oct 2017 Thu at 16:55 Tom Lane <tgl@sss.pgh.pa.us> wrote:
Günce Kaya <guncekaya14@gmail.com> writes:
> Why there is some difference between FDW and target database? Is there
> anyone who can explain it?

Either the foreign table was created without that column to begin with,
or the column was added to the remote table later and the foreign table
wasn't updated to match.  Foreign tables don't magically track what is
on the remote server; they just have the set of columns you told the
local server they should have.

                        regards, tom lane
--
Gunce Kaya