/*------------------------------------------------------------------------- * * psqlHelp.h-- * Help for query language syntax * * Copyright (c) 1994, Regents of the University of California * * $Id: psqlHelp.h,v 1.39 1998/01/22 23:05:09 momjian Exp $ * *------------------------------------------------------------------------- */ struct _helpStruct { char *cmd; /* the command name */ char *help; /* the help associated with it */ char *syntax; /* the syntax associated with it */ }; static struct _helpStruct QL_HELP[] = { {"abort", "abort the current transaction", "abort [transaction];"}, {"abort transaction", "abort the current transaction", "abort [transaction];"}, {"alter table", "add/rename attributes, rename tables", "\talter table [*] add column ;\n\ \talter table [*] rename [column] to ;\n\ \talter table rename to "}, {"alter user", "alter system information for a user", "alter user \n\ \t[with password ]\n\ \t[createdb | noccreatedb]\n\ \t[createuser | nocreateuser]\n\ \t[in group , ..., ]\n\ \t[valid until ''];"}, {"begin", "begin a new transaction", "begin [transaction|work];"}, {"begin transaction", "begin a new transaction", "begin [transaction|work];"}, {"begin work", "begin a new transaction", "begin [transaction|work];"}, {"cluster", "create a clustered index (from an existing index)", "cluster on "}, {"close", "close an existing cursor (cursor)", "close ;"}, {"commit", "commit a transaction", "commit [work]"}, {"commit work", "commit a transaction", "commit [work]"}, {"copy", "copy data to and from a table", "copy [binary] [with oids]\n\ \t{to|from} {|stdin|stdout} [using delimiters ];"}, {"create", "Please be more specific:", "\tcreate aggregate\n\ \tcreate database\n\ \tcreate function\n\ \tcreate index\n\ \tcreate operator\n\ \tcreate rule\n\ \tcreate sequence\n\ \tcreate table\n\ \tcreate trigger\n\ \tcreate type\n\ \tcreate view"}, {"create aggregate", "define an aggregate function", "create aggregate [as] (basetype = , \n\ \t[sfunc1 = , stype1 = ]\n\ \t[sfunc2 = , stype2 = ]\n\ \t[,finalfunc = ]\n\ \t[,initcond1 = ][,initcond2 = ]);"}, {"create database", "create a database", "create database [with location = '']"}, {"create function", "create a user-defined function", "create function ([,...]) returns \n\ \tas ''|''\n\ \tlanguage 'c'|'sql'|'internal';"}, {"create index", "construct an index", "create [unique] index on [using ]\n\ ( [] [,...] | (,...) [] );"}, {"create operator", "create a user-defined operator", "create operator (\n\ \t[leftarg = ][,rightarg = ]\n\ \t,procedure = ,\n\ \t[,commutator = ][,negator = ]\n\ \t[,restrict = ][,hashes]\n\ \t[,join = ][,sort = ...]);"}, {"create rule", "define a new rule", "create rule as on\n\ \t[select|update|delete|insert]\n\ \tto [where ]\n\ \tdo [instead] [|nothing| []];"}, {"create sequence", "create a new sequence number generator", "create sequence \n\ \t[increment ]\n\ \t[start ]\n\ \t[minvalue ]\n\ \t[maxvalue ]\n\ \t[cache ]\n\ \t[cycle];"}, {"create table", "create a new table", "create table \n\ \t( [default ] [not null] [,...])\n\ \t[inherits (,...)\n\ \t[[constraint ] check [,...] ]\n\ ;"}, {"create trigger", "create a new trigger", "create trigger after|before event1 [or event2 [or event3] ]\n\ \ton for each row|statement\n\ \texecute procedure ([arguments]);\n\ \n\ \teventX is one of INSERT, DELETE, UPDATE"}, {"create type", "create a new user-defined base data type", "create type (\n\ \tinternallength = ( | variable),\n\ \t[externallength = (|variable),]\n\ \tinput=, output = \n\ \t[,element = ][,delimiter=][,default=\'\']\n\ \t[,send = ][,receive = ][,passedbyvalue]);"}, {"create user", "create a new user", "create user \n\ \t[with password ]\n\ \t[createdb | nocreatedb]\n\ \t[createuser | nocreateuser]\n\ \t[in group , ..., ]\n\ \t[valid until ''];"}, {"create view", "create a view", "create view as\n\ \tselect\n\ \t[as ][,... [as ]]\n\ \t[from ]\n\ \t[where ]\n\ \t[group by ];"}, {"declare", "set up a cursor", "declare [binary] cursor for\n\ \tselect [distinct]\n\ \t [as ],... [as ]\n\ \t[from ]\n\ \t[where ]\n\ \t[group by ]\n\ \t[order by [using ],... [using ]]\n\ \t[union [all] select ...];"}, {"delete", "delete tuples", "delete from [where ];"}, {"drop", "Please be more specific:", "\tdrop aggregate\n\ \tdrop database\n\ \tdrop function\n\ \tdrop index\n\ \tdrop operator\n\ \tdrop rule\n\ \tdrop sequence\n\ \tdrop table\n\ \tdrop trigger\n\ \tdrop type\n\ \tdrop view"}, {"drop aggregate", "remove an aggregate function", "drop aggregate |*;"}, {"drop database", "remove a database", "drop database "}, {"drop function", "remove a user-defined function", "drop function ([,....]);"}, {"drop index", "remove an existing index", "drop index ;"}, {"drop operator", "remove a user-defined operator", "drop operator ([|none],[|none]);"}, {"drop rule", "remove a rule", "drop rule ;"}, {"drop sequence", "remove a sequence number generator", "drop sequence [,...[,... on ;"}, {"drop type", "remove a user-defined base type", "drop type ;"}, {"drop user", "remove a user from the system", "drop user ;"}, {"drop view", "remove a view", "drop view "}, {"end", "end the current transaction", "end [transaction];"}, {"end transaction", "end the current transaction", "end [transaction];"}, {"explain", "explain the query execution plan", "explain [verbose] "}, {"fetch", "retrieve tuples from a cursor", "fetch [forward|backward] [|all] [in ];"}, {"grant", "grant access control to a user or group", "grant on [,...] to \n\ [public | group | ]\n\ \t privilege is {ALL | SELECT | INSERT | UPDATE | DELETE | RULE}"}, {"insert", "insert tuples", "insert into [(...)]\n\ \tvalues (...); |\n\ \tselect [distinct]\n\ \t,...\n\ \t[from ]\n\ \t[where ]\n\ \t[group by ]\n\ \t[union [all] select ...];"}, {"listen", "listen for notification on a relation", "listen "}, {"load", "dynamically load a module", "load ;"}, {"lock", "exclusive lock a table inside a transaction", "lock ;"}, {"move", "move an cursor position", "move [forward|backward] [|all] [in ];"}, {"notify", "signal all frontends and backends listening on a relation", "notify "}, {"reset", "set run-time environment back to default", "reset {DateStyle | GEQO | R_PLANS}"}, {"revoke", "revoke access control from a user or group", "revoke on [,...] from \n\ [public | group | ]\n\ \t privilege is {ALL | SELECT | INSERT | UPDATE | DELETE | RULE}"}, {"rollback", "abort a transaction", "rollback [transaction|work]"}, {"select", "retrieve tuples", "select [distinct on ] [as ], ... [as ]\n\ \t[into table ]\n\ \t[from ]\n\ \t[where ]\n\ \t[group by ]\n\ \t[order by [ASC | DESC] [using ], ... ]\n\ \t[union [all] select ...];"}, {"set", "set run-time environment", "set DateStyle to {'ISO' | 'SQL' | 'Postgres' | 'European' | 'US' | 'NonEuropean'}\n\ set GEQO to {'ON[=#]' | 'OFF'}\n\ set R_PLANS to {'ON' | 'OFF'}"}, {"show", "show current run-time environment", "show {DateStyle | GEQO | R_PLANS}"}, {"update", "update tuples", "update set =,...= [from ] [where ];"}, {"vacuum", "vacuum the database, i.e. cleans out deleted records, updates statistics", "vacuum [verbose] [analyze]\n\ \tor\n\ vacuum [verbose] [analyze] table [analyze [(attr1, ... attrN)] ];"}, {NULL, NULL, NULL} /* important to keep a NULL terminator * here! */ };