aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/tab-complete.c
Commit message (Collapse)AuthorAge
* Add a new GUC parameter backslash_quote, which determines whether the SQLTom Lane2006-05-21
| | | | | | | | | | | | | | | | | parser will allow "\'" to be used to represent a literal quote mark. The "\'" representation has been deprecated for some time in favor of the SQL-standard representation "''" (two single quote marks), but it has been used often enough that just disallowing it immediately won't do. Hence backslash_quote allows the settings "on", "off", and "safe_encoding", the last meaning to allow "\'" only if client_encoding is a valid server encoding. That is now the default, and the reason is that in encodings such as SJIS that allow 0x5c (ASCII backslash) to be the last byte of a multibyte character, accepting "\'" allows SQL-injection attacks as per CVE-2006-2314 (further details will be published after release). The "on" setting is available for backward compatibility, but it must not be used with clients that are exposed to untrusted input. Thanks to Akio Ishida and Yasuo Ohgaki for identifying this security issue.
* Spell DELIMITER correctly, per Seamus Dean.Tom Lane2005-05-04
|
* Update copyrights that were missed.Bruce Momjian2005-01-01
|
* Switch order of WHERE clauses in tab completion queries, as suggestedTom Lane2004-12-24
| | | | | by Rod Taylor. The foo_is_visible() functions are relatively slow and so it pays to check them after checking the name pattern match.
* Create 'default_tablespace' GUC variable that supplies a TABLESPACETom Lane2004-11-05
| | | | | | | | | | 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.
* Tab completion for CREATE TABLESPACE arguments. Patch by Joachim Wieland.Peter Eisentraut2004-11-02
|
* Some improvements for the tab-completion of psql. This shouldNeil Conway2004-09-22
| | | | | | | | | | | | | | | | | | | | 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
* src/bin/psql/tab-complete.c =~ s/CONVERSATION/CONVERSION/;Bruce Momjian2004-09-01
| | | | Greg Sabino Mullane
* Pgindent run for 8.0.Bruce Momjian2004-08-29
|
* Update copyright to 2004.Bruce Momjian2004-08-29
|
* Fix tab completion for ALTER INDEX.Bruce Momjian2004-08-21
|
* Attached is the third version of my patch that adds/fixes several thingsBruce Momjian2004-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add ALTER INDEX, particularly for moving tablespaces.Bruce Momjian2004-08-20
| | | | Gavin Sherry
* Fix subtransaction behavior for large objects, temp namespace, files,Tom Lane2004-07-28
| | | | | | | 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.
* Replace nested-BEGIN syntax for subtransactions with spec-compliantTom Lane2004-07-27
| | | | | | | 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.
* This patch implement the TODO [ALTER DATABASE foo OWNER TO bar].Bruce Momjian2004-05-26
| | | | | | | | | | 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
* Rename find_my_binary/find_other_binary toBruce Momjian2004-05-12
| | | | | | | | | 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 *.
* Solve the 'Turkish problem' with undesirable locale behavior for caseTom Lane2004-05-07
| | | | | | | | | | | | | 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.
* Remove 'syslog' GUC variable, and add more logical 'log_destination'Bruce Momjian2004-04-05
| | | | | | variable to control logoutput location on Unix and Win32. Magnus Hagander
* Replace max_expr_depth parameter with a max_stack_depth parameter thatTom Lane2004-03-24
| | | | | | 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.
* Replace the virtual_host and tcpip_socket parameters with a unifiedTom Lane2004-03-23
| | | | | | | | 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
* Rename SortMem and VacuumMem to work_mem and maintenance_work_mem.Tom Lane2004-02-03
| | | | | | | 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.
* 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().
* Allow BEGIN WORK to specify transaction isolation level, like STARTBruce Momjian2004-01-10
| | | | TRANSACTION.
* attached is a patch that adds display of the groups a user belongs to toBruce Momjian2003-12-01
| | | | | | \du and a \dg command to psql. It's against 7.4beta5. Markus Bertheau <twanger@bluetwanger.de>
* This patch reduces some unsightly #ifdefs, and fixes two typos inBruce Momjian2003-12-01
| | | | | | | comments in the psql code. This doesn't make any functional change, so feel free to save it for 7.5 Neil Conway
* This patch adds a new GUC var, "default_with_oids", which follows theBruce Momjian2003-12-01
| | | | | | | | proposal for eventually deprecating OIDs on user tables that I posted earlier to pgsql-hackers. pg_dump now always specifies WITH OIDS or WITHOUT OIDS when dumping a table. The documentation has been updated. Neil Conway
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-29
|
* Allow tab completion for ALTER TABLE dbname <tab><tab> to show newBruce Momjian2003-11-08
| | | | RENAME TO option.
* Implement isolation levels read uncommitted and repeatable read as actingPeter Eisentraut2003-11-06
| | | | like the next higher one.
* Further work on tab completion code: arrange for system catalogs to beTom Lane2003-10-30
| | | | | | | | | offered for completion only when the input-so-far is at least 'pg_'. This seems to be the best compromise behavior emerging from yesterday's discussion. While at it, refactor code to eliminate repetitive use of nearly identical queries, which was exceedingly tedious to maintain. Also const-ify code more thoroughly in hopes of moving constant data into text segment, and remove unnecessary length limit on queries.
* Don't include "schema." in the set of possible tab completions onceTom Lane2003-10-28
| | | | | | | | "schema." has been typed. This allows readline to complete subsequent characters immediately if all relations in the target schema start with the same prefix. This actually worked before, but I unintentionally broke it a few days ago. Also, make completion schema-aware for GRANT, REVOKE, VACUUM.
* Remove automatic '()' in other branch of UNION as well.Peter Eisentraut2003-10-17
|
* There should not be an automatic '()' after a function name whenPeter Eisentraut2003-10-16
| | | | tab-completing.
* Cause tab completion to do something moderately reasonable with mixed-caseTom Lane2003-10-16
| | | | | identifiers --- it will now complete these correctly with double quoting. Fix a few other issues in passing.
* Use PQescapeString to ensure that tab-completion queries are not messedTom Lane2003-10-14
| | | | | | | up by quotes or backslashes in words that are being matched to database names (per gripe from Ian Barwick, though I didn't use his patch). Also fix possible memory leakage if _complete_with_query isn't run to completion (not clear if that can happen or not, but be safe).
* Remove geqo_random_seed parameter. Having geqo reset the global random()Tom Lane2003-09-07
| | | | | | | | sequence every time it's called is bogus --- it interferes with user control over the seed, and actually decreases randomness overall (because a seed based on time(NULL) is pretty predictable). If you really want a reproducible result from geqo, do 'set seed = 0' before planning a query.
* 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
|
* Apply (a somewhat revised version of) Greg Mullane's patch to eliminateTom Lane2003-07-29
| | | | | | | | | heuristic determination of day vs month in date/time input. Add the ability to specify that input is interpreted as yy-mm-dd order (which formerly worked, but only for yy greater than 31). DateStyle's input component now has the preferred spellings DMY, MDY, or YMD; the older keywords European and US are now aliases for the first two of these. Per recent discussions on pgsql-general.
* Add GUC option log_error_verbosity to control which fields of errorTom Lane2003-06-30
| | | | | | reports get put into the postmaster log. Options are TERSE, DEFAULT, VERBOSE, with the same behavior as implemented on the client side in libpq.
* psql: tab completion for \encodingBruce Momjian2003-06-12
| | | | Ian Barwick
* Add add_missing_from GUC variable.Bruce Momjian2003-06-11
| | | | Nigel J. Andrews
* Add log_min_duration_statement.Bruce Momjian2003-06-11
| | | | Christopher Kings-Lynne
* Backend support for autocommit removed, per recent discussions. TheTom Lane2003-05-14
| | | | | | 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.
* const-ify functions used with completion_matches(), to suppressTom Lane2003-04-03
| | | | cast-away-const warnings from compilers pickier than gcc.
* Fix NULL casting warning, pointed out by Joe ConwayBruce Momjian2003-03-28
|
* Attached are two patches for psql's tab-completion.c.Bruce Momjian2003-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first cleans up a couple of minor errors and ommissions and adds tab completion support to more slash commands, e.g. \dv. The second is an attempt to add tab completion for schemas and fully qualified relation names (e.g. public.mytable ). I think this covers the TODO-item: "Allow psql to do table completion for SELECT * FROM schema_part and table completion for SELECT * FROM schema_name." This happens via union selects querying: - relation_name in current search path; - schema_name; - schema.relation_name matching the current input string. E.g: SELECT p[TAB] will produce a list of all appropriate relation names in the current search path which begin with 'p', and also all schema names which begin with 'p'; \d pub[TAB] will produce any relation names in the current search path and also any schema names beginning with 'pub'; \d public.[TAB] will produce a list of all relations in the schema 'public'; \d public.my[TAB] produces all relation names beginning with 'my' in schema 'public'. It seems to work for me; comments, suggestions, particularly regarding the coding and queries, are very welcome. Note that tables, indexes, views and sequences relations in the 'pg_catalog' namespace are excluded even though they are in the current search path. I found not doing this produced annoying behaviour when expanding names beginning with 'p'. People who work with system tables a lot may not like this though; I can look for another solution if necessary. Ian Barwick
* Create a GUC variable REGEX_FLAVOR to control the type of regularTom Lane2003-02-06
| | | | | | | | expression accepted by the regex operators, per discussion yesterday. Along the way, reduce deadlock_timeout from PGC_POSTMASTER to PGC_SIGHUP category. It is probably best to insist that all backends share the same setting, but that doesn't mean it has to be frozen at startup.