pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Moreno Andreo <moreno.andreo@evolu-s.it>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: PostgreSQL mailing lists <pgsql-general@postgresql.org>
Subject: Re: Debian : No echo after pg_dump | psql
Date: Wed, 12 Dec 2018 06:41:41 -0800
Message-ID: <eb7440fb-cb43-dd9c-6edf-96029e346cf4@aklaver.com> (raw)
In-Reply-To: <82322725-21f3-2027-5533-808e604208ab@evolu-s.it>
References: <690144ed-bfb2-e06e-2aba-4d8e9e99edaf@evolu-s.it>
	<87ftvjmd8m.fsf@news-spur.riddles.org.uk>
	<82322725-21f3-2027-5533-808e604208ab@evolu-s.it>

On 12/12/18 4:51 AM, Moreno Andreo wrote:
> Adrian, Andrew, thanks and apologies for the late reply
> 
> Il 30/11/2018 05:08, Andrew Gierth ha scritto:
>>>>>>> "Moreno" == Moreno Andreo <moreno.andreo@evolu-s.it> writes:
>>   Moreno> The command I'm using is
>>   Moreno> root@xxxxx:~# pg_dump -v -C -h <remote host> -p 6543 -U 
>> postgres
>>   Moreno> <dbname> | psql -h localhost -p 6543 -U postgres <dbname>
>>   Moreno> It presents a double password prompt after I run it:
>>   Moreno> Password: Password for user postgres:
>>
>> This is going to prompt once for the remote host's password and twice
>> for the local one (because -C), and the concurrently-running commands
>> are going to be fighting over access to the terminal to do it. Best
>> avoided by using pgpass or non-password-based auth methods.
>>
>> More seriously, you're misunderstanding how -C works. When you use -C,
>> the database you specify to psql (or pg_restore) is NOT the database
>> you're restoring into - the restored db will ALWAYS have the same name
>> as it had when dumped (if that's not what you want then don't use -C).
>> Instead, the database you specify to psql or pg_restore is the database
>> to connect to to issue the CREATE DATABASE command, which should usually
>> be 'postgres'. That explains this bit:
>>
>>   Moreno> If I create database (just database, not schema) on target
>>   Moreno> machine, I receive the error "database xxxx already exists" but
>>   Moreno> the dump goes on If I don't create it, I receive the error
>>   Moreno> "database xxxx does not exist" and processing aborts.
>>
> I removed -C usage since the target database (the database itself, not 
> the schema) is created with a CREATE DATABASE before issuing pg_dump (so 
> I don't need it), but strange prompt behavior remained the same
> 
> I'm having a really hard time these days, so I can't investigate 
> further. Maybe on holidays, when I hope the pressure will be released a 
> bit.

Understood.
> 
> Will report as soon as I can.
> 
> THanks again
> 
> Cheers,
> 
> Moreno.-
> 
> 
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (5+ messages)

Message-ID: <eb7440fb-cb43-dd9c-6edf-96029e346cf4@aklaver.com>
Permalink:  ../eb7440fb-cb43-dd9c-6edf-96029e346cf4@aklaver.com/
Also on:    postgresql.org/message-id/eb7440fb-cb43-dd9c-6edf-96029e346cf4@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, moreno.andreo@evolu-s.it, andrew@tao11.riddles.org.uk
  Subject: Re: Debian : No echo after pg_dump | psql
  In-Reply-To: <eb7440fb-cb43-dd9c-6edf-96029e346cf4@aklaver.com>
  References: <690144ed-bfb2-e06e-2aba-4d8e9e99edaf@evolu-s.it> <87ftvjmd8m.fsf@news-spur.riddles.org.uk> <82322725-21f3-2027-5533-808e604208ab@evolu-s.it> <eb7440fb-cb43-dd9c-6edf-96029e346cf4@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