summaryrefslogtreecommitdiff
path: root/src/bin/psql/mainloop.c
AgeCommit message (Collapse)Author
2003-03-21Improve psql comment coding.Bruce Momjian
2003-03-20Fix multiline C comments in psql.Bruce Momjian
2003-03-20I'm continuing to work on cleaning up code in psql. As things appearBruce Momjian
now, my changes seem to work. Some possible minor bugs got squished on the way but I can't be sure without more feedback from people who really put the code to the test. The new patch mostly simplifies variable handling and reduces code duplication. Changes in the command parser eliminate some redundant variables (boolean state + depth counter), replaces some "else if" constructs with switches, and so on. It is meant to be applied together with my previous patch, although I hope they don't conflict; I went back to the CVS version for this one. One more thing I thought should perhaps be changed: an IGNOREEOF value of n will ignore only n-1 EOFs. I didn't want to touch this for fear of breaking existing applications, but it does seem a tad illogical. Jeroen T. Vermeulen
2003-03-20Here's some changes I made last night to psql's common.c (as found inBruce Momjian
7.3.2). It removes some code duplication and #ifdeffing, and some unstructured ugliness such as tacky breaks and an unneeded continue. Breaks up a large function into smaller functions and reduces required nesting levels, and kills a variable or two. Jeroen T. Vermeulen
2002-10-12psql thought that backslash is an escape character inside double quotes.Tom Lane
It isn't.
2002-09-04pgindent run.Bruce Momjian
2002-07-03Fix some more boundary-case errors in psql variable substitution:Tom Lane
wasn't really right for case where :var is at the end of the line, was definitely not right if var expanded to empty in that case, and failed to recalculate thislen before jumping back to rescan.
2002-06-15Noted with versions 7.0.3, 7.1.3, and 7.2.1:Bruce Momjian
The psql interpreter becomes unstable if variable substitutions are used. The debugger GDB was unable to help however mpatrol reports that the sprintf at mainloop.c:389 is steping one byte farther than the allocation. William K. Volkman
2002-03-27Reset parenthesis level counter upon \r.Peter Eisentraut
2002-02-18Add code to preserve paren level display after \g, as submitted months ago.Bruce Momjian
2001-12-28Oops, back out paren fix. That is for 7.3.Bruce Momjian
2001-12-28Add mention of Christof Petig for ecpg items.Bruce Momjian
2001-11-05New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian
initdb/regression tests pass.
2001-10-28Another pgindent run. Fixes enum indenting, and improves #endifBruce Momjian
spacing. Also adds space for one-line comments.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-06-02Native Language Support (NLS)Peter Eisentraut
Use --enable-nls to turn it on; see installation instructions for details. See developer's guide how to make use of it in programs and how to add translations. psql sources have been almost fully prepared and an incomplete German translation has been provided. In the backend, only elog() calls are currently translatable, and the provided German translation file is more of a placeholder.
2001-03-26pqsignal call needs to be #ifndef WIN32, per report from Magnus.Tom Lane
2001-03-23Fix problems with coredumps due to ^C when longjmp buffer isn't valid.Tom Lane
Now, we will only catch ^C at times when it is valid.
2001-03-22pgindent run. Make it all clean.Bruce Momjian
2001-02-28Do not strip whitespace within quotes.Peter Eisentraut
2001-02-10Restructure the key include files per recent pghackers discussion: thereTom Lane
are now separate files "postgres.h" and "postgres_fe.h", which are meant to be the primary include files for backend .c files and frontend .c files respectively. By default, only include files meant for frontend use are installed into the installation include directory. There is a new make target 'make install-all-headers' that adds the whole content of the src/include tree to the installed fileset, for use by people who want to develop server-side code without keeping the complete source tree on hand. Cleaned up a whole lot of crufty and inconsistent header inclusions.
2000-07-17Don't strip trailing backslashes from a line. Treat them more reasonably.Peter Eisentraut
2000-07-14Implement nested block comments in the backend and in psql.Thomas G. Lockhart
Include updates for the comment.sql regression test. Implement SET SESSION CHARACTERISTICS and SET DefaultXactIsoLevel. Implement SET SESSION CHARACTERISTICS TRANSACTION COMMIT and SET AutoCommit in the parser only. Need to add code to actually do something. Implement WITHOUT TIME ZONE type qualifier. Define SCHEMA keyword, along with stubbed-out grammar. Implement "[IN|INOUT|OUT] [varname] type" function arguments in parser only; INOUT and OUT throws an elog(ERROR). Add PATH as a type-specific token, since PATH is in SQL99 to support schema resource search and resolution.
2000-06-30Fix select '1--2'; for PEter.Bruce Momjian
2000-06-29Fix quotes in /* */ comments in psql.Bruce Momjian
2000-05-12/home/peter/commit-msgPeter Eisentraut
2000-04-14fixed another psql \e bug (handle newlines as whitespace)Peter Eisentraut
repaired psql option scanning bug (special treatment to \g |pipe) fixed ipcclean makefile made configure look for Perl to handle psql help build gracefully
2000-04-12Ye-old pgindent run. Same 4-space tabs.Bruce Momjian
2000-03-27Fixed bug with repeated \e in psql (failed to clear buffers correctly)Peter Eisentraut
2000-03-18Modify lexing of multi-char operators per pghackers discussion aroundTom Lane
16-Mar-00: trailing + or - is not part of the operator unless the operator also contains characters not present in SQL92-defined operators. This solves the 'X=-Y' problem without unduly constraining users' choice of operator names --- in particular, no existing Postgres operator names become invalid. Also, remove processing of // comments, as agreed in the same thread.
2000-03-13Fixed deficiency where an unterminated (no semicolon) command at end ofPeter Eisentraut
psql script would be dropped silently.
2000-03-05Added configure test for readline's filename_completion_functionPeter Eisentraut
Completed psql's \? help
2000-03-01More fixes for psql ^C handling, especially during copy. Still doesn'tPeter Eisentraut
cope so well with copy to but that will have to wait for the next release. Also added -X option to prevent reading .psqlrc startup file.
2000-02-20Moved psql \eset and \eshow to \encodingPeter Eisentraut
Improved psql's Ctrl-C handling Fixed configure test for sigsetjmp that now even recognizes it if it's a macro
2000-02-20Fix missing \n in some psql_error calls.Tom Lane
2000-02-16Clean up include files use in psql.Bruce Momjian
2000-02-13Adjusted psql echoing options (-a and -e)Peter Eisentraut
2000-02-10Default argument for createdbPeter Eisentraut
Changed EXIT_ON_ERROR to ON_ERROR_STOP in psql
2000-02-07Fixed psql double quoting of SQL idsPeter Eisentraut
Fixed libpq printing functions
2000-01-24Made abstime/reltime use int4 instead of time_t (TODO item)Peter Eisentraut
Made type equivalency apply to aggregates (TODO item) Fixed parsing bug in psql Reverted some stupid options changes I made to pg_dump
2000-01-18another set of cleanupsPeter Eisentraut
2000-01-16Included all yacc and lex files into the distribution.Peter Eisentraut
2000-01-15Adapt to the changes of libpq(eliminateing using putenv()).Tatsuo Ishii
2000-01-14Fixed psql variables vs array syntax, as well as minor psql enhancementsPeter Eisentraut
2000-01-12Fixed a few "fixes" and bugs. Adjusted messages and options to GNU suggestions.Peter Eisentraut
1999-12-16Clear paren level flag on \r or any backslash command, rather thanBruce Momjian
keeping parenlevel unchanged.
1999-12-11Fix for psql from Peter.Bruce Momjian
1999-12-11Allow ; in () in psql.Bruce Momjian
1999-12-10This should fix the \e (\p, \g, ...) behaviour on an empty query buffer.Bruce Momjian
Also, minor tweakage of tab completion, and I hope the output is flushed on time now. -- Peter Eisentraut Sernanders väg 10:115
1999-11-26* Includes tab completion. It's not magic, but it's very cool. At anyBruce Momjian
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