Re: proposal: pg_restore --convert-to-text - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: proposal: pg_restore --convert-to-text
Date
Msg-id CAHE3wggPoiDi27TbA0DT4ns9YENzNkffV+Zc0XwHk6s9syKChg@mail.gmail.com
Whole thread Raw
In response to proposal: pg_restore --convert-to-text  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: proposal: pg_restore --convert-to-text  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: proposal: pg_restore --convert-to-text  (Andreas Karlsson <andreas@proxel.se>)
List pgsql-hackers
Em qua, 13 de fev de 2019 às 19:56, Andrew Gierth
<andrew@tao11.riddles.org.uk> escreveu:
> One of the remarkably common user errors with pg_restore is users
> leaving off the -d option. (We get cases of it regularly on the IRC
> channel, including one just now which prompted me to finally propose
> this)
>
I'm not sure it is a common error. If you want to restore schema
and/or data it is natural that I should specify the database name (or
at least PGDATABASE).

> I propose we add a new option: --convert-to-text or some such name, and
> then make pg_restore throw a usage error if neither -d nor the new
> option is given.
>
However, I agree that pg_restore to stdout if -d wasn't specified is
not a good default. The current behavior is the same as "-f -"
(however, pg_restore doesn't allow - meaning stdout). Isn't it the
case to error out if -d or -f wasn't specified? If we go to this road,
-f option should allow - (stdout) as parameter.

> (Yes, it will break the scripts of anyone who is currently scripting
> pg_restore to output SQL text. How many people do that?)
>
I use pg_restore to stdout a lot but I wouldn't bother to specify an
option to get it (such as pg_restore -Fc -f - /tmp/foo.dmp).


--
   Euler Taveira                                   Timbira -
http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Using POPCNT and other advanced bit manipulation instructions
Next
From: Michael Paquier
Date:
Subject: Re: Reaping Temp tables to avoid XID wraparound