pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Lukáš Sobotka <sobotka.luk@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: Foreign table & Connection reset by peer
Date: Sat, 23 Feb 2019 13:48:41 -0800
Message-ID: <067feae0-b0e6-1ba1-f744-3f294ffae2e2@aklaver.com> (raw)
In-Reply-To: <CAJif3kJFf_tWg=82jdYVmp-QyZCQTXLjeuT7a-oeU3xW0PLZAg@mail.gmail.com>
References: <CAJif3kJFf_tWg=82jdYVmp-QyZCQTXLjeuT7a-oeU3xW0PLZAg@mail.gmail.com>

On 2/23/19 1:28 PM, Lukáš Sobotka wrote:
> Hi guys,
> 
> I would be grateful for some advice about foreign tables. I attached 
> simplified script describing the problem for better understanding.
> 
> What I am trying to do:
> 
> I am copying tables between two databases and for copying is used 
> function which are called from bash script.
> 
> What is problem:
> 
> I am creating foreign tables, selecting from them, dropping them and 
> everything works well. But always when I am working with them and the 
> session ends, message about connection resetting appears in log file of 
> remote database. It is showing "postgres@adam_db LOG:  could not receive 
> data from client: Connection reset by peer". I am calling the command 
> often, so this message fill my log file quite a fast. I tried to find 
> some info about this message, without success.
> 
> Where can be problem?

See if the thread below applies:

https://www.postgresql.org/message-id/4004.1521759312%40sss.pgh.pa.us

> 
> Is there some different/correct way how to use foreign tables?
> How can I closed connection properly?
> 
> For reproducing you can use attached script and after that execute next 
> command:
> /psql -c 'SELECT * FROM ft_numbers' 
> "postgresql://localhost:5432/bety_db?user=postgres&password=postgres"/
> 
> I also tried to drop server after selection but it also logs the 
> message. Command which I executed:/
> psql -c 'SELECT * FROM ft_numbers; DROP SERVER adam_server CASCADE;' 
> "postgresql://localhost:5432/bety_db?user=postgres&password=postgres"/
> 
> I tried to replicate problem in databases with different versions - all 
> of them ended with the message in log.Used versions:
> 
>   * PostgreSQL 9.6.10 on x86_64-pc-linux-gnu (Ubuntu
>     9.6.10-1.pgdg16.04+1), compiled by gcc (Ubuntu
>     5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609, 64-bit
>   * PostgreSQL 10.5 (Ubuntu 10.5-1.pgdg16.04+1) on x86_64-pc-linux-gnu,
>     compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609, 64-bit
>   * PostgreSQL 11.2 (Ubuntu 11.2-1.pgdg16.04+1) on x86_64-pc-linux-gnu,
>     compiled by gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609, 64-bit
> 
> Best regards,
> 
> Lukas
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (4+ messages)  latest in thread

Message-ID: <067feae0-b0e6-1ba1-f744-3f294ffae2e2@aklaver.com>
Permalink:  ../067feae0-b0e6-1ba1-f744-3f294ffae2e2@aklaver.com/
Also on:    postgresql.org/message-id/067feae0-b0e6-1ba1-f744-3f294ffae2e2@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, sobotka.luk@gmail.com
  Subject: Re: Foreign table & Connection reset by peer
  In-Reply-To: <067feae0-b0e6-1ba1-f744-3f294ffae2e2@aklaver.com>
  References: <CAJif3kJFf_tWg=82jdYVmp-QyZCQTXLjeuT7a-oeU3xW0PLZAg@mail.gmail.com> <067feae0-b0e6-1ba1-f744-3f294ffae2e2@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox