summaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
AgeCommit message (Collapse)Author
2006-10-06Message style improvementsPeter Eisentraut
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-07-18Mark a few functions as static or NOT_USED.Bruce Momjian
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-07Prepare code to be built by MSVC:Bruce Momjian
o remove many WIN32_CLIENT_ONLY defines o add WIN32_ONLY_COMPILER define o add 3rd argument to open() for portability o add include/port/win32_msvc directory for system includes Magnus Hagander
2006-06-01Fix up hack to suppress escape_string_warning so that it actually worksTom Lane
and there's only one place that's a kluge, ie, appendStringLiteralConn. Note that pg_dump itself doesn't use appendStringLiteralConn, so its behavior is not affected; only the other utility programs care.
2006-05-31Escape processing patch:Bruce Momjian
o turns off escape_string_warning in pg_dumpall.c o optionally use E'' for \password (undocumented option?) o honor standard_conforming-strings for \copy (but not support literal E'' strings) o optionally use E'' for \d commands o turn off escape_string_warning for createdb, createuser, droplang
2006-04-02Rewrite much of psql's \connect code, for the sake of code clarity andNeil Conway
to fix regressions introduced in the recent patch adding additional \connect options. This is based on work by Volkan YAZICI, although this version of the patch doesn't bear much resemblance to Volkan's version. \connect takes 4 optional arguments: database name, user name, host name, and port number. If any of those parameters are omitted or specified as "-", the value of that parameter from the previous connection is used instead; if there is no previous connection, the libpq default is used. Note that this behavior makes it impossible to reuse the libpq defaults without quitting psql and restarting it; I don't really see the use case for needing to do that.
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-05Update copyright for 2006. Update scripts.Bruce Momjian
2006-03-04Use DEVTTY as 'con' on Win32 as a replacement for /dev/tty.Bruce Momjian
2006-03-03Avoid trying to open /dev/tty on Win32. Some Win32 systems haveBruce Momjian
/dev/tty, but it isn't a device file and doesn't work as expected. This fixes a known bug where psql does not prompt for a password on some Win32 systems. Backpatch to 8.1.X. Robert Kinberg
2006-02-12Add psql option:Bruce Momjian
-1 or --single-transaction Simon Riggs
2006-02-12I've created a new shared catalog table pg_shdescription to storeBruce Momjian
comments on cluster global objects like databases, tablespaces, and roles. It touches a lot of places, but not much in the way of big changes. The only design decision I made was to duplicate the query and manipulation functions rather than to try and have them handle both shared and local comments. I believe this is simpler for the code and not an issue for callers because they know what type of object they are dealing with. This has resulted in a shobj_description function analagous to obj_description and backend functions [Create/Delete]SharedComments mirroring the existing [Create/Delete]Comments functions. pg_shdescription.h goes into src/include/catalog/ Kris Jurka
2006-02-12Please find enclosed a patch that lets you use \c to connectBruce Momjian
(optionally) to a new host and port without exiting psql. This eliminates, IMHO, a surprise in that you can now connect to PostgreSQL on a differnt machine from the one where you started your session. This should help people who use psql as an administrative tool. David Fetter
2005-12-26Rename pg_make_encrypted_password to PQencryptPassword.Peter Eisentraut
2005-12-23Add an officially exported libpq function to encrypt passwords, andTom Lane
modify the previous \password patch to use it instead of depending on a not-officially-exported function. Per discussion.
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-12-08Add missing translation markerPeter Eisentraut
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-09-20Return proper value for psql -f filename failure if filename open fails.Bruce Momjian
Backpatch to 8.0.X.
2005-08-14Fix up tab completion for ROLEs and add some more completion logic forTom Lane
other stuff; change \du and \dg to be role-aware (Stefan Kaltenbrunner). Also make tab completion fetch the list of GUC variables from pg_settings instead of having a hard-wired copy of the list (Tom Lane).
2005-07-25Add username for psql password prompt, if the username was specified.Bruce Momjian
Adrian Maier
2005-07-18\pset numericsep -> numericlocale.Bruce Momjian
2005-07-14Change numericsep to a boolean, and make it locale-aware.Bruce Momjian
2005-07-14barebones variable name -> tuples_only, for consistency.Bruce Momjian
2005-07-10Add psql \pset numericsep to allow output numbers like 100,000.0 orBruce Momjian
100.000,0. Eugen Nedelcu
2005-06-13Per discussion on -hackers, this patch changes psql's "expanded" outputNeil Conway
mode to only affect the presentation of normal query results, not the output of psql slash commands. Documentation updated. I also made some unrelated minor psql cleanup. Per suggestion from Stuart Cooper.
2005-06-09This patch shows the full path name when doing a \s in psql,Bruce Momjian
if you have previously issued a \cd command. Greg Sabino Mullane
2005-06-09I've created a patch which adds support for troff "-ms" output toBruce Momjian
psql. i.e. "\pset format troff-ms". The patch also corrects some problems with the "latex" format, notably defining an extra column in the output table, and correcting some alignment issues; it also changes the output to match the border setting as documented in the manual page and as shown with the "aligned" format. The troff-ms output is mostly identical to the latex output allowing for the differences between the two typesetters. The output should be saved in a file and piped as follows: cat file | tbl | troff -T ps -ms > file.ps or tbl file | troff -T ps -ms > file.ps Because it contains tabs, you'll need to redirect psql output or use "script", rather than pasting from a terminal window, due to the tabs which can be replaced with spaces. Roger Leigh
2005-04-29Backpatch BCC compile changes to 8.0.X for psql.Bruce Momjian
2005-03-16Add sprintf support, that were were missing.Bruce Momjian
Add support for snprintf '+', 'h', and %* length settings.
2005-03-11Define snprintf() to call pg_snprintf() so our own snprintf-likeBruce Momjian
implementation doesn't export out via libpq and get used by a user application.
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-12-19Prevent evaluation of backticks while discarding unwanted argumentsTom Lane
after an unknown or failed psql backslash command, and also while discarding "extra" arguments of a putatively valid backslash command. In the case of an unknown/failed command, make sure we discard the whole rest of the line, rather than trying to resume at the next backslash. Per discussion with Thomer Gil.
2004-11-30Add \n to end of output for psql \s with no history file name.Bruce Momjian
This prevents the next psql prompt from showing up on the end of the last history line.
2004-11-30Quote SHELL arguments only on Win32.Bruce Momjian
2004-11-15Don't quote the value of EDITOR on Unix, only on Windows. Per discussion.Tom Lane
2004-11-09Clarify some stringsPeter Eisentraut
2004-11-06Remove directory from cmd.exe default shell.Bruce Momjian
2004-11-06Variable initializer no longer necessary.Bruce Momjian
2004-11-06Tests for COMSPEC in the right place and supply a reasonable shellBruce Momjian
default on Win32.
2004-11-04Fix psql \e and \! for Win32.Bruce Momjian
2004-10-16Allow pg_ctl to determine the server is up when getting a request for aBruce Momjian
password. Make password error message a #define and use it consistently. Sean Chittenden
2004-10-14Add 'int' cast for getpid() because some Solaris releases return longBruce Momjian
for getpid().
2004-10-09Make getpid() use %d consistently for printing.Bruce Momjian
2004-10-07Adjust comments previously moved to column 1 by pgident.Bruce Momjian
2004-08-29Pgindent run for 8.0.Bruce Momjian