Re: BUG #16062: pg_restore using ssl certs

From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, somesh(dot)ng(at)gmail(dot)com
Subject: Re: BUG #16062: pg_restore using ssl certs
Date: 2019-10-17 08:17:05
Message-ID: CAE9k0PmEaS1E5--k8SxiG-k_fjGRbP7+LmaH6q6zU-EDA3MzYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

You need to use -d/--dbname= option to specify the SSL parameters with
pg_restore like shown below.

1) pg_restore -d "dbname=testdb host=127.0.0.1 port=5432
sslmode=verify-full sslkey=/tmp/certs/postgresql.key" pg.dump >
res.out

OR,

2) pg_restore --dbname="dbname=testdb host=127.0.0.1 port=5432
sslmode=verify-full sslkey=/tmp/certs/postgresql.key" pg.dump >
res.out

where pg.dump is the input file.

By the where is your input file ? -f is for the output file. Further,
you cannot use -d and -f options together.

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com

On Thu, Oct 17, 2019 at 12:42 PM PG Bug reporting form
<noreply(at)postgresql(dot)org> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference: 16062
> Logged by: Somesh ng
> Email address: somesh(dot)ng(at)gmail(dot)com
> PostgreSQL version: 10.0
> Operating system: Ubuntu
> Description:
>
> Can somebody help me in restoring postgres db using SSL certs. I tried in
> below way but it didn't work
>
> pg_restore "host=hostname user=username dbname=database_name
> sslcert=sslcert.crt sslkey=sslkey.key sslrootcert=sslroot.pem
> sslmode=verify-full" -f filename
> It gives the below error
>
> pg_restore: [archiver] could not open input file "host=hostname
> user=username dbname=database_name sslcert=sslcert.crt sslkey=sslkey.key
> sslrootcert=sslroot.pem sslmode=verify-full": No such file or directory
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Crevon Virgile 2019-10-17 09:23:10 RE: BUG #16026: default_tablespace in postgresql.conf is used instead of the database's default.
Previous Message PG Bug reporting form 2019-10-17 07:59:24 BUG #16063: Error retrieving data from the server: INTERNAL SERVER ERROR: string indices must be integers