aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2003-12-07 10:18:50 +0000
committerPeter Eisentraut <peter_e@gmx.net>2003-12-07 10:18:50 +0000
commitd5130d2387bc72fd35f061cb33b781d4dafa709c (patch)
treec95b5d1ebcd99d56961e1586e120b268d4c88502 /src
parent14ddc01eaffdd1287cc9a1be1dfa7e4a3d32191e (diff)
downloadpostgresql-d5130d2387bc72fd35f061cb33b781d4dafa709c.tar.gz
postgresql-d5130d2387bc72fd35f061cb33b781d4dafa709c.zip
Fix typmod interpretation for bit types. (It was erroneously assumed that
for bit(x), the typmod stores x+4, like for the character types.)
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/information_schema.sql18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql
index 96e5e554d98..de86192f0ed 100644
--- a/src/backend/catalog/information_schema.sql
+++ b/src/backend/catalog/information_schema.sql
@@ -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,