Euler Taveira <eu...@timbira.com.br> writes: > Em qua, 13 de fev de 2019 às 19:56, Andrew Gierth > <and...@tao11.riddles.org.uk> escreveu: >> 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. I won't take a position on whether it's okay to break backwards compatibility here (although I can think of some people who are likely to complain ;-)). But if we decide to do it, I like Euler's suggestion for how to do it. A separate --convert-to-text switch seems kind of ugly, plus if that's the approach it'd be hard to write scripts that work with different pg_restore versions. The idea of cross-version-compatible scripts suggests that we might consider back-patching the addition of "-f -", though not the change that says you must write it. regards, tom lane