Back out domain patch until it works properly.
authorBruce Momjian
Thu, 7 Mar 2002 16:35:41 +0000 (16:35 +0000)
committerBruce Momjian
Thu, 7 Mar 2002 16:35:41 +0000 (16:35 +0000)
32 files changed:
doc/dominfo.txt [deleted file]
doc/src/sgml/catalogs.sgml
doc/src/sgml/ref/allfiles.sgml
doc/src/sgml/ref/comment.sgml
doc/src/sgml/ref/create_domain.sgml [deleted file]
doc/src/sgml/ref/drop_domain.sgml [deleted file]
doc/src/sgml/reference.sgml
src/backend/catalog/heap.c
src/backend/catalog/pg_type.c
src/backend/commands/creatinh.c
src/backend/commands/define.c
src/backend/commands/remove.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/optimizer/prep/preptlist.c
src/backend/parser/gram.y
src/backend/parser/keywords.c
src/backend/parser/parse_coerce.c
src/backend/parser/parse_expr.c
src/backend/tcop/utility.c
src/backend/utils/adt/format_type.c
src/backend/utils/cache/lsyscache.c
src/backend/utils/cache/relcache.c
src/include/catalog/heap.h
src/include/catalog/pg_attribute.h
src/include/catalog/pg_class.h
src/include/catalog/pg_type.h
src/include/commands/defrem.h
src/include/nodes/nodes.h
src/include/nodes/parsenodes.h
src/include/parser/parse_coerce.h
src/include/utils/lsyscache.h

diff --git a/doc/dominfo.txt b/doc/dominfo.txt
deleted file mode 100644 (file)
index a439ff6..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-
-
--- Test Comment / Drop
-create domain domaindroptest int4;
-comment on domain domaindroptest is 'About to drop this..';
-
-select * from pg_type where typname = 'domaindroptest';
-
-drop domain domaindroptest restrict;
-
-select * from pg_type where typname = 'domaindroptest';
-
--- TEST Domains.
-
-create domain domainvarchar varchar(5);
-create domain domainnumeric numeric(8,2);
-create domain domainint4 int4;
-create domain domaintext text;
-
-
--- Test tables using domains
-create table basictest
-           ( testint4 domainint4
-           , testtext domaintext
-           , testvarchar domainvarchar
-           , testnumeric domainnumeric
-           );
-
-INSERT INTO basictest values ('88', 'haha', 'short', '123.12');      -- Good
-INSERT INTO basictest values ('88', 'haha', 'short text', '123.12'); -- Bad varchar
-INSERT INTO basictest values ('88', 'haha', 'short', '123.1212');    -- Truncate numeric
-select * from basictest;
-
-
--- Array Test
-create domain domainint4arr int4[1];
-create domain domaintextarr text[2][3];
-
-create table arrtest
-           ( testint4arr domainint4arr
-           , testtextarr domaintextarr
-           );
-INSERT INTO arrtest values ('{2,2}', '{{"a","b"}{"c","d"}}');
-INSERT INTO arrtest values ('{{2,2}{2,2}}', '{{"a","b"}}');
-INSERT INTO arrtest values ('{2,2}', '{{"a","b"}{"c","d"}{"e"}}');
-INSERT INTO arrtest values ('{2,2}', '{{"a"}{"c"}}');
-INSERT INTO arrtest values (NULL, '{{"a","b"}{"c","d","e"}}');
-
-
-create domain dnotnull varchar(15) NOT NULL;
-create domain dnull    varchar(15) NULL;
-
-create table nulltest
-           ( col1 dnotnull
-           , col2 dnotnull NULL  -- NOT NULL in the domain cannot be overridden
-           , col3 dnull    NOT NULL
-           , col4 dnull
-           );
-INSERT INTO nulltest DEFAULT VALUES;
-INSERT INTO nulltest values ('a', 'b', 'c', 'd');  -- Good
-INSERT INTO nulltest values (NULL, 'b', 'c', 'd');
-INSERT INTO nulltest values ('a', NULL, 'c', 'd');
-INSERT INTO nulltest values ('a', 'b', NULL, 'd');
-INSERT INTO nulltest values ('a', 'b', 'c', NULL); -- Good
-select * from nulltest;
-
-
-create domain ddef1 int4 DEFAULT 3;
-create domain ddef2 numeric(8,6) DEFAULT '1234.123456789';
--- Type mixing, function returns int8
-create domain ddef3 text DEFAULT 5;
-create sequence ddef4_seq;
-create domain ddef4 int4 DEFAULT nextval(cast('ddef4_seq' as text));
-
-create table defaulttest
-            ( col1 ddef1
-            , col2 ddef2
-            , col3 ddef3
-            , col4 ddef4
-            , col5 ddef1 NOT NULL DEFAULT NULL
-            , col6 ddef2 DEFAULT '88.1'
-            , col7 ddef4 DEFAULT 8000
-            );
-insert into defaulttest default values;
-insert into defaulttest default values;
-insert into defaulttest default values;
-select * from defaulttest;
index 357d17712b5b9ef9f64c7a7d0ccda1b0c3aae03d..d785121a0479f84069d7e34251775ea637b0e9d5 100644 (file)
@@ -1,6 +1,6 @@
 
 
 
       
      
 
-     
-      typbasetype
-      oid
-      
-      
-       typbasetype is the type that this one is based
-       off of.  Normally references the domains parent type, and is 0 otherwise.
-      
-     
-
-    
-     typnotnull
-     boolean
-     
-     
-      typnotnull represents a NOT NULL
-      constraint on a type.  Normally used only for domains.
-     
-    
-
-     
-      typmod
-      integer
-      
-      
-       typmod records type-specific data
-       supplied at table creation time (for example, the maximum
-       length of a varchar column).  It is passed to
-       type-specific input and output functions as the third
-       argument. The value will generally be -1 for types that do not
-       need typmod.  This data is copied to
-       pg_attribute.atttypmod on creation
-       of a table using a domain as it's field type.
-       
-     
-
-     
-      typdefaultbin
-      text
-      
-      
-       typdefaultbin is NULL for types without a
-       default value.  If it's not NULL, it contains the internal string
-       representation of the default expression node.
-      
-     
-
      
       typdefault
       text
index 948e2cdac5ed13f110b147f88e44f8fbce1f652c..3ea658fd0427fc75b1fe21f52408d5fe2cd00cbd 100644 (file)
@@ -1,5 +1,5 @@
 
@@ -52,7 +52,6 @@ Complete list of usable sgml source files in this directory.
 
 
 
-
 
 
 
@@ -70,7 +69,6 @@ Complete list of usable sgml source files in this directory.
 
 
 
-
 
 
 
index 2482a2d7e33fdde23ab5980bfcbe8bebed4c5a1f..026533de9542df6151dc2e69307c2155db14f164 100644 (file)
@@ -1,5 +1,5 @@
 
 
@@ -25,7 +25,7 @@ PostgreSQL documentation
   
 COMMENT ON
 [
-  [ DATABASE | DOMAIN | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ] object_name |
+  [ DATABASE | INDEX | RULE | SEQUENCE | TABLE | TYPE | VIEW ] object_name |
   COLUMN table_name.column_name |
   AGGREGATE agg_name (agg_type) |
   FUNCTION func_name (arg1, arg2, ...) |
@@ -33,7 +33,7 @@ COMMENT ON
   TRIGGER trigger_name ON table_name
 ] IS 'text'
   
-
+  
   
    
     1999-10-25
@@ -64,7 +64,7 @@ COMMENT ON
     
    
   
-
+  
   
    
     1998-09-08
@@ -99,7 +99,7 @@ COMMENT
   
   
    COMMENT stores a comment about a database object.
