/*------------------------------------------------------------------------- * * psqlHelp.h-- * Help for query language syntax * * Copyright (c) 1994, Regents of the University of California * * $Id: psqlHelp.h,v 1.26 1997/10/01 19:14:35 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 "}, {"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 more be 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 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 "}, {"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 ( [not null] [default ],...)\n\t[inherits (,...)\n\t[constraint check () [,check ()]\n\tarchive=\n\tstore=\n\tarch_store=];"}, {"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 view", "create a view", "create view as select [as ][,... [as ]] [from ] [where ];"}, {"declare", "set up a cursor", "declare [binary] cursor for\n\tselect [distinct]\n\t [as ],... [as ]\n\t[from ] [where ]\n\t[order by [using ],... [using ]];"}, {"delete", "delete tuples", "delete from [where ];"}, {"drop", "Please more be 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 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 table", "remove a table", "drop table [,...[,...;"}, {"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\t[values (...); |\n\tselect ,... [from ] [where ];"}, {"listen", "listen for notification on a relation", "listen "}, {"load", "dynamically load a module", "load ;"}, {"notify", "signal all frontends and backends listening on a relation", "notify "}, {"purge", "purge historical data", "purge [before ] [after ];"}, {"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 ] [from ]\n\t[where ]\n\t[order by \n\t\t[using ],.. [[using ] | ASC | DESC]];"}, {"set", "set run-time environment", "set DateStyle to {'ISO' | 'SQL' | 'Postgres' | 'European' | 'US' | 'NonEuropean'}\nset GEQO to {'ON[=#]' | 'OFF'}\nset 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\nvacuum [verbose] [analyze] table [analyze [(attr1, ... attrN)] ];"}, {NULL, NULL, NULL} /* important to keep a NULL terminator * here! */ };