mirror of
https://github.com/postgres/postgres.git
synced 2025-10-16 17:07:43 +03:00
pg_restore: Require "-f -" to mean stdout
The previous convention that stdout was selected by default when nothing is specified was just too error-prone. After a suggestion from Andrew Gierth. Author: Euler Taveira Reviewed-by: Yoshikazu Imai, José Arthur Benetasso Villanova Discussion: https://postgr.es/m/87sgwrmhdv.fsf@news-spur.riddles.org.uk
This commit is contained in:
@@ -1512,7 +1512,12 @@ SetOutput(ArchiveHandle *AH, const char *filename, int compression)
|
||||
int fn;
|
||||
|
||||
if (filename)
|
||||
fn = -1;
|
||||
{
|
||||
if (strcmp(filename, "-") == 0)
|
||||
fn = fileno(stdout);
|
||||
else
|
||||
fn = -1;
|
||||
}
|
||||
else if (AH->FH)
|
||||
fn = fileno(AH->FH);
|
||||
else if (AH->fSpec)
|
||||
|
Reference in New Issue
Block a user