Commit 40d55d2c authored by Bruce Momjian's avatar Bruce Momjian

Update psql help.

parent 600c958a
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* *
* Copyright (c) 1994, Regents of the University of California * Copyright (c) 1994, Regents of the University of California
* *
* $Id: psqlHelp.h,v 1.35 1997/12/29 01:13:16 momjian Exp $ * $Id: psqlHelp.h,v 1.36 1998/01/11 04:17:01 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -26,10 +26,17 @@ static struct _helpStruct QL_HELP[] = { ...@@ -26,10 +26,17 @@ static struct _helpStruct QL_HELP[] = {
"abort [transaction];"}, "abort [transaction];"},
{"alter table", {"alter table",
"add/rename attributes, rename tables", "add/rename attributes, rename tables",
"\talter table <class_name> [*] add column <attr> <type>;\n\talter table <class_name> [*] rename [column] <attr1> to <attr2>;\n\talter table <class_name1> rename to <class_name2>"}, "\talter table <class_name> [*] add column <attr> <type>;\n\
\talter table <class_name> [*] rename [column] <attr1> to <attr2>;\n\
\talter table <class_name1> rename to <class_name2>"},
{"alter user", {"alter user",
"alter system information for a user", "alter system information for a user",
"alter user <user_name>\n\t[with password <password>]\n\t[createdb | noccreatedb]\n\t[createuser | nocreateuser]\n\t[in group <group_1>, ..., <group_n>]\n\t[valid until '<abstime>'];"}, "alter user <user_name>\n\
\t[with password <password>]\n\
\t[createdb | noccreatedb]\n\
\t[createuser | nocreateuser]\n\
\t[in group <group_1>, ..., <group_n>]\n\
\t[valid until '<abstime>'];"},
{"begin", {"begin",
"begin a new transaction", "begin a new transaction",
"begin [transaction|work];"}, "begin [transaction|work];"},
...@@ -53,55 +60,123 @@ static struct _helpStruct QL_HELP[] = { ...@@ -53,55 +60,123 @@ static struct _helpStruct QL_HELP[] = {
"commit [work]"}, "commit [work]"},
{"copy", {"copy",
"copy data to and from a table", "copy data to and from a table",
"copy [binary] <class_name> [with oids]\n\t{to|from} {<filename>|stdin|stdout} [using delimiters <delim>];"}, "copy [binary] <class_name> [with oids]\n\
\t{to|from} {<filename>|stdin|stdout} [using delimiters <delim>];"},
{"create", {"create",
"Please be more specific:", "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"}, "\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", {"create aggregate",
"define an aggregate function", "define an aggregate function",
"create aggregate <agg_name> [as] (basetype = <data_type>, \n\t[sfunc1 = <sfunc_1>, stype1 = <sfunc1_return_type>]\n\t[sfunc2 = <sfunc_2>, stype2 = <sfunc2_return_type>]\n\t[,finalfunc = <final-function>]\n\t[,initcond1 = <initial-cond1>][,initcond2 = <initial-cond2>]);"}, "create aggregate <agg_name> [as] (basetype = <data_type>, \n\
\t[sfunc1 = <sfunc_1>, stype1 = <sfunc1_return_type>]\n\
\t[sfunc2 = <sfunc_2>, stype2 = <sfunc2_return_type>]\n\
\t[,finalfunc = <final-function>]\n\
\t[,initcond1 = <initial-cond1>][,initcond2 = <initial-cond2>]);"},
{"create database", {"create database",
"create a database", "create a database",
"create database <dbname> [with location = '<dbpath>']"}, "create database <dbname> [with location = '<dbpath>']"},
{"create function", {"create function",
"create a user-defined function", "create a user-defined function",
"create function <function_name> ([<type1>,...<typeN>]) returns <return_type>\n\tas '<object_filename>'|'<sql-queries>'\n\tlanguage 'c'|'sql'|'internal';"}, "create function <function_name> ([<type1>,...<typeN>]) returns <return_type>\n\
\tas '<object_filename>'|'<sql-queries>'\n\
\tlanguage 'c'|'sql'|'internal';"},
{"create index", {"create index",
"construct an index", "construct an index",
"create [unique] index <indexname> on <class_name> [using <access_method>]\n( <attr1> [<type_class1>] [,...] | <funcname>(<attr1>,...) [<type_class>] );"}, "create [unique] index <indexname> on <class_name> [using <access_method>]\n\
( <attr1> [<type_class1>] [,...] | <funcname>(<attr1>,...) [<type_class>] );"},
{"create operator", {"create operator",
"create a user-defined operator", "create a user-defined operator",
"create operator <operator_name> (\n\t[leftarg = <type1>][,rightarg = <type2>]\n\t,procedure = <func_name>,\n\t[,commutator = <com_op>][,negator = <neg_op>]\n\t[,restrict = <res_proc>][,hashes]\n\t[,join = <join_proc>][,sort = <sort_op1>...<sort_opN>]);"}, "create operator <operator_name> (\n\
\t[leftarg = <type1>][,rightarg = <type2>]\n\
\t,procedure = <func_name>,\n\
\t[,commutator = <com_op>][,negator = <neg_op>]\n\
\t[,restrict = <res_proc>][,hashes]\n\
\t[,join = <join_proc>][,sort = <sort_op1>...<sort_opN>]);"},
{"create rule", {"create rule",
"define a new rule", "define a new rule",
"create rule <rule_name> as on\n\t[select|update|delete|insert]\n\tto <object> [where <qual>]\n\tdo [instead] [<action>|nothing| [<actions>]];"}, "create rule <rule_name> as on\n\
\t[select|update|delete|insert]\n\
\tto <object> [where <qual>]\n\
\tdo [instead] [<action>|nothing| [<actions>]];"},
{"create sequence", {"create sequence",
"create a new sequence number generator", "create a new sequence number generator",
"create sequence <sequence_name>\n\t[increment <NUMBER>]\n\t[start <NUMBER>]\n\t[minvalue <NUMBER>]\n\t[maxvalue <NUMBER>]\n\t[cache <NUMBER>]\n\t[cycle];"}, "create sequence <sequence_name>\n\
\t[increment <NUMBER>]\n\
\t[start <NUMBER>]\n\
\t[minvalue <NUMBER>]\n\
\t[maxvalue <NUMBER>]\n\
\t[cache <NUMBER>]\n\
\t[cycle];"},
{"create table", {"create table",
"create a new table", "create a new table",
"create table <class_name>\n\t(<attr1> <type1> [default <expression>] [not null] [,...])\n\t[inherits (<class_name1>,...<class_nameN>)\n\t[[constraint <name>] check <condition> [,...] ]\n;"}, "create table <class_name>\n\
\t(<attr1> <type1> [default <expression>] [not null] [,...])\n\
\t[inherits (<class_name1>,...<class_nameN>)\n\
\t[[constraint <name>] check <condition> [,...] ]\n\
;"},
{"create trigger", {"create trigger",
"create a new trigger", "create a new trigger",
"create trigger <trigger_name> after|before event1 [or event2 [or event3] ]\n\ton <class_name> for each row|statement\n\texecute procedure <func_name> ([arguments]);\n\n\teventX is one of INSERT, DELETE, UPDATE"}, "create trigger <trigger_name> after|before event1 [or event2 [or event3] ]\n\
\ton <class_name> for each row|statement\n\
\texecute procedure <func_name> ([arguments]);\n\
\n\
\teventX is one of INSERT, DELETE, UPDATE"},
{"create type", {"create type",
"create a new user-defined base data type", "create a new user-defined base data type",
"create type <typename> (\n\tinternallength = (<number> | variable),\n\t[externallength = (<number>|variable),]\n\tinput=<input_function>, output = <output_function>\n\t[,element = <typename>][,delimiter=<character>][,default=\'<string>\']\n\t[,send = <send_function>][,receive = <receive_function>][,passedbyvalue]);"}, "create type <typename> (\n\
\tinternallength = (<number> | variable),\n\
\t[externallength = (<number>|variable),]\n\
\tinput=<input_function>, output = <output_function>\n\
\t[,element = <typename>][,delimiter=<character>][,default=\'<string>\']\n\
\t[,send = <send_function>][,receive = <receive_function>][,passedbyvalue]);"},
{"create user", {"create user",
"create a new user", "create a new user",
"create user <user_name>\n\t[with password <password>]\n\t[createdb | nocreatedb]\n\t[createuser | nocreateuser]\n\t[in group <group_1>, ..., <group_n>]\n\t[valid until '<abstime>'];"}, "create user <user_name>\n\
\t[with password <password>]\n\
\t[createdb | nocreatedb]\n\
\t[createuser | nocreateuser]\n\
\t[in group <group_1>, ..., <group_n>]\n\
\t[valid until '<abstime>'];"},
{"create view", {"create view",
"create a view", "create a view",
"create view <view_name> as select <expr1>[as <attr1>][,... <exprN>[as <attrN>]] [from <from_list>] [where <qual>];"}, "create view <view_name> as\n\
\tselect <expr1>[as <attr1>][,... <exprN>[as <attrN>]]\n\
\t[from <from_list>]\n\
\t[where <qual>]\n\
\t[group by <group_list>];"},
{"declare", {"declare",
"set up a cursor", "set up a cursor",
"declare <cursorname> [binary] cursor for\n\tselect [distinct]\n\t<expr1> [as <attr1>],...<exprN> [as <attrN>]\n\t[from <from_list>] [where <qual>]\n\t[order by <attr1> [using <op1>],... <attrN> [using <opN>]];"}, "declare <cursorname> [binary] cursor for\n\
\tselect [distinct]\n\
\t<expr1> [as <attr1>],...<exprN> [as <attrN>]\n\
\t[from <from_list>] [where <qual>]\n\
\t[order by <attr1> [using <op1>],... <attrN> [using <opN>]];"},
{"delete", {"delete",
"delete tuples", "delete tuples",
"delete from <class_name> [where <qual>];"}, "delete from <class_name> [where <qual>];"},
{"drop", {"drop",
"Please be more specific:", "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"}, "\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", {"drop aggregate",
"remove an aggregate function", "remove an aggregate function",
"drop aggregate <agg_name> <agg_type>|*;"}, "drop aggregate <agg_name> <agg_type>|*;"},
...@@ -152,10 +227,17 @@ static struct _helpStruct QL_HELP[] = { ...@@ -152,10 +227,17 @@ static struct _helpStruct QL_HELP[] = {
"fetch [forward|backward] [<number>|all] [in <cursorname>];"}, "fetch [forward|backward] [<number>|all] [in <cursorname>];"},
{"grant", {"grant",
"grant access control to a user or group", "grant access control to a user or group",
"grant <privilege[,privilege,...]> on <rel1>[,...<reln>] to \n[public | group <group> | <username>]\n\t privilege is {ALL | SELECT | INSERT | UPDATE | DELETE | RULE}"}, "grant <privilege[,privilege,...]> on <rel1>[,...<reln>] to \n\
[public | group <group> | <username>]\n\
\t privilege is {ALL | SELECT | INSERT | UPDATE | DELETE | RULE}"},
{"insert", {"insert",
"insert tuples", "insert tuples",
"insert into <class_name> [(<attr1>...<attrN>)]\n\t[values (<expr1>...<exprN>); |\n\tselect <expr1>,...<exprN> [from <from_clause>] [where <qual>];"}, "insert into <class_name> [(<attr1>...<attrN>)]\n\
\tvalues (<expr1>...<exprN>); |\n\
\tselect <expr1>,...<exprN>\n\
\t[from <from_clause>]\n\
\t[where <qual>]\n\
\t[group by <group_list>];"},
{"listen", {"listen",
"listen for notification on a relation", "listen for notification on a relation",
"listen <class_name>"}, "listen <class_name>"},
...@@ -173,7 +255,9 @@ static struct _helpStruct QL_HELP[] = { ...@@ -173,7 +255,9 @@ static struct _helpStruct QL_HELP[] = {
"reset {DateStyle | GEQO | R_PLANS}"}, "reset {DateStyle | GEQO | R_PLANS}"},
{"revoke", {"revoke",
"revoke access control from a user or group", "revoke access control from a user or group",
"revoke <privilege[,privilege,...]> on <rel1>[,...<reln>] from \n[public | group <group> | <username>]\n\t privilege is {ALL | SELECT | INSERT | UPDATE | DELETE | RULE}"}, "revoke <privilege[,privilege,...]> on <rel1>[,...<reln>] from \n\
[public | group <group> | <username>]\n\
\t privilege is {ALL | SELECT | INSERT | UPDATE | DELETE | RULE}"},
{"rollback", {"rollback",
"abort a transaction", "abort a transaction",
"rollback [transaction|work]"}, "rollback [transaction|work]"},
...@@ -183,11 +267,14 @@ static struct _helpStruct QL_HELP[] = { ...@@ -183,11 +267,14 @@ static struct _helpStruct QL_HELP[] = {
\t[into table <class_name>]\n\ \t[into table <class_name>]\n\
\t[from <from_list>]\n\ \t[from <from_list>]\n\
\t[where <qual>]\n\ \t[where <qual>]\n\
\t[group by <group_list>]\n\
\t[order by <attr1> [ASC | DESC] [using <op1>], ... <attrN> ]\n\ \t[order by <attr1> [ASC | DESC] [using <op1>], ... <attrN> ]\n\
\t[union [all] select ...];"}, \t[union [all] select ...];"},
{"set", {"set",
"set run-time environment", "set run-time environment",
"set DateStyle to {'ISO' | 'SQL' | 'Postgres' | 'European' | 'US' | 'NonEuropean'}\nset GEQO to {'ON[=#]' | 'OFF'}\nset R_PLANS to {'ON' | 'OFF'}"}, "set DateStyle to {'ISO' | 'SQL' | 'Postgres' | 'European' | 'US' | 'NonEuropean'}\n\
set GEQO to {'ON[=#]' | 'OFF'}\n\
set R_PLANS to {'ON' | 'OFF'}"},
{"show", {"show",
"show current run-time environment", "show current run-time environment",
"show {DateStyle | GEQO | R_PLANS}"}, "show {DateStyle | GEQO | R_PLANS}"},
...@@ -196,7 +283,9 @@ static struct _helpStruct QL_HELP[] = { ...@@ -196,7 +283,9 @@ static struct _helpStruct QL_HELP[] = {
"update <class_name> set <attr1>=<expr1>,...<attrN>=<exprN> [from <from_clause>] [where <qual>];"}, "update <class_name> set <attr1>=<expr1>,...<attrN>=<exprN> [from <from_clause>] [where <qual>];"},
{"vacuum", {"vacuum",
"vacuum the database, i.e. cleans out deleted records, updates statistics", "vacuum the database, i.e. cleans out deleted records, updates statistics",
"vacuum [verbose] [analyze]\n\tor\nvacuum [verbose] [analyze] table [analyze [(attr1, ... attrN)] ];"}, "vacuum [verbose] [analyze]\n\
\tor\n\
vacuum [verbose] [analyze] table [analyze [(attr1, ... attrN)] ];"},
{NULL, NULL, NULL} /* important to keep a NULL terminator {NULL, NULL, NULL} /* important to keep a NULL terminator
* here! */ * here! */
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment