is a floating element, so it's use is inappropriate when the
authorPeter Eisentraut
Tue, 10 Aug 2010 20:41:27 +0000 (20:41 +0000)
committerPeter Eisentraut
Tue, 10 Aug 2010 20:41:27 +0000 (20:41 +0000)
surrounding text refers to the example inline.

doc/src/sgml/datatype.sgml

index 2ce1c7b6982e7a8d9353a8082d54cb03ef1e49ea..bc8fba171413aaab67ac33cc83e2c4ba3ecc9481 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
  
   Data Types
@@ -2877,10 +2877,6 @@ CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
 
      Once created, the enum type can be used in table and function
      definitions much like any other type:
-    
-
-    
-     Basic Enum Usage
 
 CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
 CREATE TABLE person (
@@ -2894,7 +2890,7 @@ SELECT * FROM person WHERE current_mood = 'happy';
  Moe  | happy
 (1 row)
 
-     >
+    >
     
 
     
@@ -2905,10 +2901,7 @@ SELECT * FROM person WHERE current_mood = 'happy';
       order in which the values were listed when the type was created.
       All standard comparison operators and related
       aggregate functions are supported for enums.  For example:
-     
-
-     
-      Enum Ordering
 
 INSERT INTO person VALUES ('Larry', 'sad');
 INSERT INTO person VALUES ('Curly', 'ok');
@@ -2934,7 +2927,7 @@ WHERE current_mood = (SELECT MIN(current_mood) FROM person);
  Larry
 (1 row)
 
-    >
+     >
    
 
    
@@ -2942,11 +2935,8 @@ WHERE current_mood = (SELECT MIN(current_mood) FROM person);
 
     
      Each enumerated data type is separate and cannot
-     be compared with other enumerated types.
-    
+     be compared with other enumerated types.  See this example:
 
-    
-     Lack of Casting
 
 CREATE TYPE happiness AS ENUM ('happy', 'very happy', 'ecstatic');
 CREATE TABLE holidays (
@@ -2962,15 +2952,12 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
   WHERE person.current_mood = holidays.happiness;
 ERROR:  operator does not exist: mood = happiness
 
-    example>
+    para>
 
     
      If you really need to do something like that, you can either
      write a custom operator or add explicit casts to your query:
-    
 
-    
-     Comparing Different Enums by Casting to Text
 
 SELECT person.name, holidays.num_weeks FROM person, holidays
   WHERE person.current_mood::text = holidays.happiness::text;
@@ -2980,7 +2967,7 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
 (1 row)
 
 
-    example>
+    para>