summaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
AgeCommit message (Collapse)Author
2003-12-01attached is a patch that adds display of the groups a user belongs to toBruce Momjian
\du and a \dg command to psql. It's against 7.4beta5. Markus Bertheau <twanger@bluetwanger.de>
2003-12-01This patch reduces some unsightly #ifdefs, and fixes two typos inBruce Momjian
comments in the psql code. This doesn't make any functional change, so feel free to save it for 7.5 Neil Conway
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-10-11Back out -fstrict-aliasing void* casting.Bruce Momjian
2003-10-11This patch will stop gcc from issuing warnings about type-punned objectsBruce Momjian
when -fstrict-aliasing is turned on, as it is in the latest gcc when you use -O2 Andrew Dunstan
2003-09-29Apparently, gettext doesn't like double parentheses around argument. WhatPeter Eisentraut
were they doing here anyway?
2003-09-16Make psql correctly track the effects of SET CLIENT_ENCODING commands.Tom Lane
I thought I'd fixed this earlier, but I didn't get it right ...
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-07-28Rename psql's VERBOSE variable to VERBOSITY, per suggestion from Bruce.Tom Lane
2003-07-23Apply message style guide to frontend programs.Peter Eisentraut
2003-06-28Update psql for some features of new FE/BE protocol. There is aTom Lane
client-side AUTOCOMMIT mode now: '\set AUTOCOMMIT off' supports SQL-spec commit behavior. Get rid of LO_TRANSACTION hack --- the LO operations just work now, using libpq's ability to track the transaction status. Add a VERBOSE variable to control verboseness of error message display, and add a %T prompt-string code to show current transaction-block status. Superuser state display in the prompt string correctly follows SET SESSION AUTHORIZATION commands. Control-C works to get out of COPY IN state.
2003-05-14Backend support for autocommit removed, per recent discussions. TheTom Lane
only remnant of this failed experiment is that the server will take SET AUTOCOMMIT TO ON. Still TODO: provide some client-side autocommit logic in libpq.
2003-04-04Handle cp, rm, and exec for Win32.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-19This patch fixes a very small memory leak in psql, spotted withBruce Momjian
valgrind. Neil Conway
2003-03-18Make the printing code somewhat more independent by not relying onPeter Eisentraut
functions and global variables from the rest of psql. Also clean up some data type mismatches created by the last pager patch.
2003-03-10Cleanup up psql \connect and \pset pager setting display, DennisBruce Momjian
Bj?rklund.
2003-02-19Here's the patch I promised over on HACKERS - it alters theBruce Momjian
implementation of '\e' history tracking for systems that have a readline compatability library without replace_history_entry. I fall back to pushing the query onto the history stack after the \e, rather than replacing it. The patch adds one more place to look for readline headers, and a test for replace_history_entry. I've only included the patch for configure.in Ross J. Reedstrom
2003-02-13[ Have readline save edit history.]Bruce Momjian
> > > I already posted a one-line patch to implement this, but it doesn't > > seem to hve come through to the list. Here it is inline, instead of as > > an attachment: > > We need this to work without readline as well. (Of course there won't be > any history, but it needs to compile.) <blush> Even after slogging my way through the nesting #ifdefs for readline and win32, I forgot! Let's make that a three line patch, then. Ross J. Reedstrom
2003-01-10Do not shell-quote the name of the editor, so that the editor can be aPeter Eisentraut
command with arguments.
2003-01-07Apply the proper version of Christopher Kings-Lynne's describe patchTom Lane
(ie, the one with describe-schema support). Minor code review. Adjust display of casts to use standard type names.
2002-12-12TODO marked as done:Bruce Momjian
* Add schema, cast, and conversion backslash commands to psql I had to create a new publically available function, pg_conversion_is_visible, as it seemed to be missing from the catalogs. This required me to do no small amount of hacking around in namespace.c I have updated the \? help and sgml docs. \dc - list conversions [PATTERN] \dC - list casts \dn list schemas I didn't support patterns with casts as there's nothing obvious to match against. Catalog version incremented --- initdb required. Christopher Kings-Lynne
2002-11-08Here is a patch that does just that, while maintaining theBruce Momjian
"traditional" behavior, so the change should be transparent. Use the command "\pset pager always" to turn it on. Anything else does the normal toggle between "on" and "off" Greg Sabino Mullane
2002-10-23Page \h output and centralize psql paging code in PageOutput().Bruce Momjian
2002-10-15Fix psql to cope with autocommit off, at least during startup.Tom Lane
Behavior of backslash commands (especially for large objects) may still require some thought.
2002-10-03The attached patch fixes a number of issues related to compiling theBruce Momjian
client utilities (libpq.dll and psql.exe) for win32 (missing defines, adjustments to includes, pedantic casting, non-existent functions) per: http://developer.postgresql.org/docs/postgres/install-win32.html. It compiles cleanly under Windows 2000 using Visual Studio .net. Also compiles clean and passes all regression tests (regular and contrib) under Linux. In addition to a review by the usual suspects, it would be very desirable for someone well versed in the peculiarities of win32 to take a look. Joe Conway
2002-09-22Translation updates, some messages tweaked.Peter Eisentraut
2002-09-04pgindent run.Bruce Momjian
2002-09-02I checked all the previous string handling errors and most of them wereBruce Momjian
already fixed by You. However there were a few left and attached patch should fix the rest of them. I used StringInfo only in 2 places and both of them are inside debug ifdefs. Only performance penalty will come from using strlen() like all the other code does. I also modified some of the already patched parts by changing snprintf(buf, 2 * BUFSIZE, ... style lines to snprintf(buf, sizeof(buf), ... where buf is an array. Jukka Holappa
2002-08-14I guess I'd vote for changing the code to beBruce Momjian
sys = malloc(strlen(editorName) + strlen(fname) + 10 + 1); if (!sys) return false; sprintf(sys, "exec '%s' '%s'", editorName, fname); (note the added quotes to provide a little protection against spaces and such). Then it's perfectly obvious what the calculation is doing. I don't care about wasting 20-some bytes, but confusing readers of the code is worth avoiding. regards, tom lane
2002-08-13Put back old code.Bruce Momjian
2002-08-13Change NAMEDATALEN to 64, INDEX_MAX_KEYS/MAX_FUNC_ARGS to 32, per ↵Bruce Momjian
discussion on hackers.
2002-08-10psql backslash commands are schema-aware. Pattern matching behaviorTom Lane
follows recent pghackers discussion. This commit includes all the relevant fixes from Greg Mullane's patch of 24-June.
2002-07-18I have committed many support files for CREATE CONVERSION. DefaultTatsuo Ishii
conversion procs and conversions are added in initdb. Currently supported conversions are: UTF-8(UNICODE) <--> SQL_ASCII, ISO-8859-1 to 16, EUC_JP, EUC_KR, EUC_CN, EUC_TW, SJIS, BIG5, GBK, GB18030, UHC, JOHAB, TCVN EUC_JP <--> SJIS EUC_TW <--> BIG5 MULE_INTERNAL <--> EUC_JP, SJIS, EUC_TW, BIG5 Note that initial contents of pg_conversion system catalog are created in the initdb process. So doing initdb required is ideal, it's possible to add them to your databases by hand, however. To accomplish this: psql -f your_postgresql_install_path/share/conversion_create.sql your_database So I did not bump up the version in cataversion.h. TODO: Add more conversion procs Add [CASCADE|RESTRICT] to DROP CONVERSION Add tuples to pg_depend Add regression tests Write docs Add SQL99 CONVERT command? -- Tatsuo Ishii
2002-07-15Fix \? and \pset pager handling. \? wasn't honoring pager before.Bruce Momjian
2002-04-24Remove traces of NAMEDATALEN and INDEX_MAX_KEYS from psql. Build buffersPeter Eisentraut
dynamically with PQExpBuffer.
2002-03-27Reset parenthesis level counter upon \r.Peter Eisentraut
2002-03-19Add psql \dD listing of domains, from Jonathan Eisler.Bruce Momjian
2002-03-07Back out psql domain improvements until domain is applied.Bruce Momjian
2002-03-06Here is a diff of changes to the psql source code implementing a simpleBruce Momjian
'list domains' command '\dD'. This is the interface component of rbt@zort.ca's domain backend modifications. Jonathan Eisler
2002-03-05Add \timing patch to psql. Times all queries.Bruce Momjian
Greg Sabino Mullane
2002-02-25Tweak psql's \connect command to not downcase unquoted database and userTom Lane
names. This is a temporary measure to allow backwards compatibility with 7.2 and earlier pg_dump. 7.2.1 and later pg_dump will double-quote mixed case names in \connect. Once we feel that older dumps are not a problem anymore, we can revert this change and treat \connect arguments as normal SQL identifiers.
2002-02-20Fix comment.Tom Lane
2002-01-18Add missing 'else', per report from sugita@sra.co.jp.Tom Lane
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-10-11Tatsuo Ishii <t-ishii@sra.co.jp> writes:Bruce Momjian
> As you can see, psql reconnect as any user if the password is same as > foo. Of course this is due to the careless password setting, but I > think it's better to prompt ANY TIME the user tries to switch to > another user. Comments? Yeah, I agree. Looks like a simple change in dbconnect(): /* * Use old password if no new one given (if you didn't have an old * one, fine) */ if (!pwparam && oldconn) pwparam = PQpass(oldconn); to /* * Use old password (if any) if no new one given and we are * reconnecting as same user */ if (!pwparam && oldconn && PQuser(oldconn) && userparam && strcmp(PQuser(oldconn), userparam) == 0) pwparam = PQpass(oldconn); regards, tom lane
2001-10-05Attached is the updated version of the patch, which matchesBruce Momjian
on words as opposed to lines, which means that all of the following work in psql: \d foo \d bar \d foo; \d bar \d foo \d bar;; \d foo; <space> This one also uses "true and false" and strips semicolons for the following backslash commands: \C \c \d \e \i \o \s \z Greg Sabino Mullane