# # Help for query language syntax # # Original source code is written by C. # Copyright (c) 1996, Regents of the University of California # # ruby version is written by ematsu # Copyright (c) 1997 Eiji-usagi-MATSUmoto # # $Id: psqlHelp.rb,v 1.1.1.2 2002/04/24 05:46:44 noboru Exp $ 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 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 ] (|(,...) []);"], [ "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 table", "create a new table", "create table ( ,... )\n\t[inherits (,...\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 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 [with {cost|plan|full}] "], [ "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 ];"], [ "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]];" ], [ "update", "update tuples", "update set =,...= [from ] [where ];"], [ "vacuum", "vacuum the database, i.e. cleans out deleted records, updates statistics", "vacuum [table];"] ]