]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix typmod interpretation for bit types. (It was erroneously assumed that
authorPeter Eisentraut <peter_e@gmx.net>
Sun, 7 Dec 2003 10:18:50 +0000 (10:18 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Sun, 7 Dec 2003 10:18:50 +0000 (10:18 +0000)
for bit(x), the typmod stores x+4, like for the character types.)

doc/src/sgml/release.sgml
src/backend/catalog/information_schema.sql

index fa5cf3c8d0131c62492d72bf037682df7c409bea..6f638ea8667d172152b26766d273d5eace70b88b 100644 (file)
@@ -1,10 +1,55 @@
 <!--
-$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.235.2.9 2003/12/02 16:14:38 tgl Exp $
+$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.235.2.10 2003/12/07 10:18:50 petere Exp $
 -->
 
 <appendix id="release">
  <title>Release Notes</title>
 
+ <sect1 id="release-7-4-1">
+  <title>Release 7.4.1</title>
+
+  <note>
+   <title>Release date</title>
+   <simpara>not yet</simpara>
+  </note>
+
+  <para>
+   This release contains a number of fixes for release 7.4.
+  </para>
+
+  <sect2>
+   <title>Migration to version 7.4.1</title>
+
+   <para>
+    A dump/restore is <emphasis>not</emphasis> required for those
+    running release 7.4.
+   </para>
+
+   <para>
+    If you want to install the fixes in the information schema
+    concerning the bit types, you need to reload the information
+    schema.  This is either accomplished by initializing a new cluster
+    by running <command>initdb</command>, or by running the following
+    sequence of SQL commands in each database (ideally including
+    <literal>template1</literal>) as a superuser in
+    <application>psql</application>, after installing the new release:
+<programlisting>
+DROP SCHEMA information_schema CASCADE;
+\i /usr/local/pgsql/share/information_schema.sql
+</programlisting>
+    Substitute your installation path in the second command.
+   </para>
+  </sect2>
+
+  <sect2>
+   <title>Changes</title>
+
+   <para>
+    TBD
+   </para>
+  </sect2>
+ </sect1>
+
  <sect1 id="release-7-4">
   <title>Release 7.4</title>
 
index 96e5e554d98ebe3e96a7503e0e443914a10979be..de86192f0eda253e37a0fe37532fe5d18f708096 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright 2003, PostgreSQL Global Development Group
  *
- * $Id: information_schema.sql,v 1.15.2.1 2003/11/08 20:43:57 tgl Exp $
+ * $Id: information_schema.sql,v 1.15.2.2 2003/12/07 10:18:50 petere Exp $
  */
 
 /*
@@ -260,12 +260,16 @@ CREATE VIEW columns AS
 
            CAST(
              CASE WHEN t.typtype = 'd' THEN
-               CASE WHEN t.typbasetype IN (25, 1042, 1043, 1560, 1562) AND t.typtypmod <> -1
-                    THEN t.typtypmod - 4
+               CASE WHEN t.typbasetype IN (1042, 1043) AND t.typtypmod <> -1
+                    THEN t.typtypmod - 4 /* char, varchar */
+                    WHEN t.typbasetype IN (1560, 1562) AND t.typtypmod <> -1
+                    THEN t.typtypmod /* bit, varbit */
                     ELSE null END
              ELSE
-               CASE WHEN a.atttypid IN (25, 1042, 1043, 1560, 1562) AND a.atttypmod <> -1
+               CASE WHEN a.atttypid IN (1042, 1043) AND a.atttypmod <> -1
                     THEN a.atttypmod - 4
+                    WHEN a.atttypid IN (1560, 1562) AND a.atttypmod <> -1
+                    THEN a.atttypmod
                     ELSE null END
              END
              AS cardinal_number)
@@ -559,8 +563,10 @@ CREATE VIEW domains AS
              AS data_type,
 
            CAST(
-             CASE WHEN t.typbasetype IN (25, 1042, 1043, 1560, 1562) AND t.typtypmod <> -1
-                  THEN t.typtypmod - 4
+             CASE WHEN t.typbasetype IN (1042, 1043) AND t.typtypmod <> -1
+                  THEN t.typtypmod - 4 /* char, varchar */
+                  WHEN t.typbasetype IN (1560, 1562) AND t.typtypmod <> -1
+                  THEN t.typtypmod /* bit, varbit */
                   ELSE null END
              AS cardinal_number)
              AS character_maximum_length,