-    Comments can be
+    Comments can be 
     easily retrieved with psql's
     \dd\d+, or \l+
     commands.  Other user interfaces to retrieve comments can be built atop
@@ -141,7 +141,6 @@ COMMENT ON mytable IS 'This is my table.';
 
    
 COMMENT ON DATABASE my_database IS 'Development Database';
-COMMENT ON DOMAIN my_domain IS 'Domains are like abstracted fields';
 COMMENT ON INDEX my_index IS 'Enforces uniqueness on employee id';
 COMMENT ON RULE my_rule IS 'Logs UPDATES of employee records';
 COMMENT ON SEQUENCE my_sequence IS 'Used to generate primary keys';
@@ -156,12 +155,12 @@ COMMENT ON TRIGGER my_trigger ON my_table IS 'Used for R.I.';
    
   
  
-
  
   </div> <div class="diff ctx">    Compatibility</div> <div class="diff ctx">   
-
+  
   
    
     1998-09-08
diff --git a/doc/src/sgml/ref/create_domain.sgml b/doc/src/sgml/ref/create_domain.sgml
deleted file mode 100644 (file)
index f88069b..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-
-
-
-  
-   CREATE DOMAIN
-  
-  SQL - Language Statements
-  
-   CREATE DOMAIN
-  
-  
-   define a new domain
-  
-  
-   2002-02-24
-  
-  
-CREATE DOMAIN domainname data_type  [ DEFAULT default_expr ] [ column_constraint [, ... ] ]
-[ CONSTRAINT constraint_name ]
-{ NOT NULL | NULL  }
-
-  
-
-  
-   
-    2002-02-24
-   
-   </div> <div class="diff rem">-    Parameters</div> <div class="diff rem">-   
-   
-
-    
-     
-      domainname
-      
-       
-   The name of a domain to be created.
-       
-      
-     
-
-     
-      data_type
-      
-       
-        The data type of the domain. This may include array specifiers.
-        Refer to the User's Guide for further
-        information about data types and arrays.
-       
-      
-     
-
-     
-      DEFAULT
-      default_expr
-      
-       
-        The DEFAULT clause assigns a default data value for
-        the column whose column definition it appears within.  The value
-        is any variable-free expression (subselects and cross-references
-        to other columns in the current table are not allowed).  The
-        data type of the default expression must match the data type of the
-        domain.
-       
-
-       
-        The default expression will be used in any insert operation that
-        does not specify a value for the domain.  If there is no default
-        for a domain, then the default is NULL.
-       
-
-       
-        
-         The default of a column will be tested before that of the domain.
-        
-       
-      
-     
-
-     
-      CONSTRAINT constraint_name
-      
-       
-        An optional name for a domain.  If not specified,
-        the system generates a name.
-       
-      
-     
-
-     
-      NOT NULL
-      
-       
-        The column is not allowed to contain NULL values.  This is
-        equivalent to the column constraint CHECK (
-        class="PARAMETER">column NOT NULL).
-       
-      
-     
-
-     
-      NULL
-      
-       
-        The column is allowed to contain NULL values. This is the default.
-       
-
-       
-        This clause is only available for compatibility with
-        non-standard SQL databases.  Its use is discouraged in new
-        applications.
-       
-      
-     
-
-    
-   
-  
-
-  
-   
-    2002-02-24
-   
-   </div> <div class="diff rem">-    Outputs</div> <div class="diff rem">-   
-   
-
-    
-     
-      
-CREATE DOMAIN
-       
-      
-       
-   Message returned if the domain is successfully created.
-       
-      
-     
-    
-   
-  
-
-  
-   2002-02-24
-  
-  </div> <div class="diff rem">-   Description</div> <div class="diff rem">-  
-
-  
-   CREATE DOMAIN  allows  the user to register a new user data
-   domain with PostgreSQL for use in the current data base.   The
-   user  who  defines  a domain becomes its owner.
-   domainname is
-   the name of the new type and must  be  unique  within  the
-   types and domains defined for this database.
-  
-
-  
-   Domains are useful for abstracting common fields between tables into
-   a single location for maintenance.  An email address column may be used
-   in several tables, all with the same properties.  Define a domain and
-   use that rather than setting up each tables constraints individually.
-  
-
-  Examples
-  
-   This example creates the country_code data type and then uses the
-   type in a table definition:
-
-CREATE DOMAIN country_code char(2) NOT NULL;
-CREATE TABLE countrylist (id INT4, country country_code);
-
-  
-
-  Compatibility
-
-  
-   This CREATE DOMAIN command is a
-   PostgreSQL extension.  CHECK and FOREIGN KEY
-   constraints are currently unsupported.
-  
-
-  See Also
-
-  
-   
-   PostgreSQL Programmer's Guide
-  
-
-
-
-
-
diff --git a/doc/src/sgml/ref/drop_domain.sgml b/doc/src/sgml/ref/drop_domain.sgml
deleted file mode 100644 (file)
index d508d6a..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-  
-   DROP DOMAIN
-  
-  SQL - Language Statements
-  
-   DROP DOMAIN
-  
-  
-   remove a user-defined domain
-  
-  
-   1999-07-20
-  
-  
-DROP DOMAIN domainname [, ...]
-  
-
-  
-   
-    2002-02-24
-   
-   </div> <div class="diff rem">-    Inputs</div> <div class="diff rem">-   
-   
-    
-     
-      domainname
-      
-       
-   The name of an existing domain.
-       
-      
-     
-    
-   
-  
-
-  
-   
-    2002-02-24
-   
-   </div> <div class="diff rem">-    Outputs</div> <div class="diff rem">-   
-   
-    
-     
-      
-DROP
-       
-      
-       
-   The message returned if the command is successful.
-       
-      
-     
-     
-      
-ERROR:  RemoveDomain: type 'domainname' does not exist
-       
-      
-       
-   This message occurs if the specified domain (or type) is not found.
-       
-      
-     
-    
-   
-  
-
-  
-   2002-02-24
-  
-  </div> <div class="diff rem">-   Description</div> <div class="diff rem">-  
-  
-   DROP DOMAIN will remove a user domain from the
-   system catalogs.
-  
-  
-   Only the owner of a domain can remove it.
-  
-
-  Notes
-
-  
-   
-    
-     It is the user's responsibility to remove any operators,
-     functions, aggregates, access methods, and tables that
-     use a deleted domain.
-    
-   
-  
-
-  Examples
-  
-   To remove the box domain:
-
-
-DROP DOMAIN box RESTRICT;
-
-  
-
-  Compatibility
-
-  
-   A DROP DOMAIN statement exists in SQL99.  As with
-   most other drop commands, DROP
-   DOMAIN in SQL99 requires a drop behavior
-   clause to select between dropping all dependent objects or refusing
-   to drop if dependent objects exist:
-
-DROP DOMAIN name { CASCADE | RESTRICT }
-
-   PostgreSQL enforces the existance of
-   RESTRICT or CASCADE but ignores their enforcement against the
-   system tables.
-  
-
-  See Also
-
-  
-   
-  
-
-
-
index 14fd89b0a4f6a795c423611d86c8c9779922ccc4..0ca0ea5a9c471f1056158b1c5dc835db164da179 100644 (file)
@@ -1,5 +1,5 @@
 
@@ -61,7 +61,6 @@ PostgreSQL Reference Manual
    &createAggregate;
    &createConstraint;
    &createDatabase;
-   &createDomain;
    &createFunction;
    &createGroup;
    &createIndex;
@@ -79,7 +78,6 @@ PostgreSQL Reference Manual
    &delete;
    &dropAggregate;
    &dropDatabase;
-   &dropDomain;
    &dropFunction;
    &dropGroup;
    &dropIndex;
@@ -117,7 +115,7 @@ PostgreSQL Reference Manual
    &unlisten;
    &update;
    &vacuum;
-
+