summaryrefslogtreecommitdiff
path: root/src/bin/psql/mainloop.c
AgeCommit message (Collapse)Author
2008-06-10Editorialization for the text emitted by the "help" psql command.Neil Conway
Basically just reuse the same text that psql emitted as part of its startup banner in prior versions, and make some whitespace more consistent with the conventions in other psql command output.
2008-05-16Update psql startup banner to be shorter, suggest "help" for help.Bruce Momjian
Add a few "help" entries. Move \g help entry into "General". Update psql version mismatch warning text. Joshua D. Drake
2008-04-05A small visit from the portability and localization police.Tom Lane
2008-04-04Have psql command 'help' suggest the use of \?, updated version.Bruce Momjian
Greg Sabino Mullane
2008-04-04Allow 'help' in psql to show \? help, for novice assistance.Bruce Momjian
Greg Sabino Mullane
2008-01-01Update copyrights in source tree to 2008.Bruce Momjian
2007-11-28Properly recognize and announce input errors.Peter Eisentraut
2007-01-05Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian
back-stamped for this.
2006-10-04pgindent run for 8.2.Bruce Momjian
2006-08-29Invent an assign-hook mechanism for psql variables similar to the oneTom Lane
existing for backend GUC variables, and use this to eliminate repeated fetching/parsing of psql variables in psql's inner loops. In a trivial test with lots of 'select 1;' commands, psql's CPU time went down almost 10%, although of course the effect on total elapsed time was much less. Per discussion about how to ensure the upcoming FETCH_COUNT patch doesn't cost any performance when not being used.
2006-08-11Make the psql line counter 64-bit so it can handle files > 4gig lines.Bruce Momjian
David Fetter
2006-07-14Remove 576 references of include files that were not needed.Bruce Momjian
2006-06-14Clean up psql's control-C handling to avoid longjmp'ing out of randomTom Lane
places --- that risks corrupting data structures, losing sync with the backend, etc. We now longjmp only from calls to readline, fgets, and fread, which we assume are coded to protect themselves against interrupts at undesirable times. This requires adding explicit tests for cancel_pressed in long-running loops, but on the whole it's far cleaner. Martijn van Oosterhout and Tom Lane.
2006-06-11Code review for psql multiline history patch(es). Fix memory leak,Tom Lane
failure to enter commands in history if canceled by control-C, other infelicities.
2006-06-07For psql multi-line history, save backslash commands right away, ratherBruce Momjian
than only if there is already history.
2006-06-05Avoid longjump/vfork warning about line_saved_in_history variable byBruce Momjian
making it volatile.
2006-06-05Have psql history save \e editor contents to history before query isBruce Momjian
executed, like it did for 8.1.X.
2006-06-04Fix psql so \r is separate in the history, rather than at the end ofBruce Momjian
the query.
2006-03-21Fix psql history handling:Bruce Momjian
> 1) Fix the problems with the \s command. > When the saveHistory is executed by the \s command we must not do the > conversion \n -> \x01 (per > http://archives.postgresql.org/pgsql-hackers/2006-03/msg00317.php ) > > 2) Fix the handling of Ctrl+C > > Now when you do > wsdb=# select 'your long query here ' > wsdb-# > and press afterwards the CtrlC the line "select 'your long query here '" > will be in the history > > (partly per > http://archives.postgresql.org/pgsql-hackers/2006-03/msg00297.php ) > > 3) Fix the handling of commands with not closed brackets, quotes, double > quotes. (now those commands are not splitted in parts...) > > 4) Fix the behaviour when SINGLELINE mode is used. (before it was almost > broken ;( Sergey E. Koposov
2006-03-06Fix psql history handling so 'execute' backslash commands (\g)Bruce Momjian
remain as part of the multi-line query.
2006-03-06In psql, save history of backslash commands used in multi-lineBruce Momjian
statements before the multi-line statement, rather than inside the multi-line statement.
2006-03-05Update copyright for 2006. Update scripts.Bruce Momjian
2006-02-11o Improve psql's handling of multi-line statementsBruce Momjian
Currently, while \e saves a single statement as one entry, interactive statements are saved one line at a time. Ideally all statements would be saved like \e does. Sergey E. Koposov
2005-12-18Add new psql command \password for changing role password with client-sidePeter Eisentraut
password encryption. Also alter createuser command to the same effect.
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-02-22Use _() macro consistently rather than gettext(). Add translationBruce Momjian
macros around strings that were missing them.
2005-01-01Update copyrights that were missed.Bruce Momjian
2004-10-30Invent a new, more thread-safe version of PQrequestCancel, called PQcancel.Tom Lane
Use this new function in psql. Implement query cancellation in psql for Windows. Code by Magnus Hagander, documentation and minor editorialization by Tom Lane.
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-29Update copyright to 2004.Bruce Momjian
2004-02-19Re-implement psql's input scanning to use a flex-generated lexer, as perTom Lane
recent discussion. The lexer is used for both SQL command text and backslash commands. The purpose of this change is to make it easier to track the behavior of the backend's SQL lexer --- essentially identical flex rules are now used by psql. Also, this cleans up a lot of very squirrelly code in mainloop.c and command.c. The flex code is somewhat bulkier than the removed code, but should be lots easier to maintain.
2004-01-25More fallout from the recent psql patch: rename xmalloc and friends toNeil Conway
pg_malloc, to avoid linker failures on same platforms.
2004-01-24This patch makes some of the memory manipulation performed by psql aNeil Conway
little more sane. Some parts of the code was using a static function xmalloc() that did safe memory allocation (where "safe" means "bail out on OOM"), but most of it was just invoking calloc() or malloc() directly. Now almost everything invokes xmalloc() or xcalloc().
2004-01-21Ensure fflush(stdout) happens in all cases, per gripe from Jon Sablatnig.Tom Lane
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-08-04Fix some copyright notices that weren't updated. Improve copyright toolTom Lane
so it won't miss 'em again.
2003-08-04pgindent run.Bruce Momjian
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.