summaryrefslogtreecommitdiff
path: root/src/bin/psql/tab-complete.c
AgeCommit message (Collapse)Author
2006-02-12Improve tab completion macro for default keywords.Bruce Momjian
2006-02-12List psql tab completion for various default keywords.Bruce Momjian
Joachim Wieland
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-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
2006-01-11Cosmetic code cleanup: fix a bunch of places that used "return (expr);"Neil Conway
rather than "return expr;" -- the latter style is used in most of the tree. I kept the parentheses when they were necessary or useful because the return expression was complex.
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-08> 1) I'm proposing a patch to do the DROP FUNCTION argument tab completion.Bruce Momjian
> Now, the arguments of the drop function can be tab completed. for example > > drop function strpos ( > <press tab> > drop FUNCTION strpos (text, text) > > or: > > wsdb=# drop FUNCTION length ( > bit) bytea) character) lseg) path) text) > <press c> > wsdb# DROP FUNCTION length ( character) > > I think that this patch should be rather useful. At it least I hate > always to type all the arguments of the dropped functions. > > 2) Also some fixes applied for the > CREATE INDEX syntax > > now the parenthesises are inserted by tab pressing. > suppose I have the table q3c: Sergey E. Koposov
2005-11-18Add tab completion for RESET SESSION AUTHORIZATION.Alvaro Herrera
2005-11-14Re-run pgindent to fix breakage when exceeding 150 'else if' clauses.Bruce Momjian
Cosmetic fix only.
2005-11-07R-tree is dead ... long live GiST.Tom Lane
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
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-30Add GUC variables to control keep-alive times for idle, interval, andBruce Momjian
count. Oliver Jowett
2005-07-28Add tab completion syntax for PREPARE 2-phase commit syntax.Bruce Momjian
There's no tab-completion for "PREPARE TRANSACTION 'xxx'" since that would be ambigous with "PREPARE xxx AS xx". Heikki Linnakangas
2005-07-23Simple constraint exclusion. For now, only child tables of inheritanceTom Lane
scans are candidates for exclusion; this should be fixed eventually. Simon Riggs, with some help from Tom Lane.
2005-06-22Make REINDEX DATABASE do what one would expect, namely reindex all indexesTom Lane
in the database. The old behavior (reindex system catalogs only) is now available as REINDEX SYSTEM. I did not add the complementary REINDEX USER case since there did not seem to be consensus for this, but it would be trivial to add later. Per recent discussions.
2005-06-21Trivial dead code removal: in _complete_from_query(), 'text' cannot beNeil Conway
NULL (e.g. due to the preceding strlen()). Therefore we needn't recheck this before initializing 'e_text'. Per Coverity static analysis performed by EnterpriseDB.
2005-06-14Add GUC krb_server_hostname so the server hostname can be specified asBruce Momjian
part of service principal. If not set, any service principal matching an entry in the keytab can be used. NEW KERBEROS MATCHING BEHAVIOR FOR 8.1. Todd Kover
2005-05-25Quick patch to adress a recent concern on the mailing listBruce Momjian
about adding an errant "TO" when we already have a TO. Since TO cannot be a valid column name (we must quote it), we can simply ignore the tab-completion if the previous word was a "TO". Greg Sabino Mullane
2005-05-18Upon closer inspection, Greg's psql tab completion patch leaks memory.Neil Conway
Fix the leak, and add a comment to note that the return value of previous_word must be free'd.
2005-05-18psql tab completion improvements, from Greg Sabino Mullane:Neil Conway
* Made DELETE into "DELETE FROM" * Moved ANALZYE to the end of the list to ease EXPLAIN / VACUUM conflicts * Removed the ANALYZE xx semicolon completion: we don't do that anywhere else * Add DECLARE support * Add parens for DROP AGGREGATE * Add "CASCADE | RESTRICT" for DROP xx * Make EXPLAIN <tab> a lot smarter * GROUP "BY" and ORDER "BY" * "ISOLATION" becomes "ISOLATION LEVEL" * Fix error in which REVOKE xx ON yy was receiving "TO", now gets "FROM" * Add GRANT/REVOKE xx ON yy TO/FROM choices: usernames, GROUP, PUBLIC * PREPARE xx <tab> AS "SELECT | INSERT | UPDATE | DELETE" * Add = at end of UPDATE xx SET yy * Beef up VACUUM stuff
2005-05-07Add COPY WITH CVS HEADER to allow a heading line as the first line inBruce Momjian
COPY. Andrew Dunstan
2005-05-04Spell DELIMITER correctly, per Seamus Dean.Tom Lane
2005-04-21Rethink original decision to use AND/OR Expr nodes to represent bitmapTom Lane
logic operations during planning. Seems cleaner to create two new Path node types, instead --- this avoids duplication of cost-estimation code. Also, create an enable_bitmapscan GUC parameter to control use of bitmap plans.
2005-04-07Add a "USING" clause to DELETE, which is equivalent to the FROM clauseNeil Conway
in UPDATE. We also now issue a NOTICE if a query has _any_ implicit range table entries -- in the past, we would only warn about implicit RTEs in SELECTs with at least one explicit RTE. As a result of the warning change, 25 of the regression tests had to be updated. I also took the opportunity to remove some bogus whitespace differences between some of the float4 and float8 variants. I believe I have correctly updated all the platform-specific variants, but let me know if that's not the case. Original patch for DELETE ... USING from Euler Taveira de Oliveira, reworked by Neil Conway.
2005-04-04Minor fixes for psql tab completion. Spell "absolute" like the English word,Neil Conway
not the brand of vodka. Complete FETCH <sth> <sth> with FROM and IN, not FROM and TO (which is still pretty incomplete, but at least its the right syntax).
2005-03-19Add temp_buffers GUC variable to allow users to determine the sizeTom Lane
of the local buffer arena for temporary table access.
2005-01-23Document why CREATE CONSTRAINT TRIGGER doesn't tab complete.Bruce Momjian
2005-01-01Update copyrights that were missed.Bruce Momjian
2004-12-24Switch order of WHERE clauses in tab completion queries, as suggestedTom Lane
by Rod Taylor. The foo_is_visible() functions are relatively slow and so it pays to check them after checking the name pattern match.
2004-11-05Create 'default_tablespace' GUC variable that supplies a TABLESPACETom Lane
clause implicitly whenever one is not given explicitly. Remove concept of a schema having an associated tablespace, and simplify the rules for selecting a default tablespace for a table or index. It's now just (a) explicit TABLESPACE clause; (b) default_tablespace if that's not an empty string; (c) database's default. This will allow pg_dump to use SET commands instead of tablespace clauses to determine object locations (but I didn't actually make it do so). All per recent discussions.
2004-11-02Tab completion for CREATE TABLESPACE arguments. Patch by Joachim Wieland.Peter Eisentraut
2004-09-22Some improvements for the tab-completion of psql. This shouldNeil Conway
address all of the items in the todo list and adds some new things as well. Specifically: * Add support for ALTER SEQUENCE ... * Add "RENAME TO" for ALTER TRIGGER xx ON yy * Pick proper table for ALTER TRIGGER xx ON ... * Support for ALTER USER xxx ... * Fix ALTER GROUP xxx DROP ... * Fix ALTER DOMAIN xxx DROP ... * Remove "OWNER TO" from ALTER DOMAIN xx DROP ... * Fix ALTER DOMAIN xx SET DEFAULT .. * Prevent ALTER INDEX xxx SET TABLESPACE from using "TO" * Support for ALTER LANGUAGE xxx (RENAME TO) * More support for ALTER TABLE xxx ALTER COLUMN xxx ... * More support for COPY Greg Sabino Mullane
2004-09-01src/bin/psql/tab-complete.c =~ s/CONVERSATION/CONVERSION/;Bruce Momjian
Greg Sabino Mullane
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-29Update copyright to 2004.Bruce Momjian
2004-08-21Fix tab completion for ALTER INDEX.Bruce Momjian
2004-08-20Attached is the third version of my patch that adds/fixes several thingsBruce Momjian
to/in the psql-tabcomplete code. This diff includes the still missing tab-complete support for TABLESPACE I already sent earlier. New in this version of the patch is a small adaption of the tab-complete code to support the adjusted SAVEPOINT-Syntax commited by Tom, as well as completion of the only half working (and I think only by accident) tabcomplete-suppport for "BEGIN [ TRANSACTION | WORK ]". below is a complete list of the things I have changed with this patch: *) add tablespace support for CREATE/DROP/ALTER and \db *) sync the list of possible commands following ALTER with the docs (by adding AGGREGATE,CONVERSATION,DOMAIN,FUNCTION,LANGUAGE,OPERATOR,SEQUENCE,TABLESPACE and TYPE) *) provide a list of valid users after "OWNER TO" *) tab-complete support for ALTER (AGGREGATE|CONVERSION|FUNCTION) *) basic tab-complete support for ALTER DOMAIN *) provide a list of suitable indexes following ALTER TABLE <sth> CLUSTER ON(?) *) add "CLUSTER ON" and "SET" to the ALTER TABLE <sth> - tab-complete list(fixes incorrect/wrong tab-complete with ALTER TABLE <sth> SET +<TAB> too) *) provide a list of possible indexes following ALTER TABLE <sth> CLUSTER ON *) provide list of possible commands(WITHOUT CLUSTER,WITHOUT OIDS, TABLESPACE) following ALTER TABLE <sth> SET *) sync "COMMENT ON" with docs by adding "CAST","CONVERSION","FUNCTION" *) add ABSOLUT to the list of possible commands after FETCH *) "END" was missing from the sql-commands overview (though it had completion support!) - i know it's depreciated but we have ABORT and others still in ... *) fixes small buglet with ALTER (TRIGGER|CLUSTER) ON autocomplete (CLUSTER ON +<TAB> would produce CLUSTER ON ON - same for TRIGGER ON) *) adapt to new SAVEPOINT syntax *) fix incomplete Support for BEGIN [ TRANSACTION | WORK ] Stefan Kaltenbrunn
2004-08-20Add ALTER INDEX, particularly for moving tablespaces.Bruce Momjian
Gavin Sherry
2004-07-28Fix subtransaction behavior for large objects, temp namespace, files,Tom Lane
password/group files. Also allow read-only subtransactions of a read-write parent, but not vice versa. These are the reasonably noncontroversial parts of Alvaro's recent mop-up patch, plus further work on large objects to minimize use of the TopTransactionResourceOwner.
2004-07-27Replace nested-BEGIN syntax for subtransactions with spec-compliantTom Lane
SAVEPOINT/RELEASE/ROLLBACK-TO syntax. (Alvaro) Cause COMMIT of a failed transaction to report ROLLBACK instead of COMMIT in its command tag. (Tom) Fix a few loose ends in the nested-transactions stuff.
2004-05-26This patch implement the TODO [ALTER DATABASE foo OWNER TO bar].Bruce Momjian
It was necessary to touch in grammar and create a new node to make home to the new syntax. The command is also supported in E CPG. Doc updates are attached too. Only superusers can change the owner of the database. New owners don't need any aditional privileges. Euler Taveira de Oliveira
2004-05-12Rename find_my_binary/find_other_binary toBruce Momjian
find_my_exec/find_other_exec(). Remove passing of progname to these functions as they can find that out from argv[0], which they already have. Make get_progname return const char *, and update all progname variables to be const char *.
2004-05-07Solve the 'Turkish problem' with undesirable locale behavior for caseTom Lane
conversion of basic ASCII letters. Remove all uses of strcasecmp and strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp; remove most but not all direct uses of toupper and tolower in favor of pg_toupper and pg_tolower. These functions use the same notions of case folding already developed for identifier case conversion. I left the straight locale-based folding in place for situations where we are just manipulating user data and not trying to match it to built-in strings --- for example, the SQL upper() function is still locale dependent. Perhaps this will prove not to be what's wanted, but at the moment we can initdb and pass regression tests in Turkish locale.
2004-04-05Remove 'syslog' GUC variable, and add more logical 'log_destination'Bruce Momjian
variable to control logoutput location on Unix and Win32. Magnus Hagander
2004-03-24Replace max_expr_depth parameter with a max_stack_depth parameter thatTom Lane
is measured in kilobytes and checked against actual physical execution stack depth, as per my proposal of 30-Dec. This gives us a fairly bulletproof defense against crashing due to runaway recursive functions.
2004-03-23Replace the virtual_host and tcpip_socket parameters with a unifiedTom Lane
listen_addresses parameter, as per recent discussion. The default behavior is now to listen on localhost, which eliminates the need for the -i postmaster switch in many scenarios. Andrew Dunstan
2004-02-03Rename SortMem and VacuumMem to work_mem and maintenance_work_mem.Tom Lane
Make btree index creation and initial validation of foreign-key constraints use maintenance_work_mem rather than work_mem as their memory limit. Add some code to guc.c to allow these variables to be referenced by their old names in SHOW and SET commands, for backwards compatibility.
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().