Document that we deviate from ISO 8601 by not using 'T' on output.
authorTom Lane
Mon, 21 May 2012 15:56:00 +0000 (11:56 -0400)
committerTom Lane
Mon, 21 May 2012 15:56:00 +0000 (11:56 -0400)
Per discussion, we should explain that we follow RFC 3339 and not really
the letter of the ISO 8601 spec for timestamp output format.  Mostly
Brendan Jurd's wording, though I tweaked it to clarify that we do take 'T'
on input.  Minor additional copy-editing and markup-tweaking, too.

doc/src/sgml/datatype.sgml

index 2ac6a81aa3737230593f9d6c0d676de2e8f4d839..7e4107cce80714e299abce44e9666f6be5580f82 100644 (file)
@@ -2206,37 +2206,46 @@ January 8 04:05:06 1999 PST
        
        
         
-         ISO
-         ISO 8601/SQL standard
-         1997-12-17 07:37:16-08
+         ISO
+         ISO 8601SQL standard
+         1997-12-17 07:37:16-08
         
         
-         SQL
+         SQL
          traditional style
-         12/17/1997 07:37:16.00 PST
+         12/17/1997 07:37:16.00 PST
         
         
-         POSTGRES
+         Postgres
          original style
-         Wed Dec 17 07:37:16 1997 PST
+         Wed Dec 17 07:37:16 1997 PST
         
         
-         German
+         German
          regional style
-         17.12.1997 07:37:16.00 PST
+         17.12.1997 07:37:16.00 PST
         
        
       
      
 
+    
+     
+      ISO 8601 specifies the use of uppercase letter T to separate
+      the date and time.  PostgreSQL accepts that format on
+      input, but on output it uses a space rather than T, as shown
+      above.  This is for readability and for consistency with RFC 3339 as
+      well as some other database systems.
+     
+    
+
     
      In the SQL and POSTGRES styles, day appears before
      month if DMY field ordering has been specified, otherwise month appears
      before day.
      (See 
      for how this setting also affects interpretation of input values.)
-      shows an
-     example.
+      shows examples.
     
 
      
@@ -2253,29 +2262,33 @@ January 8 04:05:06 1999 PST
         
          SQL, DMY
          day/month/year
-         17/12/1997 15:37:16.00 CET
+         17/12/1997 15:37:16.00 CET
         
         
          SQL, MDY
          month/day/year
-         12/17/1997 07:37:16.00 PST
+         12/17/1997 07:37:16.00 PST
         
         
          Postgres, DMY
          day/month/year
-         Wed 17 Dec 07:37:16 1997 PST
+         Wed 17 Dec 07:37:16 1997 PST
         
        
       
      
 
     
-     The date/time styles can be selected by the user using the
+     The date/time style can be selected by the user using the
      SET datestyle command, the 
      linkend="guc-datestyle"> parameter in the
      postgresql.conf configuration file, or the
      PGDATESTYLE environment variable on the server or
-     client.  The formatting function to_char
+     client.
+    
+
+    
+     The formatting function to_char
      (see ) is also available as
      a more flexible way to format date/time output.