~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/bin/psql/tab-complete.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-01 17:41:41 UTC
  • mfrom: (1.1.4 upstream)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20090701174141-jfmn9tt8e69m950x
Tags: 8.4.0-1
* Final 8.4.0 release. Major enhancements:
  - Windowing Functions
  - Common Table Expressions and Recursive Queries
  - Default and variadic parameters for functions
  - Parallel Restore
  - Column Permissions
  - Per-database locale settings
  - Improved hash indexes
  - Improved join performance for EXISTS and NOT EXISTS queries
  - Easier-to-use Warm Standby
  - Automatic sizing of the Free Space Map
  - Visibility Map (greatly reduces vacuum overhead for slowly-changing
    tables)
  - Version-aware psql (backslash commands work against older servers)
  - Support SSL certificates for user authentication
  - Per-function runtime statistics
  - Easy editing of functions in psql
  - New contrib modules: pg_stat_statements, auto_explain, citext,
    btree_gin 
  Upload to unstable, 8.4 is the new default. 
* debian/control: Build the versionless metapackages and have them point to
  8.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 *
4
4
 * Copyright (c) 2000-2009, PostgreSQL Global Development Group
5
5
 *
6
 
 * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.183 2009/04/08 04:05:16 momjian Exp $
 
6
 * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.184 2009/06/11 14:49:08 momjian Exp $
7
7
 */
8
8
 
9
9
/*----------------------------------------------------------------------
125
125
 * Communication variables set by COMPLETE_WITH_FOO macros and then used by
126
126
 * the completion callback functions.  Ugly but there is no better way.
127
127
 */
128
 
static const char *completion_charp;                    /* to pass a string */
 
128
static const char *completion_charp;    /* to pass a string */
129
129
static const char *const * completion_charpp;   /* to pass a list of strings */
130
130
static const char *completion_info_charp;               /* to pass a second string */
131
131
static const char *completion_info_charp2;              /* to pass a third string */
693
693
        {
694
694
                static const char *const list_ALTER[] =
695
695
                {"AGGREGATE", "CONVERSION", "DATABASE", "DOMAIN", "FOREIGN DATA WRAPPER", "FUNCTION",
696
 
                "GROUP", "INDEX", "LANGUAGE", "OPERATOR", "ROLE", "SCHEMA", "SERVER", "SEQUENCE", "TABLE",
 
696
                        "GROUP", "INDEX", "LANGUAGE", "OPERATOR", "ROLE", "SCHEMA", "SERVER", "SEQUENCE", "TABLE",
697
697
                "TABLESPACE", "TEXT SEARCH", "TRIGGER", "TYPE", "USER", "USER MAPPING FOR", "VIEW", NULL};
698
698
 
699
699
                COMPLETE_WITH_LIST(list_ALTER);
1673
1673
        {
1674
1674
                static const char *const list_privileg[] =
1675
1675
                {"SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES",
1676
 
                 "TRIGGER", "CREATE", "CONNECT", "TEMPORARY", "EXECUTE", "USAGE",
1677
 
                 "ALL", NULL};
 
1676
                        "TRIGGER", "CREATE", "CONNECT", "TEMPORARY", "EXECUTE", "USAGE",
 
1677
                "ALL", NULL};
1678
1678
 
1679
1679
                COMPLETE_WITH_LIST(list_privileg);
1680
1680
        }
1755
1755
                COMPLETE_WITH_ATTR(prev_wd, "");
1756
1756
 
1757
1757
        /*
1758
 
         * Complete INSERT INTO <table> with "VALUES" or "SELECT" or
1759
 
         * "TABLE" or "DEFAULT VALUES"
 
1758
         * Complete INSERT INTO <table> with "VALUES" or "SELECT" or "TABLE" or
 
1759
         * "DEFAULT VALUES"
1760
1760
         */
1761
1761
        else if (pg_strcasecmp(prev3_wd, "INSERT") == 0 &&
1762
1762
                         pg_strcasecmp(prev2_wd, "INTO") == 0)
1766
1766
 
1767
1767
                COMPLETE_WITH_LIST(list_INSERT);
1768
1768
        }
1769
 
        /* Complete INSERT INTO <table> (attribs) with "VALUES" or "SELECT" or "TABLE" */
 
1769
 
 
1770
        /*
 
1771
         * Complete INSERT INTO <table> (attribs) with "VALUES" or "SELECT" or
 
1772
         * "TABLE"
 
1773
         */
1770
1774
        else if (pg_strcasecmp(prev4_wd, "INSERT") == 0 &&
1771
1775
                         pg_strcasecmp(prev3_wd, "INTO") == 0 &&
1772
1776
                         prev_wd[strlen(prev_wd) - 1] == ')')