The previous commit was intended to make psql show the full path name when
doing a \s (history save), but it was very badly implemented and would show
confusing if not outright wrong information in many situations; for
instance if the path name given to \s is absolute, or if \cd commands
involving relative paths have been issued.  Consensus seems to be that
we don't especially need this functionality in \s, and certainly not in \s
alone.  So revert rather than trying to fix it up.  Per gripe from
Ian Barwick.

Although the bogus behavior exists in all supported versions, I'm not
back-patching, because the work created for translators (by change of
a translatable message) would probably outweigh the value of what is
after all a mostly-cosmetic change.
This commit is contained in:
Tom Lane 2013-11-05 17:51:58 -05:00
parent 2636ecf78b
commit d4e6133c68
2 changed files with 1 additions and 9 deletions

View File

@ -289,11 +289,6 @@ exec_command(const char *cmd,
success = false;
}
if (pset.dirname)
free(pset.dirname);
pset.dirname = pg_strdup(dir);
canonicalize_path(pset.dirname);
if (opt)
free(opt);
}
@ -1102,8 +1097,7 @@ exec_command(const char *cmd,
/* This scrolls off the screen when using /dev/tty */
success = saveHistory(fname ? fname : DEVTTY, -1, false, false);
if (success && !pset.quiet && fname)
printf(gettext("Wrote history to file \"%s/%s\".\n"),
pset.dirname ? pset.dirname : ".", fname);
printf(_("Wrote history to file \"%s\".\n"), fname);
if (!fname)
putchar('\n');
free(fname);

View File

@ -84,8 +84,6 @@ typedef struct _psqlSettings
int sversion; /* backend server version */
const char *progname; /* in case you renamed psql */
char *inputfile; /* file being currently processed, if any */
char *dirname; /* current directory for \s display */
uint64 lineno; /* also for error reporting */
bool timing; /* enable timing of all queries */