diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-11-26 04:24:17 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-11-26 04:24:17 +0000 |
commit | 78bc83fedf7f865534c61dd14067fc80d580ed29 (patch) | |
tree | 48a574c438d31fa6bd28ec87a7f3d413e901bb8f /src/bin/psql/input.c | |
parent | c83b4d1cd8afc557b1efad71e3bf99b81c27e57a (diff) | |
download | postgresql-78bc83fedf7f865534c61dd14067fc80d580ed29.tar.gz postgresql-78bc83fedf7f865534c61dd14067fc80d580ed29.zip |
* Includes tab completion. It's not magic, but it's very cool. At any
rate
it's better than what used to be there.
* Does proper SQL "host variable" substitution as pointed out by Andreas
Zeugwetter (thanks): select * from :foo; Also some changes in how ':'
and ';' are treated (escape with \ to send to backend). This does
_not_
affect the '::' cast operator, but perhaps others that contain : or ;
(but there are none right now).
* To show description with a <something> listing, append '?' to command
name, e.g., \df?. This seemed to be the convenient and logical
solution.
Or append a '+' to see more useless information, e.g., \df+.
* Fixed fflush()'ing bug pointed out by Jan during the regression test
discussion.
* Added LastOid variable. This ought to take care of TODO item "Add a
function to return the last inserted oid, for use in psql scripts"
(under CLIENTS)
E.g.,
insert into foo values(...);
insert into bar values(..., :LastOid);
\echo $LastOid
* \d command shows constraints, rules, and triggers defined on the table
(in addition to indices)
* Various fixes, optimizations, corrections
* Documentation update as well
Note: This now requires snprintf(), which, if necessary, is taken from
src/backend/port. This is certainly a little weird, but it should
suffice
until a source tree cleanup is done.
Enjoy.
--
Peter Eisentraut Sernanders väg 10:115
Diffstat (limited to 'src/bin/psql/input.c')
-rw-r--r-- | src/bin/psql/input.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c index d8ceebab935..31fe4ce7737 100644 --- a/src/bin/psql/input.c +++ b/src/bin/psql/input.c @@ -4,7 +4,8 @@ #include <pqexpbuffer.h> -/* Note that this file does not depend on any other files in psql. */ +#include "settings.h" +#include "tab-complete.h" /* Runtime options for turning off readline and history */ /* (of course there is no runtime command for doing that :) */ @@ -96,13 +97,14 @@ gets_fromFile(FILE *source) * The only "flag" right now is 1 for use readline & history. */ void -initializeInput(int flags) +initializeInput(int flags, PsqlSettings *pset) { #ifdef USE_READLINE if (flags == 1) { useReadline = true; rl_readline_name = "psql"; + initialize_readline(&(pset->db)); } #endif |