From b6bdc43522ac4e4be891646dbdbb39adbe306a02 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Mon, 7 Sep 1998 15:53:12 +0000 Subject: [PATCH] Add new reference pages. This completes the first cut at a full set for SQL commands. --- doc/src/sgml/ref/commands.sgml | 23 ++- doc/src/sgml/ref/drop_aggregate.sgml | 193 ++++++++++++++++++++++++ doc/src/sgml/ref/drop_database.sgml | 174 ++++++++++++++++++++++ doc/src/sgml/ref/drop_index.sgml | 177 ++++++++++++++++++++++ doc/src/sgml/ref/drop_language.sgml | 197 +++++++++++++++++++++++++ doc/src/sgml/ref/drop_operator.sgml | 209 ++++++++++++++++++++++++++ doc/src/sgml/ref/drop_rule.sgml | 191 ++++++++++++++++++++++++ doc/src/sgml/ref/drop_sequence.sgml | 178 +++++++++++++++++++++++ doc/src/sgml/ref/drop_table.sgml | 210 +++++++++++++++++++++++++++ doc/src/sgml/ref/drop_trigger.sgml | 207 ++++++++++++++++++++++++++ doc/src/sgml/ref/drop_type.sgml | 196 +++++++++++++++++++++++++ doc/src/sgml/ref/drop_user.sgml | 183 +++++++++++++++++++++++ doc/src/sgml/ref/drop_view.sgml | 207 ++++++++++++++++++++++++++ 13 files changed, 2340 insertions(+), 5 deletions(-) create mode 100644 doc/src/sgml/ref/drop_aggregate.sgml create mode 100644 doc/src/sgml/ref/drop_database.sgml create mode 100644 doc/src/sgml/ref/drop_index.sgml create mode 100644 doc/src/sgml/ref/drop_language.sgml create mode 100644 doc/src/sgml/ref/drop_operator.sgml create mode 100644 doc/src/sgml/ref/drop_rule.sgml create mode 100644 doc/src/sgml/ref/drop_sequence.sgml create mode 100644 doc/src/sgml/ref/drop_table.sgml create mode 100644 doc/src/sgml/ref/drop_trigger.sgml create mode 100644 doc/src/sgml/ref/drop_type.sgml create mode 100644 doc/src/sgml/ref/drop_user.sgml create mode 100644 doc/src/sgml/ref/drop_view.sgml diff --git a/doc/src/sgml/ref/commands.sgml b/doc/src/sgml/ref/commands.sgml index 8b87a9857d..23b25a91de 100644 --- a/doc/src/sgml/ref/commands.sgml +++ b/doc/src/sgml/ref/commands.sgml @@ -1,8 +1,8 @@ - -Commands + +Commands - - + + &alterTable; &alterUser; @@ -26,7 +26,19 @@ &createView; &declare; &delete; +&dropAggregate; +&dropDatabase; &dropFunction; +&dropIndex; +&dropLanguage; +&dropOperator; +&dropRule; +&dropSequence; +&dropTable; +&dropTrigger; +&dropType +&dropUser; +&dropView; &explain; &fetch; &grant; @@ -44,7 +56,7 @@ &show; &update; - + SQL Functions @@ -59,6 +71,7 @@ + diff --git a/doc/src/sgml/ref/drop_database.sgml b/doc/src/sgml/ref/drop_database.sgml new file mode 100644 index 0000000000..d99d7d43e8 --- /dev/null +++ b/doc/src/sgml/ref/drop_database.sgml @@ -0,0 +1,174 @@ + + + + DROP DATABASE + + SQL - Language Statements + + + + DROP DATABASE + + + Destroys an existing database + + + + 1998-04-15 + + + DROP DATABASE name + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + name + + + + The name of an existing database to remove. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DESTROYDB + + + + This message is returned if the command is successful. + + + + + + WARN: destroydb: database "name" does not exist. + + + + This message occurs if the specified database does not exist. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + DROP DATABASE removes the catalog entries for an existing + database and deletes the directory containing the data. + It can only be executed by the database administrator + (See the CREATE DATABASE command for details). + + + + + 1998-04-15 + + + Notes + + + + + This query should NOT be executed interactively. + The destroydb script should be used instead. + + + Some explanation would be desirable here! + + + DROP DATABASE statement is a PostgreSQL language extension. + + + Refer to the CREATE DATABASE statement for + information on how to create a database. + + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + There is no DROP DATABASE statement in SQL92. + + + + + + diff --git a/doc/src/sgml/ref/drop_index.sgml b/doc/src/sgml/ref/drop_index.sgml new file mode 100644 index 0000000000..726487356e --- /dev/null +++ b/doc/src/sgml/ref/drop_index.sgml @@ -0,0 +1,177 @@ + + + + DROP INDEX + + SQL - Language Statements + + + + DROP INDEX + + + Removes an index from a database + + + + 1998-04-15 + + + DROP INDEX index_name + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + index_name + + + + The name of the index to remove. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + The message returned if the index is successfully dropped. + + + + + + ERROR: index "index_name" nonexistent + + + + This message occurs if it is impossible to drop the index + because it does not exist. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + DROP INDEX drops an existing index from the database + system. To execute this command you must be the owner of + the index. + + + + + 1998-04-15 + + + Notes + + + DROP INDEX is a PostgreSQL language extension. + + + Refer to the CREATE INDEX statement for + inforamtion on how to create indexes. + + + + + + Usage + + + This command will remove the title_idx index: + + + DROP INDEX title_idx; + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + There is no DROP INDEX statement on SQL92. + + + + + + + diff --git a/doc/src/sgml/ref/drop_language.sgml b/doc/src/sgml/ref/drop_language.sgml new file mode 100644 index 0000000000..09f0cc34d7 --- /dev/null +++ b/doc/src/sgml/ref/drop_language.sgml @@ -0,0 +1,197 @@ + + + + DROP LANGUAGE + + SQL - Language Statements + + + + DROP LANGUAGE + + + Removes a user-defined procedural language + + + + 1998-04-15 + + + DROP PROCEDURAL LANGUAGE 'langname' + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + langname + + + + The name of an existing language. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + This message is returned if the language is successfully dropped. + + + + + + + ERROR: Language "langname" doesn't exist + + + + This message occurs if the language + "langname" is + not found. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + DROP PROCEDURAL LANGUAGE will remove the definition + of the previously registered procedural language with the name + 'langname'. + + + + + 1998-04-15 + + + Notes + + + The DROP PROCEDURAL LANGUAGE statement is + a PostgreSQL language extension. + + + Refer to the CREATE PROCEDURAL LANGUAGE statement + for information on how to create procedural languages. + + + + + + 1998-04-15 + + + Bugs + + + No checks are made if functions or trigger procedures registered + in this language still exist. To re-enable them without having + to drop and recreate all the functions, the pg_proc's prolang + attribute of the functions must be adjusted to the new object + ID of the recreated pg_language entry for the PL. + + + + + + + Usage + + + This command removes the PL/Sample language: + + + DROP PROCEDURAL LANGUAGE 'plsample' + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + There is no DROP PROCEDURAL LANGUAGE statement on SQL92. + + + + + + + diff --git a/doc/src/sgml/ref/drop_operator.sgml b/doc/src/sgml/ref/drop_operator.sgml new file mode 100644 index 0000000000..4aa87863bf --- /dev/null +++ b/doc/src/sgml/ref/drop_operator.sgml @@ -0,0 +1,209 @@ + + + + DROP OPERATOR + + SQL - Language Statements + + + + DROP OPERATOR + + + Removes an operator from the database + + + + + + 1998-04-15 + + + DROP OPERATOR id ( type | NONE [,...] ); + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + id + + + + The identifier of an existing operator. + + + + + + type + + + + The type of function parameters. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + The message returned if the command is successful. + + + + + + ERROR: RemoveOperator: ... does not exist + + + + This message occurs if the operator specified doesn't exist. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + The DROP OPERATOR statement drops an existing operator from the + database. + To execute this command you must be the owner of the operator. + + + The left or right type of a left or right unary + operator, respectively, may be specified as NONE. + + + + + 1998-04-15 + + + Notes + + + The DROP OPERATOR statement is a PostgreSQL + language extension. + + + Refer to the CREATE OPERATOR statement for + information on how to create operators. + + + It is the user's responsibility to remove any access methods, + operator classes, and so on, that rely on the deleted operator. + + + + + + Usage + + + Remove power operator a^n for int4: + + + DROP OPERATOR ^ (int4, int4); + + + Remove left unary operator !a for booleans: + + + DROP OPERATOR ! (none, bool); + + + Remove right unary factorial operator a! for + int4: + + + DROP OPERATOR ! (int4, none); + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + There is no DROP OPERATOR statement in SQL92. + + + + + + diff --git a/doc/src/sgml/ref/drop_rule.sgml b/doc/src/sgml/ref/drop_rule.sgml new file mode 100644 index 0000000000..fce6095f18 --- /dev/null +++ b/doc/src/sgml/ref/drop_rule.sgml @@ -0,0 +1,191 @@ + + + + DROP RULE + + SQL - Language Statements + + + + DROP RULE + + + Removes an existing rule from the database + + + + 1998-04-15 + + + DROP RULE name + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + name + + + + The name of an existing rule to drop. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + Message returned if successfully. + + + + + + ERROR: RewriteGetRuleEventRel: rule "name" not found + + + + This message occurs if the specified rule does not exist. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + DROP RULE drops a rule from the specified PostgreSQL rule + system. PostgreSQL will immediately cease enforcing it and + will purge its definition from the system catalogs. + + + + + 1998-04-15 + + + Notes + + + The DROP RULE statement is a PostgreSQL + language extension. + + + Refer to the CREATE RULE statement for + information on how to create rules. + + + + + + 1998-04-15 + + + Bugs + + + Once a rule is dropped, access to historical information + the rule has written may disappear. + + + + + + + Usage + + + To drop the rewrite rule newrule: + + + DROP RULE newrule + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + There is no DROP RULE statement in SQL92. + + + + + + + diff --git a/doc/src/sgml/ref/drop_sequence.sgml b/doc/src/sgml/ref/drop_sequence.sgml new file mode 100644 index 0000000000..f60a1159c6 --- /dev/null +++ b/doc/src/sgml/ref/drop_sequence.sgml @@ -0,0 +1,178 @@ + + + + DROP SEQUENCE + + SQL - Language Statements + + + + DROP SEQUENCE + + + Removes an existing sequence + + + + 1998-04-15 + + + DROP SEQUENCE seqname [, ...] + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + seqname + + + + The name of a sequence. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + The message returned if the sequence is successfully dropped. + + + + + + WARN: Relation "seqname" does not exist. + + + + This message occurs if the sequence specified does not exist. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + DROP SEQUENCE removes sequence number generators from the + data base. With the current implementation of sequences as + special tables it works just like the DROP TABLE + statement. + + + + + 1998-04-15 + + + Notes + + + The DROP SEQUENCE statement is a PostgreSQL + language extension. + + + Refer to the CREATE SEQUENCE statement for + information on how to create a sequence. + + + + + + Usage + + + To remove sequence serial from database: + + + DROP SEQUENCE serial + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + There is no DROP SEQUENCE statement in SQL92. + + + + + + + diff --git a/doc/src/sgml/ref/drop_table.sgml b/doc/src/sgml/ref/drop_table.sgml new file mode 100644 index 0000000000..d913d74091 --- /dev/null +++ b/doc/src/sgml/ref/drop_table.sgml @@ -0,0 +1,210 @@ + + + + DROP TABLE + + SQL - Language Statements + + + + DROP TABLE + + + Removes existing tables from a database + + + + + 1998-04-15 + + + DROP TABLE table [, ...] + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + table + + + + The name of an existing table or view to drop. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + The message returned if the command completes successfully. + + + + + + ERROR Relation "table" Does Not Exist! + + + + If table/view specified doesn't exist into database. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + DROP TABLE removes tables and views from the database. + Only its owner may destroy a table or view. A table + may be emptied of rows, but not destroyed, by using DELETE. + + + If a table being destroyed has secondary indices on it, + they will be removed first. The removal of just a + secondary index will not affect the indexed table. + + + + + 1998-04-15 + + + Notes + + + Refer to the CREATE TABLE and + ALTER TABLE statements for information on + how to create or modify tables. + + + + + + + Usage + + + To destroy the films and + distributors tables: + + + DROP TABLE films, distributors + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + SQL92 specifies some additional capabilities for DROP TABLE: + + + DROP TABLE table { RESTRICT | CASCADE } + + + + RESTRICT + + + Ensures that only a table with no dependent views or + integrity constraints can be destroyed. + + + + + CASCADE + + + Any referencing views or integrity constraints + will also be dropped. + + + + + + + At present, to remove a referenced view you must drop + it by hand. + + + + + + + diff --git a/doc/src/sgml/ref/drop_trigger.sgml b/doc/src/sgml/ref/drop_trigger.sgml new file mode 100644 index 0000000000..bc0c5924ed --- /dev/null +++ b/doc/src/sgml/ref/drop_trigger.sgml @@ -0,0 +1,207 @@ + + + + DROP TRIGGER + + SQL - Language Statements + + + + DROP TRIGGER + + + Removes the definition of a trigger + + + + 1998-04-15 + + + DROP TRIGGER name ON table + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + name + + + + The name of an existing trigger. + + + + + + table + + + + The name of a table. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + The message returned if the trigger is successfully dropped. + + + + + + ERROR: DropTrigger: there is no trigger name on relation "table" + + + + This message occurs if the trigger specified does not exist. + + + + + + + + + + + + + + 1998-04-15 + + + Description + + + DROP TRIGGER will remove all references to an existing + trigger definition. To execute this command the current + user must be the owner of the trigger. + + + + + 1998-04-15 + + + Notes + + + The DROP TRIGGER statement is a PostgreSQL + language extension. + + + Refer to the CREATE TRIGGER statement for + information on how to create triggers. + + + + + + Usage + + + Destroy the if_dist_exists trigger on table films: + + + DROP TRIGGER if_dist_exists ON films; + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + There is no DROP TRIGGER statement in SQL92. + + + + + + + + diff --git a/doc/src/sgml/ref/drop_type.sgml b/doc/src/sgml/ref/drop_type.sgml new file mode 100644 index 0000000000..4f900e5b11 --- /dev/null +++ b/doc/src/sgml/ref/drop_type.sgml @@ -0,0 +1,196 @@ + + + + DROP TYPE + + SQL - Language Statements + + + + DROP TYPE + + + Removes a user-defined type from the system catalogs + + + + 1998-04-15 + + + DROP TYPE typename + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + typename + + + + The name of an existing type. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + The message returned if the command is successful. + + + + + + ERROR: RemoveType: type 'typename' does not exist + + + + This message occurs if the specified type is not found. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + DROP TYPE will remove a user type from the + system catalogs. + + + Only the owner of a type can remove it. + + + + + 1998-04-15 + + + Notes + + + DROP TYPE statement is a PostgreSQL language extension. + + + Refer to the CREATE TYPE statement for + inforamation on how to create types. + + + It is the user's responsibility to remove any operators, + functions, aggregates, access methods, subtypes, classes, + and so on, that use a deleted type. + + + + + + 1998-04-15 + + + Bugs + + + If a built-in type is removed, the behavior of the backend + is unpredictable. + + + + + + Usage + + + To remove the box type: + + + DROP TYPE box + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL3 + + + DROP TYPE is a SQL3 statement. + + + + + + + diff --git a/doc/src/sgml/ref/drop_user.sgml b/doc/src/sgml/ref/drop_user.sgml new file mode 100644 index 0000000000..a99e5005b7 --- /dev/null +++ b/doc/src/sgml/ref/drop_user.sgml @@ -0,0 +1,183 @@ + + + + DROP USER + + SQL - Language Statements + + + + DROP USER + + + Removes an user account information + + + + + 1998-04-15 + + + DROP USER username + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + username + + + + The name of an existing user. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + The message returned if the user is successfully deleted. + + + + + + ERROR: removeUser: user "username" does not exist. + + + + This message occurs if the username is not found. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + The DROP USER statement removes the named + user from the database, + along with any databases owned by the user. It + does not remove tables, views, or triggers owned by the + named user in databases not owned by the user. This statement + can be used in the place of the destroyuser + script, regardless of how the user was created. + + + + + 1998-04-15 + + + Notes + + + The DROP USER statement is a PostgreSQL + language extension. + + + Refer to the CREATE USER and + ALTER USER statements for information on + how to create or modify user accounts. + + + + + + Usage + + + To drop a user account: + + + DROP USER Jonathan; + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + There is no DROP USER statement on SQL92. + + + + + + + diff --git a/doc/src/sgml/ref/drop_view.sgml b/doc/src/sgml/ref/drop_view.sgml new file mode 100644 index 0000000000..9be7a94610 --- /dev/null +++ b/doc/src/sgml/ref/drop_view.sgml @@ -0,0 +1,207 @@ + + + + DROP VIEW + + SQL - Language Statements + + + + DROP VIEW + + + Removes an existing view from a database + + + + 1998-04-15 + + + DROP VIEW view + + + + + 1998-04-15 + + + Inputs + + + + + + + + + + + + + view + + + + The name of an existing view to drop. + + + + + + + + + + + + 1998-04-15 + + + Outputs + + + + + + + + + + + + + DROP + + + + The message returned if the command is successful. + + + + + + + ERROR: RewriteGetRuleEventRel: rule "_RETview" not found + + + + This message occurs if the specified view does not exist in + the database. + + + + + + + + + + + + + 1998-04-15 + + + Description + + + DROP VIEW drops an existing view from the database. + To execute this command you must be the owner of the + view. + + + + + 1998-04-15 + + + Notes + + + The PostgreSQL DROP TABLE statement also drops views. + + + Refer to the CREATE VIEW statement for information on how to create views. + + + + + + Usage + + + This command will remove the view called kinds: + + + DROP VIEW kinds + + + + + + Compatibility + + + + + + + 1998-04-15 + + + SQL92 + + + SQL92 specifies some additional capabilities for + DROP VIEW: + + + + DROP VIEW view {RESTRICT | CASCADE} + + + + RESTRICT + + + Ensures that only a view with no dependent views or + integrity constraints can be destroyed. + + + + + CASCADE + + + Any referencing views and integrity constraints + will be dropped as well. + + + + + + + At present, to remove a referenced view from a PostgreSQL database, + you must drop it by hand. + + + + + + +