Skip to content

Commit 197ddf0

Browse files
committed
Add CREATE SCHEMA ... [IF NOT EXISTS]
Also removed duplicate TABLE in CREATE TABLE, and add COLUMN noise to ALTER TABLE
1 parent e0fde0b commit 197ddf0

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

doc/sql.extensions/README.ddl.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -676,22 +676,22 @@ already exists.
676676
For ALTER TABLE ... ADD subclause, DDL triggers are not fired if there are only IF NOT EXISTS subclauses and all
677677
of them are related to existing columns or constraints.
678678

679-
For others commands (except users currently) where IF NOT EXISTS is part of the main command,
679+
For other commands (except users currently) where IF NOT EXISTS is part of the main command,
680680
DDL triggers are not fired when the object already exists.
681681

682-
The engine only verifies if the name (object, column or constraint) already exists, and if yes, do nothing.
683-
It never tries to match the existing object with the one being created.
682+
The engine only verifies if the name (object, column or constraint) already exists, and if so, it does nothing.
683+
It does not try to match the definition of the existing object with the one being created.
684684

685-
Some objects share the same "namespace", for example, there cannot be a table and a procedure with the same name.
686-
In this case, if there is table XYZ and CREATE PROCEDURE IF NOT EXISTS XYZ is tried, the procedure will not be created
687-
and no error will be raised.
685+
Some objects share the same "namespace". For example, there cannot be a table and a procedure with the same name
686+
in the same schema. If there is a table XYZ and CREATE PROCEDURE IF NOT EXISTS XYZ is tried, the procedure will
687+
not be created, and no error will be raised.
688688

689689
The following statements are supported:
690690

691691
CREATE EXCEPTION [IF NOT EXISTS] ...
692692
CREATE INDEX [IF NOT EXISTS] ...
693693
CREATE PROCEDURE [IF NOT EXISTS] ...
694-
CREATE [{GLOBAL | LOCAL} TEMPORARY TABLE] TABLE [IF NOT EXISTS] ...
694+
CREATE [{GLOBAL | LOCAL} TEMPORARY] TABLE [IF NOT EXISTS] ...
695695
CREATE TRIGGER [IF NOT EXISTS] ...
696696
CREATE VIEW [IF NOT EXISTS] ...
697697
CREATE FILTER [IF NOT EXISTS] ...
@@ -707,7 +707,8 @@ CREATE USER [IF NOT EXISTS] ...
707707
CREATE PACKAGE [IF NOT EXISTS] ...
708708
CREATE PACKAGE BODY [IF NOT EXISTS] ...
709709
CREATE [GLOBAL] MAPPING [IF NOT EXISTS] ...
710-
ALTER TABLE <table> ADD [IF NOT EXISTS] <column name> ...
710+
CREATE SCHEMA [IF NOT EXISTS] ...
711+
ALTER TABLE <table> ADD [COLUMN] [IF NOT EXISTS] <column name> ...
711712
ALTER TABLE <table> ADD CONSTRAINT [IF NOT EXISTS] <constraint name> ...
712713

713714
8) Creation of an inactive index

0 commit comments

Comments
 (0)