*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: psqlHelp.h,v 1.47 1998/07/24 03:32:12 scrappy Exp $
+ * $Id: psqlHelp.h,v 1.48 1998/07/25 00:17:29 momjian Exp $
*
*-------------------------------------------------------------------------
*/
"abort [transaction];"},
{"alter table",
"add/rename attributes, rename tables",
- "\t
alter table [*] add column \n\
-\t
alter table [*] rename [column] to \n\
-\talter table rename to "},
+ "\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 system information for a user",
- "alter user \n\
-\t[createdb | noccreatedb]\n\
-\t[createuser | nocreateuser]\n\
-\t[in group , ..., ]\n\
- {"begin",
- "begin a new transaction",
- "begin [transaction|work];"},
- {"begin transaction",
- "begin a new transaction",
- "begin [transaction|work];"},
+ "ALTER USER user_name\n\
+\t[WITH PASSWORD password]\n\
+\t[CREATEDB | NOCCREATEDB]\n\
+\t[CREATEUSER | NOCREATEUSER]\n\
+\t[IN GROUP group_1, ...groupN]\n\
+\t[VALID UNTIL 'abstime'];"},
{"begin work",
"begin a new transaction",
- "begin [transaction|work];"},
+ "BEGIN [TRANSACTION|WORK];"},
{"cluster",
"create a clustered index (from an existing index)",
- "cluster on "},
+ "CLUSTER index_name ON relation_name"},
{"close",
"close an existing cursor (cursor)",
- "close ;"},
- {"commit",
- "commit a transaction",
- "commit [work]"},
+ "CLOSE cursorname;"},
{"commit work",
"commit a transaction",
- "commit [work]"},
+ "COMMIT [TRANSACTION|WORK]"},
{"copy",
"copy data to and from a table",
- "copy [binary] [with oids]\n\
-\t{to|from} {|stdin|stdout} [using delimiters ];"},
+ "COPY [BINARY] class_name [WITH OIDS]\n\
+\tTO|FROM filename|STDIN|STDOUT [USING DELIMITERS 'delim'];"},
{"create",
"Please be more specific:",
"\tcreate aggregate\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 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 a database",
- "create database [with location = '']"},
+ "CREATE DATABASE dbname [WITH LOCATION = 'dbpath']"},
{"create function",
"create a user-defined function",
- "create function ([,...]) returns \n\
-\tas ''|''\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",
"construct an index",
- "
create [unique] index on [using ]\n\
-(
[] [,...] | (,...) [] );"},
+ "CREATE [UNIQUE] INDEX indexname ON class_name [USING access_method]\n\
+( attr1 [type_class1], ...attrN | funcname(attr1, ...) [type_class] );"},
{"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 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",
"define a new rule",
- "create rule as on\n\
-\t[select|update|delete|insert]\n\
-\tto ]\n\
-\t
do [instead] [|nothing| []];"},
+ "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 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 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 a new table",
- "create table \n\
-\t(
[default ] [not null] [,...])\n\
-\t[inherits (,...)\n\
-\t[[constraint ] check [,...] ]\n\
+ "CREATE TABLE class_name\n\
+\t(attr1 type1 [DEFAULT expression] [NOT NULL], ...attrN)\n\
+\t[INHERITS (class_name1, ...class_nameN)\n\
+\t[[CONSTRAINT name] CHECK condition1, ...conditionN] ]\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\
+ "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 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 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=\'\']\n\
+\t[,SEND = send_function][,RECEIVE = receive_function][,PASSEDBYVALUE]);"},
{"create user",
"create a new user",
- "create user \n\
-\t[createdb | nocreatedb]\n\
-\t[createuser | nocreateuser]\n\
-\t[in group , ..., ]\n\
+ "CREATE USER user_name\n\
+\t[WITH PASSWORD password]\n\
+\t[CREATEDB | NOCREATEDB]\n\
+\t[CREATEUSER | NOCREATEUSER]\n\
+\t[IN GROUP group1, ...groupN]\n\
+\t[VALID UNTIL 'abstime'];"},
{"create view",
"create a view",
- "create view as\n\
-\tselect [distinct [on attrN]]\n\
-\t[from ]\n\
-\t[where ]\n\
-\t[group by ];"},
+ "CREATE VIEW view_name AS\n\
+\tSELECT [DISTINCT [ON attrN]]\n\
+\texpr1 [AS attr1], ...exprN\n\
+\t[FROM from_list]\n\
+\t[WHERE qual]\n\
+\t[GROUP BY group_list];"},
{"declare",
"set up a cursor",
- "declare [binary] cursor for\n\
-\tselect [distinct [on attrN]]\n\
-\t[from ]\n\
-\t[where ]\n\
-\t[group by ]\n\
-\t[having ]\n\
-\t[
order by [using ],... [using ]]\n\
-\t[union [all] select ...];"},
+ "DECLARE cursorname [BINARY] CURSOR FOR\n\
+\tSELECT [DISTINCT [ON attrN]]\n\
+\texpr1 [AS attr1], ...exprN\n\
+\t[FROM from_list]\n\
+\t[WHERE qual]\n\
+\t[GROUP BY group_list]\n\
+\t[HAVING having_clause]\n\
+\t[ORDER BY attr1 [USING op1], ...attrN]\n\
+\t[UNION [ALL] SELECT ...];"},
{"delete",
"delete tuples",
- "delete from [where ];"},
+ "DELETE FROM class_name [WHERE qual];"},
{"drop",
"Please be more specific:",
"\tdrop aggregate\n\
\tdrop view"},
{"drop aggregate",
"remove an aggregate function",
+ "DROP AGGREGATE agg_name agg_type|*;"},
{"drop database",
"remove a database",
- "drop database "},
+ "DROP DATABASE dbname"},
{"drop function",
"remove a user-defined function",
- "drop function ([,....]);"},
+ "DROP FUNCTION funcname ([type1, ...typeN]);"},
{"drop index",
"remove an existing index",
- "drop index ;"},
+ "DROP INDEX indexname;"},
{"drop operator",
"remove a user-defined operator",
- "drop operator ([|none],[|none]);"},
+ "DROP OPERATOR operator_name ([ltype|NONE],[RTYPE|none]);"},
{"drop rule",
"remove a rule",
- "drop rule ;"},
+ "DROP RULE rulename;"},
{"drop sequence",
"remove a sequence number generator",
- "drop sequence [,...<sequence_nameN];"},
+ "DROP SEQUENCE sequence_name[, ...sequence_nameN];"},
{"drop table",
"remove a table",
- "drop table [,...;"},
+ "DROP TABLE class_name1, ...class_nameN;"},
{"drop trigger",
"remove a trigger",
- "drop trigger on ;"},
+ "DROP TRIGGER trigger_name ON class_name;"},
{"drop type",
"remove a user-defined base type",
- "drop type ;"},
+ "DROP TYPE typename;"},
{"drop user",
"remove a user from the system",
- "drop user ;"},
+ "DROP USER user_name;"},
{"drop view",
"remove a view",
- "drop view "},
- {"end",
- "end the current transaction",
- "end [transaction];"},
+ "DROP VIEW view_name"},
{"end transaction",
"end the current transaction",
- "end [transaction];"},
+ "END [TRANSACTION|WORK];"},
{"explain",
"explain the query execution plan",
- "explain [verbose] "},
+ "EXPLAIN [VERBOSE] query"},
{"fetch",
"retrieve tuples from a cursor",
- "fetch [forward|backward] [|all] [in ];"},
+ "FETCH [FORWARD|BACKWARD] [number|ALL] [IN cursorname];"},
{"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}"},
+ "GRANT privilege1, ...privilegeN ON rel1, ...relN TO \n\
+[PUBLIC|GROUP group|username]\n\
+\t privilege is ALL|SELECT|INSERT|UPDATE|DELETE|RULE"},
{"insert",
"insert tuples",
- "
insert into [(...)]\n\
-\tvalues (...) |\n\
-\tselect [distinct [on attrN]]\n\
-\t,...\n\
-\t[from ]\n\
-\t[where ]\n\
-\t[group by ]\n\
-\t[having ]\n\
-\t[union [all] select ...];"},
+ "INSERT INTO class_name [(attr1, ...attrN)]\n\
+\tVALUES (expr1,..exprN) |\n\
+\tSELECT [DISTINCT [ON attrN]]\n\
+\texpr1, ...exprN\n\
+\t[FROM from_clause]\n\
+\t[WHERE qual]\n\
+\t[GROUP BY group_list]\n\
+\t[HAVING having_clause]\n\
+\t[UNION [ALL] SELECT ...];"},
{"listen",
"listen for notification on a relation",
- "listen "},
+ "LISTEN class_name"},
{"load",
"dynamically load a module",
- "load ;"},
+ "LOAD 'filename';"},
{"lock",
"exclusive lock a table inside a transaction",
- "lock [table] ;"},
+ "LOCK [TABLE] class_name;"},
{"move",
"move an cursor position",
- "move [forward|backward] [|all] [in ];"},
+ "MOVE [FORWARD|BACKWARD] [number|ALL] [IN cursorname];"},
{"notify",
"signal all frontends and backends listening on a relation",
- "notify "},
+ "NOTIFY class_name"},
{"reset",
"set run-time environment back to default",
#ifdef MULTIBYTE
- "reset {DateStyle | GEQO | R_PLANS | CLIENT_ENCODING}"},
+ "RESET DateStyle|GEQO|R_PLANS|CLIENT_ENCODING"},
#else
- "reset {DateStyle | GEQO | R_PLANS}"},
+ "RESET DateStyle|GEQO|R_PLANS"},
#endif
{"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}"},
+ "REVOKE privilege1, ...privilegeN ON rel1, ...relN FROM \n\
+[PUBLIC|GROUP group|username]\n\
+\t privilege is ALL|SELECT|INSERT|UPDATE|DELETE|RULE"},
{"rollback",
"abort a transaction",
- "rollback [transaction|work]"},
+ "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[having ]\n\
-\t[
order by [ASC | DESC] [using ], ... ]\n\
-\t[union [all] select ...];"},
+ "SELECT [DISTINCT [ON attrN]] expr1 [AS attr1], ...exprN\n\
+\t[INTO [TABLE] class_name]\n\
+\t[FROM from_list]\n\
+\t[WHERE qual]\n\
+\t[GROUP BY group_list]\n\
+\t[HAVING having_clause]\n\
+\t[ORDER BY attr1 [ASC|DESC] [USING op1], ...attrN ]\n\
+\t[UNION [ALL] SELECT ...];"},
{"set",
"set run-time environment",
#ifdef MULTIBYTE
- "set DateStyle to {'ISO' | 'SQL' | 'Postgres' | 'European' | 'US' | 'NonEuropean'}\n\
-set GEQO to {'ON[=#]' | 'OFF'}\n\
-set R_PLANS to {'ON' | 'OFF'}\n\
-set CLIENT_ENCODING to {'EUC_JP' | 'SJIS' | 'EUC_CN' | 'EUC_KR' | 'EUC_TW' | 'MULE_INTERNAL' | 'LATIN1' | 'LATIN2' | 'LATIN3' | 'LATIN4' | 'LATIN5'}"},
+ "SET DateStyle TO 'ISO'|'SQL'|'Postgres'|'European'|'US'|'NonEuropean'\n\
+set GEQO TO 'ON[=#]'|'OFF'\n\
+set R_PLANS TO 'ON'|'OFF'\n\
+set CLIENT_ENCODING TO 'EUC_JP'|'SJIS'|'EUC_CN'|'EUC_KR'|'EUC_TW'|'MULE_INTERNAL'|'LATIN1'|'LATIN2'|'LATIN3'|'LATIN4'|'LATIN5'"},
#else
- "set DateStyle to {'ISO' | 'SQL' | 'Postgres' | 'European' | 'US' | 'NonEuropean'}\n\
-set GEQO to {'ON[=#]' | 'OFF'}\n\
-set 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'"},
#endif
{"show",
"show current run-time environment",
#ifdef MULTIBYTE
- "show {DateStyle | GEQO | R_PLANS | CLIENT_ENCODING}"},
+ "SHOW DateStyle|GEQO|R_PLANS|CLIENT_ENCODING"},
#else
- "show {DateStyle | GEQO | R_PLANS}"},
+ "SHOW DateStyle|GEQO|R_PLANS"},
#endif
- {"update",
+ {"UPDATE",
"update tuples",
- "update
set =,...= [from ] [where ];"},
+ "UPDATE class_name SET attr1 = expr1, ...attrN = exprN\n\
+\t [FROM from_clause]\n\
+\t[WHERE qual];"},
{"vacuum",
"vacuum the database, i.e. cleans out deleted records, updates statistics",
- "\
-vacuum [verbose] [analyze] [table]\n\
+ "VACUUM [VERBOSE] [ANALYZE] [table]\n\
\tor\n\
-vacuum [verbose] analyze [table [(attr1, ... attrN)]];"},
+VACUUM [VERBOSE] ANALYZE [table [(attr1, ...attrN)]];"},
{NULL, NULL, NULL} /* important to keep a NULL terminator
* here! */
};