Foreign table feedback

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Foreign table feedback
Дата
Msg-id CAA-aLv48CWZH03u0qfF0=TNhJtKkcdQXmppMt2-Tu62XV9k2=Q@mail.gmail.com
обсуждение исходный текст
Ответы Re: Foreign table feedback  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi all,

Is there a way to ensure we don't end up with a foreign table feedback loop?

For example:

CREATE SERVER pgserver FOREIGN DATA WRAPPER postgres_fdw OPTIONS (dbname 'postgres');

-- note how I've forgotten to specify host or port

CREATE USER MAPPING FOR PUBLIC SERVER pgserver;

CREATE FOREIGN TABLE test (id int) SERVER pgserver;

postgres=# SELECT * FROM test;
FATAL:  sorry, too many clients already
ERROR:  could not connect to server "pgserver"
DETAIL:  FATAL:  sorry, too many clients already
STATEMENT:  DECLARE c1 CURSOR FOR
SELECT id FROM public.test
ERROR:  could not connect to server "pgserver"
DETAIL:  FATAL:  sorry, too many clients already
CONTEXT:  Remote SQL command: SELECT id FROM public.test
STATEMENT:  FETCH 100 FROM c1
ERROR:  could not connect to server "pgserver"
DETAIL:  FATAL:  sorry, too many clients already
...

This of course carries on until there's 100 lines in the CONTEXT
message, and all connections, which remain in use after the error.

Of course the same issue happens if you try to create a foreign table
to another foreign table on another server, which points back to the
one you're creating.
--
Thom



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Statistics and selectivity estimation for ranges
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Foreign table feedback