aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/input.c
Commit message (Collapse)AuthorAge
* Fix saveHistory() to not emit bogus complaint during psql exit when usingTom Lane2006-06-18
| | | | | Darwin's libedit; per my proposal last August. Also, suppress cast-away- const warnings.
* Clean up psql's control-C handling to avoid longjmp'ing out of randomTom Lane2006-06-14
| | | | | | | | | 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.
* Code review for psql multiline history patch(es). Fix memory leak,Tom Lane2006-06-11
| | | | | failure to enter commands in history if canceled by control-C, other infelicities.
* Fix psql history handling:Bruce Momjian2006-03-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | > 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
* In psql, save history of backslash commands used in multi-lineBruce Momjian2006-03-06
| | | | | statements before the multi-line statement, rather than inside the multi-line statement.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-05
|
* Place function names in first column for consistency.Bruce Momjian2006-02-13
|
* Fix build failure when not USE_READLINE. Sergey E. KoposovTom Lane2006-02-13
|
* Use 0x01 for newlines in saved history. It was determined to be notBruce Momjian2006-02-12
| | | | | used by multi-byte sequences, but futher invesetigation might prove this to be false.
* o Improve psql's handling of multi-line statementsBruce Momjian2006-02-11
| | | | | | | | 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
* Standard pgindent run for 8.1.Bruce Momjian2005-10-15
|
* Use saveHistory so we get a nice error message on failure.Bruce Momjian2005-06-10
| | | | Andreas Seltenreich
* the following patch makes the filename used to store the readlineBruce Momjian2005-06-10
| | | | | | | | | | | | | | history customizable through a variable named HISTFILE, analogous to psql's already implemented HISTCONTROL and HISTSIZE variables, and bash's HISTFILE-Variable. The motivation was to be able to get psql to maintain separate histories for separate databases. This is now easily achievable through a line like the following in ~/.psqlrc: \set HISTFILE ~/.psql_history-:DBNAME Andreas Seltenreich
* Adjust lookup of client-side profile files (.pgpass and so on) as perTom Lane2005-01-06
| | | | | | discussion on pgsql-hackers-win32 list. Documentation still needs to be tweaked --- I'm not sure how to refer to the APPDATA folder in user documentation.
* Update copyrights that were missed.Bruce Momjian2005-01-01
|
* Message style revisionsPeter Eisentraut2004-10-12
|
* Say "history is not supported" and remove "on this platform" for lack ofBruce Momjian2004-10-06
| | | | readline.
* Suppress psql \s help display for platforms like Win32 that don'tBruce Momjian2004-10-06
| | | | | typically install witn readline, and throw an error if they try to access it.
* Remove inclusion of windows.h now that it is included in c.h, per ideaBruce Momjian2004-09-27
| | | | from Peter.
* Pgindent run for 8.0.Bruce Momjian2004-08-29
|
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* Add get_home_path() to use USERPROFILE on Win32 and HOME on Unix.Bruce Momjian2004-08-18
|
* More fallout from the recent psql patch: rename xmalloc and friends toNeil Conway2004-01-25
| | | | pg_malloc, to avoid linker failures on same platforms.
* This patch makes some of the memory manipulation performed by psql aNeil Conway2004-01-24
| | | | | | | 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().
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-29
|
* Remove WIN32_CONSOLE support, at the request of the author.Bruce Momjian2003-09-12
|
* Clean up WIN32_CONSOLE code.Bruce Momjian2003-09-05
|
* psql's HISTSIZE from .psqlrc do not want to be set so I did it for psqlBruce Momjian2003-08-26
| | | | | | that HISTSIZE might take effect from my .psqlrc Andriy Tkachuk
* Fix some copyright notices that weren't updated. Improve copyright toolTom Lane2003-08-04
| | | | so it won't miss 'em again.
* pgindent run.Bruce Momjian2003-08-04
|
* here are the patches for psql on Win32:Bruce Momjian2003-07-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | psql4win32.patch - changes in the psql source code psql-ref.patch - changes in the documentation psql-ref.sgml (for new builtin variable WIN32_CONSOLE) To apply them use "patch -p 1" in the root directory of the postgres source directory. These patches fix the following problems of psql on Win32 (all changes only have effect #ifdef WIN32): a) Problem: Static library libpq.a did not work Solution: Added WSAStartup() in fe-connect.c b) Problem: Secret Password was echoed by psql Solution: Password echoing disabled in sprompt.c c) Problem: 8bit characters were displayed/interpreted wrong in psql This is due to the fact that the Win32 "console" uses a different encoding than the rest of the Windows system Solution: Introduced a new psql variable WIN32_CONSOLE When set with "\set WIN32_console", the function OemToChar() is applied after reading input and CharToOem() before displaying Output Christoph Dalitz
* > Rod Taylor <rbt@rbt.ca> writes:Bruce Momjian2003-07-25
| | | | | | | | | | | | | | | | | > > It seems that readline() on my system (FreeBSD 4.8) isn't declared to > > take the prompt as a const. Thus, remove const from gets_interactive() > > to remove the warning. > > I think it would be a lot cleaner to just put a cast to char * into the > readline call (with a note about why). Ok.. that works. I must say it's a little strange being able to take a constant and say its no longer constant anymore -- but I suppose it's no different than defining then undefining pre-processor constants. Rod Taylor <rbt@rbt.ca>
* Apply message style guide to frontend programs.Peter Eisentraut2003-07-23
|
* I'm continuing to work on cleaning up code in psql. As things appearBruce Momjian2003-03-20
| | | | | | | | | | | | | | | | | | | | 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
* Here's some changes I made last night to psql's common.c (as found inBruce Momjian2003-03-20
| | | | | | | | | 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
* Fix printf() quote handling and improper exit(), per Tom.Bruce Momjian2002-09-06
|
* Remove PGPASSWORDFILE and default to always trying $HOME/.pgpass.Bruce Momjian2002-09-05
| | | | | | Cleanup up memory allocation for $HOME in related psql places. Update mention of $HOME/.pgpass in the docs; add mention in pg_dumpall.
* Readline and Zlib now required by default. Add options --without-readlinePeter Eisentraut2002-04-10
| | | | and --without-zlib to turn them off.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* Invoke on_exit() with correct number and type of arguments.Peter Eisentraut2001-09-11
|
* Massive commits for SunOS4 port.Tatsuo Ishii2001-02-27
|
* Restructure the key include files per recent pghackers discussion: thereTom Lane2001-02-10
| | | | | | | | | | | 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.
* Pay attention to failure returns from fgets() in all cases.Tom Lane2000-11-27
| | | | Avoid infinite loop prompting for password at stdin EOF.
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Moved psql \eset and \eshow to \encodingPeter Eisentraut2000-02-20
| | | | | Improved psql's Ctrl-C handling Fixed configure test for sigsetjmp that now even recognizes it if it's a macro
* Fix missing \n in some psql_error calls.Tom Lane2000-02-20
|
* Clean up include files use in psql.Bruce Momjian2000-02-16
|
* Fixed psql double quoting of SQL idsPeter Eisentraut2000-02-07
| | | | Fixed libpq printing functions
* A few minor psql enhancementsPeter Eisentraut2000-01-29
| | | | | | | Initdb help correction Changed end/abort to commit/rollback and changed related notices Commented out way old printing functions in libpq Fixed a typo in alter table / alter column
* another set of cleanupsPeter Eisentraut2000-01-18
|